Yes, the popular unlock tool Blacksn0w for iPhone 3GS, 05.11.07 baseband on iPhone 3.1.3/3.1.2 has been successfully ported to work with the latest iPhone OS 4 Beta 4. This port has been done by Vincent using the unlock tool from Geohot and he unlock an iPhone to work on Vodafone.
It needs a professional user to unlock his device, So if you are not you probably want to wait till the iPhone Dev Team Releases the Unlock for for iPhone 3.1.3, 05.12.01 baseband that will be soon this month after Apple announces the next iPhone.
You can follow the guide in the video to Unlock your iPhone using Blacksn0w on OS 4 beta 4:
In mean time if you want to jailbreak your Device you can use the Step-By-Step guide to Jailbreak any iPhone, iPad, iPod using Spirit, More details Here.