pragma solidity >=0.4.22 <0.6.0; import "remix_tests.sol"; // this import is automatically injected by Remix. interface dapp { function metaTx(address initiatorAddr, bytes calldata message, uint8 v, bytes32 r, bytes32 s, uint256 nonce) external returns (bool); } contract relayer { dapp dappContract; constructor(address dappAddr) public { // 傳入想幫忙 relay 的 address dappContract = dapp(dappAddr); } function relayTx(bytes memory message, uint8 v, bytes32 r, bytes32 s, uint256 nonce) public { dappContract.metaTx(msg.sender, message, v, r, s, nonce); // 注意:msg.sender 理應不需要為這行付 gas } }
0.6.0