Created
June 26, 2015 15:01
-
-
Save jnicho02/26d8fa1662cf1f7371bf 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 jtoken { | |
mapping (address => uint) public balances; | |
address public admin; | |
uint tax; | |
function jtoken() | |
{ | |
balances[msg.sender] = 1000; | |
admin = msg.sender; | |
tax = 1; | |
} | |
function sendToken(address receiver, uint amount) | |
{ | |
if(balances[msg.sender] < amount + tax) return; | |
balances[msg.sender] -= amount; | |
balances[receiver] += amount; | |
balances[admin] += tax; | |
} | |
function setTax(uint value) | |
{ | |
if (msg.sender == admin) return; | |
tax = value; | |
} | |
function getBalance() returns (uint) | |
{ | |
return balances[msg.sender]; | |
} | |
function kill() { | |
if (msg.sender == admin) { | |
suicide(admin); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment