Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save elenadimitrova/2ff77c3414b1718019692eb056893fac to your computer and use it in GitHub Desktop.
Save elenadimitrova/2ff77c3414b1718019692eb056893fac to your computer and use it in GitHub Desktop.
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