Skip to content

Commit

Permalink
fix: Optimism StandardBridge bridgeERC20To() prototype
Browse files Browse the repository at this point in the history
The Optimism standard L2 bridge inherits from the StandardBridge, which
defines bridgeERC20{to}() _minGasLimit as a uint32, not a uint256.
  • Loading branch information
pxrl committed Jul 15, 2024
1 parent 73844b1 commit 92dde9b
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 15 deletions.
13 changes: 1 addition & 12 deletions contracts/Blast_SpokePool.sol
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,6 @@ interface IBlast {
function claimMaxGas(address contractAddress, address recipientOfGas) external returns (uint256);
}

interface IUSDBL2Bridge {
function bridgeERC20To(
address _localToken,
address _remoteToken,
address _to,
uint256 _amount,
uint32 _minGasLimit,
bytes calldata _extraData
) external;
}

/**
* @notice Blast Spoke pool.
*/
Expand Down Expand Up @@ -141,7 +130,7 @@ contract Blast_SpokePool is Ovm_SpokePool {
}
// If the token is USDB then use the L2BlastBridge
if (l2TokenAddress == USDB) {
IUSDBL2Bridge(L2_BLAST_BRIDGE).bridgeERC20To(
IL2ERC20Bridge(L2_BLAST_BRIDGE).bridgeERC20To(
l2TokenAddress, // _l2Token. Address of the L2 token to bridge over.
L1_USDB,
hubPool, // _to. Withdraw, over the bridge, to the l1 pool contract.
Expand Down
3 changes: 2 additions & 1 deletion contracts/Ovm_SpokePool.sol
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import "@openzeppelin/contracts-upgradeable/crosschain/optimism/LibOptimismUpgra
import "@eth-optimism/contracts/libraries/constants/Lib_PredeployAddresses.sol";

// https://github.com/ethereum-optimism/optimism/blob/bf51c4935261634120f31827c3910aa631f6bf9c/packages/contracts-bedrock/contracts/L2/L2StandardBridge.sol
// https://github.com/ethereum-optimism/optimism/blob/bf51c4935261634120f31827c3910aa631f6bf9c/packages/contracts-bedrock/contracts/universal/StandardBridge.sol
interface IL2ERC20Bridge {
function withdrawTo(
address _l2Token,
Expand All @@ -23,7 +24,7 @@ interface IL2ERC20Bridge {
address _remoteToken,
address _to,
uint256 _amount,
uint256 _minGasLimit,
uint32 _minGasLimit,
bytes calldata _extraData
) external;
}
Expand Down
2 changes: 1 addition & 1 deletion contracts/test/MockBedrockStandardBridge.sol
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ contract MockBedrockL2StandardBridge is IL2ERC20Bridge {
address _remoteToken,
address _to,
uint256 _amount,
uint256 _minGasLimit,
uint32 _minGasLimit,
bytes calldata _extraData
) external {
// Check that caller has approved this contract to pull funds, mirroring mainnet's behavior
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@across-protocol/contracts",
"version": "3.0.5",
"version": "3.0.6",
"author": "UMA Team",
"license": "AGPL-3.0-only",
"repository": {
Expand Down

0 comments on commit 92dde9b

Please sign in to comment.