Apple renamed iPhone 4G to iPhone 4 and iPhone OS 4.0 to iOS 4.0 at WWDC 2010. However as confirmed by iPhone-Dev-Team, the latest version of Redsn0w which previously jailbreaked iPhone OS 4.0 Beta 4 on iPhone 3G is fully capable of jailbreaking the latest iOS 4.0 GM (Gold Master) release. You can download Redsn0w 0.9.5b4 from here and follow our step-by-step guide to jailbreak iOS 4.0 GM on iPhone 3G with Redsn0w 0.9.5b4 here.
Below is a tweet from MuscleNerd for those who want to jailbreak iOS 4.0 GM on their iPhone 3G:
For those who can legitimately activate to the iPhone3G 4.0GM seed, the "point to previous IPSW" redsn0w trick works and will jailbreak your 4.0GM. The "trick" is to point redsn0w at the 4.0beta4 IPSW instead of 4.0GM (do this after you've updated to 4.0GM and activated through the new iTunes 9.2 on your Mac). Since the carrier unlocks aren't yet supported at 4.0, don't do this if you use yellowsn0w/ultrasn0w/blacksn0w. Many JB apps are still pretty buggy in 4.0, so again this is mostly useful only for developers of those JB apps.
iOS 4.0 update will be officially available to users wef 21st June 2010. iPhone-Dev-Team will be releasing an unlock tool for iOS 4.0 as soon as the update is publicly available. Another hacker have already released a video in which he successfully unlocked iPhone 3GS running iPhone OS 4.0 Beta 4 baseband 05.11.07 with Blacksn0w. [via wikee.iphwn.org]
Update 1: Redsn0w 0.9.5b5 iOS 4.0 Jailbreak for iPhone 3G & iPod Touch 2G
Update 2: Jailbreak iOS 4.0 with Redsn0w 0.9.5b5-2 on Mac | Windows
Update 3: Jailbreak iOS 4.0 with Redsn0w 0.9.5b5-3 [Hacktivated]
Update 4: Redsn0w 0.9.5b5-4: Fix iBooks Issues After iOS 4.0 Jailbreak
Update 5: Download Redsn0w 0.9.5b5-5 to Fix iOS 4 APN / MMS Issues