From 1ca80bfde9b25d97c1bfc6776cbc0d2e4b0e3e8e Mon Sep 17 00:00:00 2001 From: nicholaspai Date: Tue, 15 Mar 2022 13:15:08 -0400 Subject: [PATCH 1/3] improve: [N07] Document that payable functions cannot be included in MultiCaller functions --- contracts/HubPool.sol | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/contracts/HubPool.sol b/contracts/HubPool.sol index 891a6bc4f..4efda4558 100644 --- a/contracts/HubPool.sol +++ b/contracts/HubPool.sol @@ -810,6 +810,10 @@ contract HubPool is HubPoolInterface, Testable, Lockable, MultiCaller, Ownable { /** * @notice This function allows a caller to load the contract with raw ETH to perform L2 calls. This is needed for arbitrum * calls, but may also be needed for others. + * @dev This function cannot be included in a multicall transaction call because it is `payable`. A realistic + * situation where this might be an issue is if the caller is executing a PoolRebalanceLeaf that needs to relay + * messages to Arbitrum. Relaying messages to Arbitrum requires that this contract has an ETH balance, so in this + * case the caller would need to pre-load this contract with ETH before multicall-executing the leaf. */ function loadEthForL2Calls() public payable override {} From b4a684d7eac9a54d4ae63bd256d196b359b12c20 Mon Sep 17 00:00:00 2001 From: nicholaspai <9457025+nicholaspai@users.noreply.github.com> Date: Wed, 16 Mar 2022 11:45:11 -0400 Subject: [PATCH 2/3] Update contracts/HubPool.sol Co-authored-by: Chris Maree --- contracts/HubPool.sol | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/contracts/HubPool.sol b/contracts/HubPool.sol index 4efda4558..d31edc461 100644 --- a/contracts/HubPool.sol +++ b/contracts/HubPool.sol @@ -808,8 +808,8 @@ contract HubPool is HubPoolInterface, Testable, Lockable, MultiCaller, Ownable { } /** - * @notice This function allows a caller to load the contract with raw ETH to perform L2 calls. This is needed for arbitrum - * calls, but may also be needed for others. + * @notice This function allows a caller to load the contract with raw ETH to perform L2 calls. This is needed for + * Arbitrum calls, but may also be needed for others. * @dev This function cannot be included in a multicall transaction call because it is `payable`. A realistic * situation where this might be an issue is if the caller is executing a PoolRebalanceLeaf that needs to relay * messages to Arbitrum. Relaying messages to Arbitrum requires that this contract has an ETH balance, so in this From 7092b8af1da15306994ea760b9669a9bd1f776c1 Mon Sep 17 00:00:00 2001 From: nicholaspai <9457025+nicholaspai@users.noreply.github.com> Date: Wed, 16 Mar 2022 13:57:15 -0400 Subject: [PATCH 3/3] Update contracts/HubPool.sol Co-authored-by: Chris Maree --- contracts/HubPool.sol | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contracts/HubPool.sol b/contracts/HubPool.sol index d31edc461..d2a8df3a1 100644 --- a/contracts/HubPool.sol +++ b/contracts/HubPool.sol @@ -810,7 +810,7 @@ contract HubPool is HubPoolInterface, Testable, Lockable, MultiCaller, Ownable { /** * @notice This function allows a caller to load the contract with raw ETH to perform L2 calls. This is needed for * Arbitrum calls, but may also be needed for others. - * @dev This function cannot be included in a multicall transaction call because it is `payable`. A realistic + * @dev This function cannot be included in a multicall transaction call because it is payable. A realistic * situation where this might be an issue is if the caller is executing a PoolRebalanceLeaf that needs to relay * messages to Arbitrum. Relaying messages to Arbitrum requires that this contract has an ETH balance, so in this * case the caller would need to pre-load this contract with ETH before multicall-executing the leaf.