Created
April 14, 2016 18:01
-
-
Save czepluch/8d1afe9e81bfe2d431c460c094316a63 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 MyToken{ | |
string public name; | |
string public symbol; | |
uint8 public decimals; | |
mapping (address => uint256) public balanceOf; | |
event Transfer(address indexed from, address indexed to, uint256 value); | |
function MyToken(uint256 _supply, string _name, string _symbol, uint8 _decimals) { | |
if (_supply == 0) _supply = 1000; | |
balanceOf[msg.sender] = _supply; | |
name = _name; | |
symbol = _symbol; | |
decimals = _decimals; | |
} | |
function transfer(address _to, uint256 _amount) { | |
if (balanceOf[msg.sender] < _amount) throw; | |
balanceOf[msg.sender] -= _amount; | |
balanceOf[_to] += _amount; | |
Transfer(msg.sender, _to, _amount); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment