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.

Revisions

  1. vvsotnikov revised this gist Apr 29, 2018. No changes.
  2. vvsotnikov created this gist Sep 9, 2017.
    34 changes: 34 additions & 0 deletions Ixibium.sol
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,34 @@
    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];
    }
    }