Created
June 6, 2016 07:24
-
-
Save elenadimitrova/2ff77c3414b1718019692eb056893fac to your computer and use it in GitHub Desktop.
This file contains hidden or 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 ITokenLedger { | |
function generateTokens(uint256 _amount) {} | |
} | |
contract TokenLedger { | |
uint256 total_supply; | |
mapping (address => uint256) balances; | |
function generateTokens(uint256 _amount) | |
{ | |
if(_amount == 0) throw; | |
if (total_supply + _amount < _amount) throw; | |
total_supply += _amount; | |
balances[msg.sender] += _amount; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment