Forked from elenadimitrova/ITokenLedger.sol and TokenLedger.sol
Created
March 15, 2017 09:14
-
-
Save cicorias/28ca8be38ccae33c53a428367f110697 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