diff options
author | Determinant <[email protected]> | 2020-07-29 12:01:05 -0400 |
---|---|---|
committer | Determinant <[email protected]> | 2020-07-29 12:01:05 -0400 |
commit | 1f49826de2bb8bb4f5f99f69fd2beb039b1172d9 (patch) | |
tree | 4db4d3687f89f55c42898ba12e59e2236da03558 /examples/multicoin/mc_test.sol | |
parent | 67ae6a33a4bfd74dad0a043f07f91647d34cff8d (diff) |
clean upmulti-coin
Diffstat (limited to 'examples/multicoin/mc_test.sol')
-rw-r--r-- | examples/multicoin/mc_test.sol | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/examples/multicoin/mc_test.sol b/examples/multicoin/mc_test.sol index bfd42a5..ec07ee6 100644 --- a/examples/multicoin/mc_test.sol +++ b/examples/multicoin/mc_test.sol @@ -5,23 +5,23 @@ contract MCTest { uint256 balance; constructor() public { // enable multi-coin functionality (it is disabled by default) - (bool success,) = MultiCoin.delegatecall(abi.encodeWithSignature("enableMultiCoin()")); + (bool success,) = MultiCoin.call(abi.encodeWithSignature("enableMultiCoin()")); require(success); } function updateBalance(uint256 coinid) public { - (bool success, bytes memory data) = MultiCoin.delegatecall(abi.encodeWithSignature("getBalance(uint256)", coinid)); + (bool success, bytes memory data) = MultiCoin.call(abi.encodeWithSignature("getBalance(uint256)", coinid)); require(success); balance = abi.decode(data, (uint256)); } - function deposit() public payable {} - function withdraw(uint256 amount, uint256 coinid, uint256 amount2) public { - (bool success,) = MultiCoin.delegatecall( + (bool success,) = MultiCoin.call( abi.encodeWithSignature("transfer(address,uint256,uint256,uint256)", msg.sender, amount, coinid, amount2)); require(success); } + + receive() external payable {} } |