Skip to content

Instantly share code, notes, and snippets.

@vvsotnikov
Last active April 29, 2018 15:40
Show Gist options
  • Save vvsotnikov/c0e301b158f72bf418c0628d59bf99ef to your computer and use it in GitHub Desktop.
Save vvsotnikov/c0e301b158f72bf418c0628d59bf99ef to your computer and use it in GitHub Desktop.
Simple Ethereum token.
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