iPhone 3G and 3GS users, as well as current (and I think the last gen) iPod Touch users, can upgrade their OS to v4 for free. In case some of you were not aware.
http://www.apple.com/iphone/softwareupdate/#install
http://www.apple.com/iphone/softwareupdate/#install