Last active
April 29, 2018 15:40
-
-
Save vvsotnikov/c0e301b158f72bf418c0628d59bf99ef to your computer and use it in GitHub Desktop.
Simple Ethereum token.
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 Ixibium | |
{ | |
address public owner; | |
uint public totalMoney; | |
event TransactionMade(address sender, address receiver, string message, uint amount); | |
mapping (address => uint) private wallets; | |
function Ixibium(uint _amount) { | |
owner = msg.sender; | |
totalMoney = _amount; | |
wallets[owner] = _amount; | |
} | |
function Send(string _message, uint _amount, address _address) { | |
require(_amount > 0); | |
require(_amount <= wallets[msg.sender]); | |
wallets[msg.sender] -= _amount; | |
wallets[_address] += _amount; | |
TransactionMade(msg.sender, _address, _message, _amount); | |
} | |
function Emit(uint _amount) { | |
require(msg.sender == owner); | |
totalMoney += _amount; | |
wallets[owner] += _amount; | |
} | |
function GetBalance() constant returns (uint) { | |
return wallets[msg.sender]; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment