Forked from noeleon930/gist:6fbe3effffba92241f7b4957e4ac3f66
Created
October 19, 2016 13:37
-
-
Save DerayGa/0b75ab49259ee62d5aa3b5f11d908126 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
| pragma solidity ^0.4.0; | |
| contract NccuBank { | |
| address public minter; | |
| mapping (address => uint) public balances; | |
| event Sent(address from, address to, uint amount); | |
| function NccuBank() { | |
| minter = msg.sender; | |
| } | |
| function mint(address receiver, uint amount) returns (bool) { | |
| if (msg.sender != minter) return false; | |
| balances[receiver] += amount; | |
| return true; | |
| } | |
| function _send(address receiver, uint amount) returns (bool) { | |
| if (balances[msg.sender] < amount) return false; | |
| balances[msg.sender] -= amount; | |
| balances[receiver] += amount; | |
| Sent(msg.sender, receiver, amount); | |
| return true; | |
| } | |
| function check() constant returns (uint) { | |
| return balances[msg.sender]; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment