Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* Compiler version */
- pragma solidity ^0.4.13;
- contract MyCoin {
- mapping (address => uint) public balance;
- event Transfer(address from, address to, uint value);
- /* constructor, will be called only once, when the contract is deployed to the network */
- function MyCoin(uint initialSupply) {
- balance[msg.sender] = initialSupply;
- }
- /* simple function for transfering the coin */
- /* Just for testing purpose, will add more error handling check in the future */
- function transfer(address _to, uint _value) returns (bool success) {
- if (balance[msg.sender] < _value) revert();
- balance[msg.sender] -= _value;
- balance[_to] += _value;
- Transfer(msg.sender, _to, _value);
- return true;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement