Last active
April 29, 2018 15:40
-
-
Save vvsotnikov/c0e301b158f72bf418c0628d59bf99ef to your computer and use it in GitHub Desktop.
Revisions
-
vvsotnikov revised this gist
Apr 29, 2018 . No changes.There are no files selected for viewing
-
vvsotnikov created this gist
Sep 9, 2017 .There are no files selected for viewing
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 charactersOriginal 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]; } }