There is a written contract between yourself and the client, you signed it when you accepted the oDesk Terms Of Service (TOS). I also work on oDesk and so am familiar with their TOS:
Looking here under section 8.6:
Proprietary Rights in Work Product shall be owned by Freelancer until payment has been made by Client, at which time Freelancer will be deemed to have assigned all Proprietary Rights in the Work Product to Client.
This means that once the client has paid you for the work you did, they own the code that you wrote. The intellectual property rights belong to them.
It is up to the client to decide what you do with that code. I usually store all the code I write in a private repository, so that if the client needs me to do more work or modify the code I wrote, I can easily access it. If the client requires I delete all the code (which is rare, but possible), then I am contractually obligated to do so.
Making that code public is not up to you, it's up to the client to decide what they will do with the code.
Side note: Usually most people don't read the TOS for websites, but there are some cases, like this one, where it is incredibly important to read the TOS and know what's in there, otherwise there can be serious legal consequences.