Skip to content

Instantly share code, notes, and snippets.

@aakilfernandes
Last active January 24, 2016 01:25
Show Gist options
  • Save aakilfernandes/8892e9599ac5c1d057e9 to your computer and use it in GitHub Desktop.
Save aakilfernandes/8892e9599ac5c1d057e9 to your computer and use it in GitHub Desktop.
Order 2
contract Order implements DataStorageInterface{
function Order(){
//a private function only accessible internally
this._setValue('address', 'owner', msg.sender)
this._setValue('uint', 'timestamp', now)
}
function setValue(valueType,valueVar,value){ //a public function anyone can call
var owner = this._getValue('address', 'owner');
if(msg.sender != owner) throw;
//dont allow the timestamp to be updated
if(valueVar == 'timestamp') throw;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment