Skip to content

Instantly share code, notes, and snippets.

@aquabu
Last active June 25, 2016 02:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aquabu/ea4bd3825e2cb20afc049a0445e6498d to your computer and use it in GitHub Desktop.
Save aquabu/ea4bd3825e2cb20afc049a0445e6498d to your computer and use it in GitHub Desktop.
WorkHistory smart contract
contract WorkHistory {
event TaskProof(string taskProof, int amount, address authorizer, address to);
mapping(string => bool) taskProofExists;
/* taskProof is a unique id such as an IPFS hash
amount is the amount granted to the _to address by the _authorizer
*/
function register(string _taskProof, int amount, address _authorizer, address _to) returns(bool success) {
if(taskProofExists[_taskProof]) {
return false;
} else {
TaskProof(_taskProof, amount, _authorizer, _to);
taskProofExists[_taskProof] = true;
return true;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment