diff options
author | Hsuan Lee <hsuan@cobinhood.com> | 2019-01-19 18:42:04 +0800 |
---|---|---|
committer | Hsuan Lee <hsuan@cobinhood.com> | 2019-01-19 18:42:04 +0800 |
commit | 7ae38906926dc09bc10670c361af0d2bf0050426 (patch) | |
tree | 5fb10ae366b987db09e4ddb4bc3ba0f75404ad08 /packages/metacoin/contracts | |
parent | b5fd3c72a08aaa6957917d74c333387a16edf66b (diff) | |
download | dexon-sol-tools-7ae38906926dc09bc10670c361af0d2bf0050426.tar dexon-sol-tools-7ae38906926dc09bc10670c361af0d2bf0050426.tar.gz dexon-sol-tools-7ae38906926dc09bc10670c361af0d2bf0050426.tar.bz2 dexon-sol-tools-7ae38906926dc09bc10670c361af0d2bf0050426.tar.lz dexon-sol-tools-7ae38906926dc09bc10670c361af0d2bf0050426.tar.xz dexon-sol-tools-7ae38906926dc09bc10670c361af0d2bf0050426.tar.zst dexon-sol-tools-7ae38906926dc09bc10670c361af0d2bf0050426.zip |
Update dependency packages
Diffstat (limited to 'packages/metacoin/contracts')
-rw-r--r-- | packages/metacoin/contracts/Metacoin.sol | 40 |
1 files changed, 0 insertions, 40 deletions
diff --git a/packages/metacoin/contracts/Metacoin.sol b/packages/metacoin/contracts/Metacoin.sol deleted file mode 100644 index dc67e6242..000000000 --- a/packages/metacoin/contracts/Metacoin.sol +++ /dev/null @@ -1,40 +0,0 @@ -pragma solidity ^0.4.24; -pragma experimental ABIEncoderV2; - -contract Metacoin { - mapping (address => uint) public balances; - - event Transfer(address indexed _from, address indexed _to, uint256 _value); - - struct TransferData { - address to; - uint256 amount; - } - - struct NestedTransferData { - TransferData transferData; - uint32 callback; - } - - constructor () public { - balances[msg.sender] = 10000; - } - - function transfer(TransferData transferData) public returns (bool success) { - if (balances[msg.sender] < transferData.amount) return false; - balances[msg.sender] -= transferData.amount; - balances[transferData.to] += transferData.amount; - emit Transfer(msg.sender, transferData.to, transferData.amount); - return true; - } - - function transfer(TransferData transferData, uint32 callback) public returns (int) { - transfer(transferData); - return callback; - } - - function transfer(NestedTransferData nestedTransferData) public returns (int) { - return transfer(nestedTransferData.transferData, nestedTransferData.callback); - } - -} |