From 9a7c5ace54a1342758e132e7783a963b2a9e884b Mon Sep 17 00:00:00 2001 From: Facu Spagnuolo Date: Wed, 10 Jun 2020 17:19:16 -0300 Subject: [PATCH 1/4] forwarder: move to separate dir and make fns external --- contracts/common/IForwarder.sol | 18 ------------------ contracts/forwarding/IForwarder.sol | 14 ++++++++++++++ .../{common => forwarding}/IForwarderFee.sol | 0 3 files changed, 14 insertions(+), 18 deletions(-) delete mode 100644 contracts/common/IForwarder.sol create mode 100644 contracts/forwarding/IForwarder.sol rename contracts/{common => forwarding}/IForwarderFee.sol (100%) diff --git a/contracts/common/IForwarder.sol b/contracts/common/IForwarder.sol deleted file mode 100644 index a54b8cfdc..000000000 --- a/contracts/common/IForwarder.sol +++ /dev/null @@ -1,18 +0,0 @@ -/* - * SPDX-License-Identifier: MIT - */ - -pragma solidity ^0.4.24; - - -interface IForwarder { - function isForwarder() external pure returns (bool); - - // TODO: this should be external - // See https://github.com/ethereum/solidity/issues/4832 - function canForward(address sender, bytes evmCallScript) public view returns (bool); - - // TODO: this should be external - // See https://github.com/ethereum/solidity/issues/4832 - function forward(bytes evmCallScript) public; -} diff --git a/contracts/forwarding/IForwarder.sol b/contracts/forwarding/IForwarder.sol new file mode 100644 index 000000000..6c48a7cc5 --- /dev/null +++ b/contracts/forwarding/IForwarder.sol @@ -0,0 +1,14 @@ +/* + * SPDX-License-Identifier: MIT + */ + +pragma solidity ^0.4.24; + + +interface IForwarder { + function isForwarder() external pure returns (bool); + + function canForward(address sender, bytes evmCallScript) external view returns (bool); + + function forward(bytes evmCallScript) external; +} diff --git a/contracts/common/IForwarderFee.sol b/contracts/forwarding/IForwarderFee.sol similarity index 100% rename from contracts/common/IForwarderFee.sol rename to contracts/forwarding/IForwarderFee.sol From f5ac5f886aead66514cd5b6e302e53c7b0e8e791 Mon Sep 17 00:00:00 2001 From: Facu Spagnuolo Date: Wed, 10 Jun 2020 17:19:39 -0300 Subject: [PATCH 2/4] forwarder: provide payable interface --- contracts/forwarding/IForwarderPayable.sol | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 contracts/forwarding/IForwarderPayable.sol diff --git a/contracts/forwarding/IForwarderPayable.sol b/contracts/forwarding/IForwarderPayable.sol new file mode 100644 index 000000000..d2ee38101 --- /dev/null +++ b/contracts/forwarding/IForwarderPayable.sol @@ -0,0 +1,16 @@ +/* + * SPDX-License-Identifier: MIT + */ + +pragma solidity ^0.4.24; + +import "./IForwarder.sol"; + + +interface IForwarderPayable { + function isForwarder() external pure returns (bool); + + function canForward(address sender, bytes evmCallScript) external view returns (bool); + + function forward(bytes evmCallScript) external payable; +} From 886f149d14fd67af4683df3b4296a9b86679337d Mon Sep 17 00:00:00 2001 From: Facu Spagnuolo Date: Wed, 10 Jun 2020 17:20:08 -0300 Subject: [PATCH 3/4] forwarder: provide forwarder interface with extra data --- contracts/forwarding/IForwarderV2.sol | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 contracts/forwarding/IForwarderV2.sol diff --git a/contracts/forwarding/IForwarderV2.sol b/contracts/forwarding/IForwarderV2.sol new file mode 100644 index 000000000..2f3a4ddb3 --- /dev/null +++ b/contracts/forwarding/IForwarderV2.sol @@ -0,0 +1,13 @@ +/* + * SPDX-License-Identifier: MIT + */ + +pragma solidity ^0.4.24; + +import "./IForwarderPayable.sol"; + + +// TODO: Cannot inherit interfaces in Solidity 0.4.24 +contract IForwarderV2 is IForwarderPayable { + function forward(bytes evmCallScript, bytes context) external payable; +} From e38b46d2bd46f345db575f6f65543f3d89d7c38c Mon Sep 17 00:00:00 2001 From: Facu Spagnuolo Date: Fri, 12 Jun 2020 11:24:44 -0300 Subject: [PATCH 4/4] forwarder: remove unused import --- contracts/forwarding/IForwarderPayable.sol | 2 -- 1 file changed, 2 deletions(-) diff --git a/contracts/forwarding/IForwarderPayable.sol b/contracts/forwarding/IForwarderPayable.sol index d2ee38101..ceb352a16 100644 --- a/contracts/forwarding/IForwarderPayable.sol +++ b/contracts/forwarding/IForwarderPayable.sol @@ -4,8 +4,6 @@ pragma solidity ^0.4.24; -import "./IForwarder.sol"; - interface IForwarderPayable { function isForwarder() external pure returns (bool);