Created
December 13, 2016 09:37
Super simple Ethereum smart contract for testing.
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
pragma solidity ^0.4.0; | |
contract Token { | |
mapping (address => uint) public balances; | |
function Token() { | |
balances[msg.sender] = 1000000; | |
} | |
function transfer(address _to, uint _amount) { | |
if (balances[msg.sender] < _amount) { | |
throw; | |
} | |
balances[msg.sender] -= _amount; | |
balances[_to] += _amount; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment