From c6d2818312fb34df63a8cce65c6506babaa8af52 Mon Sep 17 00:00:00 2001 From: boyuan-chen <46272347+boyuan-chen@users.noreply.github.com> Date: Wed, 3 Jul 2024 12:38:01 -0700 Subject: [PATCH] Add withdrawal amount (#1397) * Add withdrawal amount * Fix smart contract * Add a helper function --- .../contracts/contracts/LP/L2LiquidityPool.sol | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/packages/boba/contracts/contracts/LP/L2LiquidityPool.sol b/packages/boba/contracts/contracts/LP/L2LiquidityPool.sol index 429ea65e71..44f1396cfe 100644 --- a/packages/boba/contracts/contracts/LP/L2LiquidityPool.sol +++ b/packages/boba/contracts/contracts/LP/L2LiquidityPool.sol @@ -834,7 +834,7 @@ contract L2LiquidityPool is CrossDomainEnabled, ReentrancyGuardUpgradeable, Paus if (_tokenAddress == Lib_PredeployAddresses.OVM_ETH) { require(_amount <= address(this).balance, "Requested ETH exceeds pool balance"); - L2StandardBridge(Lib_PredeployAddresses.L2_STANDARD_BRIDGE).withdrawTo( + L2LiquidityPoolHelper(payable(Lib_PredeployAddresses.L2_STANDARD_BRIDGE)).withdrawTo{ value: _amount }( _tokenAddress, L1LiquidityPoolAddress, _amount, @@ -1032,3 +1032,15 @@ contract L2LiquidityPool is CrossDomainEnabled, ReentrancyGuardUpgradeable, Paus } } + +interface L2LiquidityPoolHelper { + function withdrawTo( + address _l2Token, + address _to, + uint256 _amount, + uint32 _l1Gas, + bytes calldata _data + ) + external + payable; +}