Last active
August 17, 2017 18:15
-
-
Save aunyks/643fc6334b56b12e4f86e30c76c5c698 to your computer and use it in GitHub Desktop.
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 MyERCToken { | |
// Create a table so that we can map | |
// the addresses of contract owners to | |
// those who are allowed to utilize the owner's contract | |
mapping(address => mapping (address => uint256)) allowed; | |
function approve(address _spender, uint256 _amount) returns (bool success) { | |
allowed[msg.sender][_spender] = _amount; | |
// Fire the event "Approval" to execute any logic | |
// that was listening to it | |
Approval(msg.sender, _spender, _amount); | |
return true; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment