Last active
January 24, 2016 01:25
-
-
Save aakilfernandes/8892e9599ac5c1d057e9 to your computer and use it in GitHub Desktop.
Order 2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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