From e77ce5a58f26f2bedc1914ae7a0cf8f74bb5d74a Mon Sep 17 00:00:00 2001 From: Faisal Usmani Date: Thu, 28 Aug 2025 15:05:51 -0400 Subject: [PATCH 1/6] chore: Consolidated OP chain spoke pools Signed-off-by: Faisal Usmani --- contracts/Base_SpokePool.sol | 45 ------------------- contracts/DoctorWho_SpokePool.sol | 45 ------------------- contracts/Mode_SpokePool.sol | 45 ------------------- .../{Bob_SpokePool.sol => OP_SpokePool.sol} | 6 +-- contracts/Redstone_SpokePool.sol | 45 ------------------- contracts/Zora_SpokePool.sol | 45 ------------------- hardhat.config.ts | 1 + script/039DeployModeSpokePool.s.sol | 6 +-- script/047DeployRedstoneSpokePool.s.sol | 6 +-- script/049DeployZoraSpokePool.s.sol | 6 +-- 10 files changed, 13 insertions(+), 237 deletions(-) delete mode 100644 contracts/Base_SpokePool.sol delete mode 100644 contracts/DoctorWho_SpokePool.sol delete mode 100644 contracts/Mode_SpokePool.sol rename contracts/{Bob_SpokePool.sol => OP_SpokePool.sol} (92%) delete mode 100644 contracts/Redstone_SpokePool.sol delete mode 100644 contracts/Zora_SpokePool.sol diff --git a/contracts/Base_SpokePool.sol b/contracts/Base_SpokePool.sol deleted file mode 100644 index 22bedcfe2..000000000 --- a/contracts/Base_SpokePool.sol +++ /dev/null @@ -1,45 +0,0 @@ -// SPDX-License-Identifier: BUSL-1.1 -pragma solidity ^0.8.0; -import "@eth-optimism/contracts/libraries/constants/Lib_PredeployAddresses.sol"; - -import "./Ovm_SpokePool.sol"; -import "./external/interfaces/CCTPInterfaces.sol"; - -/** - * @notice Base Spoke pool. - * @custom:security-contact bugs@across.to - */ -contract Base_SpokePool is Ovm_SpokePool { - /// @custom:oz-upgrades-unsafe-allow constructor - constructor( - address _wrappedNativeTokenAddress, - uint32 _depositQuoteTimeBuffer, - uint32 _fillDeadlineBuffer, - IERC20 _l2Usdc, - ITokenMessenger _cctpTokenMessenger - ) - Ovm_SpokePool( - _wrappedNativeTokenAddress, - _depositQuoteTimeBuffer, - _fillDeadlineBuffer, - _l2Usdc, - _cctpTokenMessenger - ) - {} // solhint-disable-line no-empty-blocks - - /** - * @notice Construct the OVM Base SpokePool. - * @param _initialDepositId Starting deposit ID. Set to 0 unless this is a re-deployment in order to mitigate - * relay hash collisions. - * @param _crossDomainAdmin Cross domain admin to set. Can be changed by admin. - * @param _withdrawalRecipient Address which receives token withdrawals. Can be changed by admin. For Spoke Pools on L2, this will - * likely be the hub pool. - */ - function initialize( - uint32 _initialDepositId, - address _crossDomainAdmin, - address _withdrawalRecipient - ) public initializer { - __OvmSpokePool_init(_initialDepositId, _crossDomainAdmin, _withdrawalRecipient, Lib_PredeployAddresses.OVM_ETH); - } -} diff --git a/contracts/DoctorWho_SpokePool.sol b/contracts/DoctorWho_SpokePool.sol deleted file mode 100644 index 6744ffb9e..000000000 --- a/contracts/DoctorWho_SpokePool.sol +++ /dev/null @@ -1,45 +0,0 @@ -// SPDX-License-Identifier: BUSL-1.1 -pragma solidity ^0.8.0; -import "@eth-optimism/contracts/libraries/constants/Lib_PredeployAddresses.sol"; - -import "./Ovm_SpokePool.sol"; -import "./external/interfaces/CCTPInterfaces.sol"; - -/** - * @notice DoctorWho Spoke pool. - * @custom:security-contact bugs@across.to - */ -contract DoctorWho_SpokePool is Ovm_SpokePool { - /// @custom:oz-upgrades-unsafe-allow constructor - constructor( - address _wrappedNativeTokenAddress, - uint32 _depositQuoteTimeBuffer, - uint32 _fillDeadlineBuffer, - IERC20 _l2Usdc, - ITokenMessenger _cctpTokenMessenger - ) - Ovm_SpokePool( - _wrappedNativeTokenAddress, - _depositQuoteTimeBuffer, - _fillDeadlineBuffer, - _l2Usdc, - _cctpTokenMessenger - ) - {} // solhint-disable-line no-empty-blocks - - /** - * @notice Construct the OVM DoctorWho SpokePool. - * @param _initialDepositId Starting deposit ID. Set to 0 unless this is a re-deployment in order to mitigate - * relay hash collisions. - * @param _crossDomainAdmin Cross domain admin to set. Can be changed by admin. - * @param _withdrawalRecipient Address which receives token withdrawals. Can be changed by admin. For Spoke Pools on L2, this will - * likely be the hub pool. - */ - function initialize( - uint32 _initialDepositId, - address _crossDomainAdmin, - address _withdrawalRecipient - ) public initializer { - __OvmSpokePool_init(_initialDepositId, _crossDomainAdmin, _withdrawalRecipient, Lib_PredeployAddresses.OVM_ETH); - } -} diff --git a/contracts/Mode_SpokePool.sol b/contracts/Mode_SpokePool.sol deleted file mode 100644 index 5f5406dda..000000000 --- a/contracts/Mode_SpokePool.sol +++ /dev/null @@ -1,45 +0,0 @@ -// SPDX-License-Identifier: BUSL-1.1 -pragma solidity ^0.8.0; -import "@eth-optimism/contracts/libraries/constants/Lib_PredeployAddresses.sol"; - -import "./Ovm_SpokePool.sol"; -import "./external/interfaces/CCTPInterfaces.sol"; - -/** - * @notice Mode Spoke pool. - * @custom:security-contact bugs@across.to - */ -contract Mode_SpokePool is Ovm_SpokePool { - /// @custom:oz-upgrades-unsafe-allow constructor - constructor( - address _wrappedNativeTokenAddress, - uint32 _depositQuoteTimeBuffer, - uint32 _fillDeadlineBuffer, - IERC20 _l2Usdc, - ITokenMessenger _cctpTokenMessenger - ) - Ovm_SpokePool( - _wrappedNativeTokenAddress, - _depositQuoteTimeBuffer, - _fillDeadlineBuffer, - _l2Usdc, - _cctpTokenMessenger - ) - {} // solhint-disable-line no-empty-blocks - - /** - * @notice Construct the OVM Mode SpokePool. - * @param _initialDepositId Starting deposit ID. Set to 0 unless this is a re-deployment in order to mitigate - * relay hash collisions. - * @param _crossDomainAdmin Cross domain admin to set. Can be changed by admin. - * @param _withdrawalRecipient Address which receives token withdrawals. Can be changed by admin. For Spoke Pools on L2, this will - * likely be the hub pool. - */ - function initialize( - uint32 _initialDepositId, - address _crossDomainAdmin, - address _withdrawalRecipient - ) public initializer { - __OvmSpokePool_init(_initialDepositId, _crossDomainAdmin, _withdrawalRecipient, Lib_PredeployAddresses.OVM_ETH); - } -} diff --git a/contracts/Bob_SpokePool.sol b/contracts/OP_SpokePool.sol similarity index 92% rename from contracts/Bob_SpokePool.sol rename to contracts/OP_SpokePool.sol index 5a94c821f..24792dfe6 100644 --- a/contracts/Bob_SpokePool.sol +++ b/contracts/OP_SpokePool.sol @@ -6,10 +6,10 @@ import "./Ovm_SpokePool.sol"; import "./external/interfaces/CCTPInterfaces.sol"; /** - * @notice Bob Spoke pool. + * @notice OP Spoke pool. * @custom:security-contact bugs@across.to */ -contract Bob_SpokePool is Ovm_SpokePool { +contract OP_SpokePool is Ovm_SpokePool { /// @custom:oz-upgrades-unsafe-allow constructor constructor( address _wrappedNativeTokenAddress, @@ -28,7 +28,7 @@ contract Bob_SpokePool is Ovm_SpokePool { {} // solhint-disable-line no-empty-blocks /** - * @notice Construct the Bob SpokePool. + * @notice Construct the OP SpokePool. * @param _initialDepositId Starting deposit ID. Set to 0 unless this is a re-deployment in order to mitigate * relay hash collisions. * @param _crossDomainAdmin Cross domain admin to set. Can be changed by admin. diff --git a/contracts/Redstone_SpokePool.sol b/contracts/Redstone_SpokePool.sol deleted file mode 100644 index 7c2e46c7f..000000000 --- a/contracts/Redstone_SpokePool.sol +++ /dev/null @@ -1,45 +0,0 @@ -// SPDX-License-Identifier: BUSL-1.1 -pragma solidity ^0.8.0; -import "@eth-optimism/contracts/libraries/constants/Lib_PredeployAddresses.sol"; - -import "./Ovm_SpokePool.sol"; -import "./external/interfaces/CCTPInterfaces.sol"; - -/** - * @notice Redstone Spoke pool. - * @custom:security-contact bugs@across.to - */ -contract Redstone_SpokePool is Ovm_SpokePool { - /// @custom:oz-upgrades-unsafe-allow constructor - constructor( - address _wrappedNativeTokenAddress, - uint32 _depositQuoteTimeBuffer, - uint32 _fillDeadlineBuffer, - IERC20 _l2Usdc, - ITokenMessenger _cctpTokenMessenger - ) - Ovm_SpokePool( - _wrappedNativeTokenAddress, - _depositQuoteTimeBuffer, - _fillDeadlineBuffer, - _l2Usdc, - _cctpTokenMessenger - ) - {} // solhint-disable-line no-empty-blocks - - /** - * @notice Construct the OVM Redstone SpokePool. - * @param _initialDepositId Starting deposit ID. Set to 0 unless this is a re-deployment in order to mitigate - * relay hash collisions. - * @param _crossDomainAdmin Cross domain admin to set. Can be changed by admin. - * @param _withdrawalRecipient Address which receives token withdrawals. Can be changed by admin. For Spoke Pools on L2, this will - * likely be the hub pool. - */ - function initialize( - uint32 _initialDepositId, - address _crossDomainAdmin, - address _withdrawalRecipient - ) public initializer { - __OvmSpokePool_init(_initialDepositId, _crossDomainAdmin, _withdrawalRecipient, Lib_PredeployAddresses.OVM_ETH); - } -} diff --git a/contracts/Zora_SpokePool.sol b/contracts/Zora_SpokePool.sol deleted file mode 100644 index bd2d8e04b..000000000 --- a/contracts/Zora_SpokePool.sol +++ /dev/null @@ -1,45 +0,0 @@ -// SPDX-License-Identifier: BUSL-1.1 -pragma solidity ^0.8.0; -import "@eth-optimism/contracts/libraries/constants/Lib_PredeployAddresses.sol"; - -import "./Ovm_SpokePool.sol"; -import "./external/interfaces/CCTPInterfaces.sol"; - -/** - * @notice Zora Spoke pool. - * @custom:security-contact bugs@across.to - */ -contract Zora_SpokePool is Ovm_SpokePool { - /// @custom:oz-upgrades-unsafe-allow constructor - constructor( - address _wrappedNativeTokenAddress, - uint32 _depositQuoteTimeBuffer, - uint32 _fillDeadlineBuffer, - IERC20 _l2Usdc, - ITokenMessenger _cctpTokenMessenger - ) - Ovm_SpokePool( - _wrappedNativeTokenAddress, - _depositQuoteTimeBuffer, - _fillDeadlineBuffer, - _l2Usdc, - _cctpTokenMessenger - ) - {} // solhint-disable-line no-empty-blocks - - /** - * @notice Construct the OVM Zora SpokePool. - * @param _initialDepositId Starting deposit ID. Set to 0 unless this is a re-deployment in order to mitigate - * relay hash collisions. - * @param _crossDomainAdmin Cross domain admin to set. Can be changed by admin. - * @param _withdrawalRecipient Address which receives token withdrawals. Can be changed by admin. For Spoke Pools on L2, this will - * likely be the hub pool. - */ - function initialize( - uint32 _initialDepositId, - address _crossDomainAdmin, - address _withdrawalRecipient - ) public initializer { - __OvmSpokePool_init(_initialDepositId, _crossDomainAdmin, _withdrawalRecipient, Lib_PredeployAddresses.OVM_ETH); - } -} diff --git a/hardhat.config.ts b/hardhat.config.ts index bfe3bf5cc..64ab381b9 100644 --- a/hardhat.config.ts +++ b/hardhat.config.ts @@ -97,6 +97,7 @@ const config: HardhatUserConfig = { "contracts/Zora_SpokePool.sol": LARGE_CONTRACT_COMPILER_SETTINGS, "contracts/Mode_SpokePool.sol": LARGE_CONTRACT_COMPILER_SETTINGS, "contracts/Base_SpokePool.sol": LARGE_CONTRACT_COMPILER_SETTINGS, + "contracts/OP_SpokePool.sol": LARGE_CONTRACT_COMPILER_SETTINGS, "contracts/Optimism_SpokePool.sol": LARGE_CONTRACT_COMPILER_SETTINGS, "contracts/WorldChain_SpokePool.sol": LARGE_CONTRACT_COMPILER_SETTINGS, "contracts/Ink_SpokePool.sol": LARGE_CONTRACT_COMPILER_SETTINGS, diff --git a/script/039DeployModeSpokePool.s.sol b/script/039DeployModeSpokePool.s.sol index 01bda99a9..e7638b07b 100644 --- a/script/039DeployModeSpokePool.s.sol +++ b/script/039DeployModeSpokePool.s.sol @@ -4,7 +4,7 @@ pragma solidity ^0.8.0; import { Script } from "forge-std/Script.sol"; import { Test } from "forge-std/Test.sol"; import { console } from "forge-std/console.sol"; -import { Mode_SpokePool } from "../contracts/Mode_SpokePool.sol"; +import { OP_SpokePool } from "../contracts/OP_SpokePool.sol"; import { WETH9Interface } from "../contracts/external/interfaces/WETH9Interface.sol"; import { DeploymentUtils } from "./utils/DeploymentUtils.sol"; @@ -43,7 +43,7 @@ contract DeployModeSpokePool is Script, Test, DeploymentUtils { // Initialize deposit counter to 1 // Set hub pool as cross domain admin since it delegatecalls the Adapter logic. bytes memory initArgs = abi.encodeWithSelector( - Mode_SpokePool.initialize.selector, + OP_SpokePool.initialize.selector, 1, // _initialDepositId info.hubPool, // _crossDomainAdmin info.hubPool // _withdrawalRecipient @@ -51,7 +51,7 @@ contract DeployModeSpokePool is Script, Test, DeploymentUtils { // Deploy the proxy DeploymentResult memory result = deployNewProxy( - "Mode_SpokePool", + "OP_SpokePool", constructorArgs, initArgs, true // implementationOnly diff --git a/script/047DeployRedstoneSpokePool.s.sol b/script/047DeployRedstoneSpokePool.s.sol index 84b8afc20..de64204c7 100644 --- a/script/047DeployRedstoneSpokePool.s.sol +++ b/script/047DeployRedstoneSpokePool.s.sol @@ -4,7 +4,7 @@ pragma solidity ^0.8.0; import { Script } from "forge-std/Script.sol"; import { Test } from "forge-std/Test.sol"; import { console } from "forge-std/console.sol"; -import { Redstone_SpokePool } from "../contracts/Redstone_SpokePool.sol"; +import { OP_SpokePool } from "../contracts/OP_SpokePool.sol"; import { WETH9Interface } from "../contracts/external/interfaces/WETH9Interface.sol"; import { DeploymentUtils } from "./utils/DeploymentUtils.sol"; @@ -41,7 +41,7 @@ contract DeployRedstoneSpokePool is Script, Test, DeploymentUtils { // Initialize deposit counter to 1 // Set hub pool as cross domain admin since it delegatecalls the Adapter logic. bytes memory initArgs = abi.encodeWithSelector( - Redstone_SpokePool.initialize.selector, + OP_SpokePool.initialize.selector, 1, // _initialDepositId info.hubPool, // _crossDomainAdmin info.hubPool // _withdrawalRecipient @@ -49,7 +49,7 @@ contract DeployRedstoneSpokePool is Script, Test, DeploymentUtils { // Deploy the proxy DeploymentResult memory result = deployNewProxy( - "Redstone_SpokePool", + "OP_SpokePool", constructorArgs, initArgs, true // implementationOnly diff --git a/script/049DeployZoraSpokePool.s.sol b/script/049DeployZoraSpokePool.s.sol index 801d8e0fd..e37ec2115 100644 --- a/script/049DeployZoraSpokePool.s.sol +++ b/script/049DeployZoraSpokePool.s.sol @@ -4,7 +4,7 @@ pragma solidity ^0.8.0; import { Script } from "forge-std/Script.sol"; import { Test } from "forge-std/Test.sol"; import { console } from "forge-std/console.sol"; -import { Zora_SpokePool } from "../contracts/Zora_SpokePool.sol"; +import { OP_SpokePool } from "../contracts/OP_SpokePool.sol"; import { WETH9Interface } from "../contracts/external/interfaces/WETH9Interface.sol"; import { DeploymentUtils } from "./utils/DeploymentUtils.sol"; @@ -41,7 +41,7 @@ contract DeployZoraSpokePool is Script, Test, DeploymentUtils { // Initialize deposit counter to 1 // Set hub pool as cross domain admin since it delegatecalls the Adapter logic. bytes memory initArgs = abi.encodeWithSelector( - Zora_SpokePool.initialize.selector, + OP_SpokePool.initialize.selector, 1, // _initialDepositId info.hubPool, // _crossDomainAdmin info.hubPool // _withdrawalRecipient @@ -49,7 +49,7 @@ contract DeployZoraSpokePool is Script, Test, DeploymentUtils { // Deploy the proxy DeploymentResult memory result = deployNewProxy( - "Zora_SpokePool", + "OP_SpokePool", constructorArgs, initArgs, true // implementationOnly From ef99c8750adce3d55c01efa3175505cbbcfa0014 Mon Sep 17 00:00:00 2001 From: Faisal Usmani Date: Tue, 23 Sep 2025 11:58:52 -0400 Subject: [PATCH 2/6] Deleted deploy scripts Signed-off-by: Faisal Usmani --- ...ePool.s.sol => 010DeployOPSpokePool.s.sol} | 0 script/047DeployRedstoneSpokePool.s.sol | 71 ------------------- script/049DeployZoraSpokePool.s.sol | 71 ------------------- 3 files changed, 142 deletions(-) rename script/{039DeployModeSpokePool.s.sol => 010DeployOPSpokePool.s.sol} (100%) delete mode 100644 script/047DeployRedstoneSpokePool.s.sol delete mode 100644 script/049DeployZoraSpokePool.s.sol diff --git a/script/039DeployModeSpokePool.s.sol b/script/010DeployOPSpokePool.s.sol similarity index 100% rename from script/039DeployModeSpokePool.s.sol rename to script/010DeployOPSpokePool.s.sol diff --git a/script/047DeployRedstoneSpokePool.s.sol b/script/047DeployRedstoneSpokePool.s.sol deleted file mode 100644 index de64204c7..000000000 --- a/script/047DeployRedstoneSpokePool.s.sol +++ /dev/null @@ -1,71 +0,0 @@ -// SPDX-License-Identifier: BUSL-1.1 -pragma solidity ^0.8.0; - -import { Script } from "forge-std/Script.sol"; -import { Test } from "forge-std/Test.sol"; -import { console } from "forge-std/console.sol"; -import { OP_SpokePool } from "../contracts/OP_SpokePool.sol"; -import { WETH9Interface } from "../contracts/external/interfaces/WETH9Interface.sol"; -import { DeploymentUtils } from "./utils/DeploymentUtils.sol"; - -// How to run: -// 1. `source .env` where `.env` has MNEMONIC="x x x ... x" -// 2. forge script script/047DeployRedstoneSpokePool.s.sol:DeployRedstoneSpokePool --rpc-url $NODE_URL_1 -vvvv -// 3. Verify the above works in simulation mode. -// 4. Deploy with: forge script script/047DeployRedstoneSpokePool.s.sol:DeployRedstoneSpokePool --rpc-url $NODE_URL_1 --broadcast --verify - -contract DeployRedstoneSpokePool is Script, Test, DeploymentUtils { - function run() external { - string memory deployerMnemonic = vm.envString("MNEMONIC"); - uint256 deployerPrivateKey = vm.deriveKey(deployerMnemonic, 0); - - // Get deployment information - DeploymentInfo memory info = getSpokePoolDeploymentInfo(address(0)); - - console.log("HubPool address:", info.hubPool); - - // Get the appropriate addresses for this chain - WETH9Interface weth = getWrappedNativeToken(info.spokeChainId); - - vm.startBroadcast(deployerPrivateKey); - - // Prepare constructor arguments for Redstone_SpokePool - bytes memory constructorArgs = abi.encode( - address(weth), // _wrappedNativeTokenAddress - QUOTE_TIME_BUFFER(), // _depositQuoteTimeBuffer - FILL_DEADLINE_BUFFER(), // _fillDeadlineBuffer - address(0), // _l2Usdc - address(0) // _cctpTokenMessenger - ); - - // Initialize deposit counter to 1 - // Set hub pool as cross domain admin since it delegatecalls the Adapter logic. - bytes memory initArgs = abi.encodeWithSelector( - OP_SpokePool.initialize.selector, - 1, // _initialDepositId - info.hubPool, // _crossDomainAdmin - info.hubPool // _withdrawalRecipient - ); - - // Deploy the proxy - DeploymentResult memory result = deployNewProxy( - "OP_SpokePool", - constructorArgs, - initArgs, - true // implementationOnly - ); - - // Log the deployed addresses - console.log("Chain ID:", info.spokeChainId); - console.log("Hub Chain ID:", info.hubChainId); - console.log("HubPool address:", info.hubPool); - console.log("WETH address:", address(weth)); - console.log("Redstone_SpokePool proxy deployed to:", result.proxy); - console.log("Redstone_SpokePool implementation deployed to:", result.implementation); - - console.log("QUOTE_TIME_BUFFER()", QUOTE_TIME_BUFFER()); - console.log("FILL_DEADLINE_BUFFER()", FILL_DEADLINE_BUFFER()); - - vm.stopBroadcast(); - } -} diff --git a/script/049DeployZoraSpokePool.s.sol b/script/049DeployZoraSpokePool.s.sol deleted file mode 100644 index e37ec2115..000000000 --- a/script/049DeployZoraSpokePool.s.sol +++ /dev/null @@ -1,71 +0,0 @@ -// SPDX-License-Identifier: BUSL-1.1 -pragma solidity ^0.8.0; - -import { Script } from "forge-std/Script.sol"; -import { Test } from "forge-std/Test.sol"; -import { console } from "forge-std/console.sol"; -import { OP_SpokePool } from "../contracts/OP_SpokePool.sol"; -import { WETH9Interface } from "../contracts/external/interfaces/WETH9Interface.sol"; -import { DeploymentUtils } from "./utils/DeploymentUtils.sol"; - -// How to run: -// 1. `source .env` where `.env` has MNEMONIC="x x x ... x" -// 2. forge script script/049DeployZoraSpokePool.s.sol:DeployZoraSpokePool --rpc-url $NODE_URL_1 -vvvv -// 3. Verify the above works in simulation mode. -// 4. Deploy with: forge script script/049DeployZoraSpokePool.s.sol:DeployZoraSpokePool --rpc-url $NODE_URL_1 --broadcast --verify - -contract DeployZoraSpokePool is Script, Test, DeploymentUtils { - function run() external { - string memory deployerMnemonic = vm.envString("MNEMONIC"); - uint256 deployerPrivateKey = vm.deriveKey(deployerMnemonic, 0); - - // Get deployment information - DeploymentInfo memory info = getSpokePoolDeploymentInfo(address(0)); - - console.log("HubPool address:", info.hubPool); - - // Get the appropriate addresses for this chain - WETH9Interface weth = getWrappedNativeToken(info.spokeChainId); - - vm.startBroadcast(deployerPrivateKey); - - // Prepare constructor arguments for Zora_SpokePool - bytes memory constructorArgs = abi.encode( - address(weth), // _wrappedNativeTokenAddress - QUOTE_TIME_BUFFER(), // _depositQuoteTimeBuffer - FILL_DEADLINE_BUFFER(), // _fillDeadlineBuffer - address(0), // _l2Usdc - address(0) // _cctpTokenMessenger - ); - - // Initialize deposit counter to 1 - // Set hub pool as cross domain admin since it delegatecalls the Adapter logic. - bytes memory initArgs = abi.encodeWithSelector( - OP_SpokePool.initialize.selector, - 1, // _initialDepositId - info.hubPool, // _crossDomainAdmin - info.hubPool // _withdrawalRecipient - ); - - // Deploy the proxy - DeploymentResult memory result = deployNewProxy( - "OP_SpokePool", - constructorArgs, - initArgs, - true // implementationOnly - ); - - // Log the deployed addresses - console.log("Chain ID:", info.spokeChainId); - console.log("Hub Chain ID:", info.hubChainId); - console.log("HubPool address:", info.hubPool); - console.log("WETH address:", address(weth)); - console.log("Zora_SpokePool proxy deployed to:", result.proxy); - console.log("Zora_SpokePool implementation deployed to:", result.implementation); - - console.log("QUOTE_TIME_BUFFER()", QUOTE_TIME_BUFFER()); - console.log("FILL_DEADLINE_BUFFER()", FILL_DEADLINE_BUFFER()); - - vm.stopBroadcast(); - } -} From 20965eaa03d150fda7293c78dd2280119bd55bdf Mon Sep 17 00:00:00 2001 From: Faisal Usmani Date: Tue, 23 Sep 2025 13:35:16 -0400 Subject: [PATCH 3/6] Delete hardhat scripts Signed-off-by: Faisal Usmani --- ...pokepool.ts => 025_deploy_op_spokepool.ts} | 10 +++---- deploy/039_deploy_mode_spokepool.ts | 28 ------------------ deploy/047_deploy_redstone_spokepool.ts | 28 ------------------ deploy/049_deploy_zora_spokepool.ts | 28 ------------------ deploy/062_deploy_unichain_spokepool.ts | 25 ---------------- deploy/112_deploy_bob_spokepool.ts | 29 ------------------- deploy/consts.ts | 20 +++++++++++++ 7 files changed, 25 insertions(+), 143 deletions(-) rename deploy/{025_deploy_base_spokepool.ts => 025_deploy_op_spokepool.ts} (73%) delete mode 100644 deploy/039_deploy_mode_spokepool.ts delete mode 100644 deploy/047_deploy_redstone_spokepool.ts delete mode 100644 deploy/049_deploy_zora_spokepool.ts delete mode 100644 deploy/062_deploy_unichain_spokepool.ts delete mode 100644 deploy/112_deploy_bob_spokepool.ts diff --git a/deploy/025_deploy_base_spokepool.ts b/deploy/025_deploy_op_spokepool.ts similarity index 73% rename from deploy/025_deploy_base_spokepool.ts rename to deploy/025_deploy_op_spokepool.ts index 45f7179e7..a909f61f1 100644 --- a/deploy/025_deploy_base_spokepool.ts +++ b/deploy/025_deploy_op_spokepool.ts @@ -1,7 +1,7 @@ import { DeployFunction } from "hardhat-deploy/types"; import { HardhatRuntimeEnvironment } from "hardhat/types"; import { deployNewProxy, getSpokePoolDeploymentInfo } from "../utils/utils.hre"; -import { FILL_DEADLINE_BUFFER, L2_ADDRESS_MAP, QUOTE_TIME_BUFFER, USDC, WETH } from "./consts"; +import { FILL_DEADLINE_BUFFER, L2_ADDRESS_MAP, QUOTE_TIME_BUFFER, USDC, WETH, ZERO_ADDRESS } from "./consts"; const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { const { hubPool, spokeChainId } = await getSpokePoolDeploymentInfo(hre); @@ -18,10 +18,10 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { WETH[spokeChainId], QUOTE_TIME_BUFFER, FILL_DEADLINE_BUFFER, - USDC[spokeChainId], - L2_ADDRESS_MAP[spokeChainId].cctpTokenMessenger, + USDC[spokeChainId] ?? ZERO_ADDRESS, + L2_ADDRESS_MAP[spokeChainId].cctpTokenMessenger ?? ZERO_ADDRESS, ]; - await deployNewProxy("Base_SpokePool", constructorArgs, initArgs); + await deployNewProxy("OP_SpokePool", constructorArgs, initArgs); }; module.exports = func; -func.tags = ["BaseSpokePool", "base"]; +func.tags = ["OPSpokePool", "base", "unichain", "mode", "bob", "redstone", "zora"]; diff --git a/deploy/039_deploy_mode_spokepool.ts b/deploy/039_deploy_mode_spokepool.ts deleted file mode 100644 index d3994a95c..000000000 --- a/deploy/039_deploy_mode_spokepool.ts +++ /dev/null @@ -1,28 +0,0 @@ -import { DeployFunction } from "hardhat-deploy/types"; -import { HardhatRuntimeEnvironment } from "hardhat/types"; -import { deployNewProxy, getSpokePoolDeploymentInfo } from "../utils/utils.hre"; -import { FILL_DEADLINE_BUFFER, WETH, QUOTE_TIME_BUFFER, ZERO_ADDRESS } from "./consts"; - -const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { - const { hubPool, spokeChainId } = await getSpokePoolDeploymentInfo(hre); - - const initArgs = [ - 1, - // Set hub pool as cross domain admin since it delegatecalls the Adapter logic. - hubPool.address, - hubPool.address, - ]; - const constructorArgs = [ - WETH[spokeChainId], - QUOTE_TIME_BUFFER, - FILL_DEADLINE_BUFFER, - ZERO_ADDRESS, - // L2_ADDRESS_MAP[spokeChainId].cctpTokenMessenger, - // For now, we are not using the CCTP bridge and can disable by setting - // the cctpTokenMessenger to the zero address. - ZERO_ADDRESS, - ]; - await deployNewProxy("Mode_SpokePool", constructorArgs, initArgs); -}; -module.exports = func; -func.tags = ["ModeSpokePool", "mode"]; diff --git a/deploy/047_deploy_redstone_spokepool.ts b/deploy/047_deploy_redstone_spokepool.ts deleted file mode 100644 index c1f581a98..000000000 --- a/deploy/047_deploy_redstone_spokepool.ts +++ /dev/null @@ -1,28 +0,0 @@ -import { DeployFunction } from "hardhat-deploy/types"; -import { HardhatRuntimeEnvironment } from "hardhat/types"; -import { deployNewProxy, getSpokePoolDeploymentInfo } from "../utils/utils.hre"; -import { FILL_DEADLINE_BUFFER, WETH, QUOTE_TIME_BUFFER, ZERO_ADDRESS } from "./consts"; - -const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { - const { hubPool, spokeChainId } = await getSpokePoolDeploymentInfo(hre); - - const initArgs = [ - 1, - // Set hub pool as cross domain admin since it delegatecalls the Adapter logic. - hubPool.address, - hubPool.address, - ]; - const constructorArgs = [ - WETH[spokeChainId], - QUOTE_TIME_BUFFER, - FILL_DEADLINE_BUFFER, - ZERO_ADDRESS, - // L2_ADDRESS_MAP[spokeChainId].cctpTokenMessenger, - // For now, we are not using the CCTP bridge and can disable by setting - // the cctpTokenMessenger to the zero address. - ZERO_ADDRESS, - ]; - await deployNewProxy("Redstone_SpokePool", constructorArgs, initArgs); -}; -module.exports = func; -func.tags = ["RedstoneSpokePool", "redstone"]; diff --git a/deploy/049_deploy_zora_spokepool.ts b/deploy/049_deploy_zora_spokepool.ts deleted file mode 100644 index f754f381b..000000000 --- a/deploy/049_deploy_zora_spokepool.ts +++ /dev/null @@ -1,28 +0,0 @@ -import { DeployFunction } from "hardhat-deploy/types"; -import { HardhatRuntimeEnvironment } from "hardhat/types"; -import { deployNewProxy, getSpokePoolDeploymentInfo } from "../utils/utils.hre"; -import { FILL_DEADLINE_BUFFER, WETH, QUOTE_TIME_BUFFER, ZERO_ADDRESS } from "./consts"; - -const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { - const { hubPool, spokeChainId } = await getSpokePoolDeploymentInfo(hre); - - const initArgs = [ - 1, - // Set hub pool as cross domain admin since it delegatecalls the Adapter logic. - hubPool.address, - hubPool.address, - ]; - const constructorArgs = [ - WETH[spokeChainId], - QUOTE_TIME_BUFFER, - FILL_DEADLINE_BUFFER, - ZERO_ADDRESS, - // L2_ADDRESS_MAP[spokeChainId].cctpTokenMessenger, - // For now, we are not using the CCTP bridge and can disable by setting - // the cctpTokenMessenger to the zero address. - ZERO_ADDRESS, - ]; - await deployNewProxy("Zora_SpokePool", constructorArgs, initArgs); -}; -module.exports = func; -func.tags = ["ZoraSpokePool", "zora"]; diff --git a/deploy/062_deploy_unichain_spokepool.ts b/deploy/062_deploy_unichain_spokepool.ts deleted file mode 100644 index 2fe709277..000000000 --- a/deploy/062_deploy_unichain_spokepool.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { DeployFunction } from "hardhat-deploy/types"; -import { HardhatRuntimeEnvironment } from "hardhat/types"; -import { deployNewProxy, getSpokePoolDeploymentInfo } from "../utils/utils.hre"; -import { FILL_DEADLINE_BUFFER, L2_ADDRESS_MAP, QUOTE_TIME_BUFFER, USDC, WETH } from "./consts"; - -const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { - const { hubPool, spokeChainId } = await getSpokePoolDeploymentInfo(hre); - - const initArgs = [ - 1, - // Set hub pool as cross domain admin since it delegatecalls the Adapter logic. - hubPool.address, - hubPool.address, - ]; - const constructorArgs = [ - WETH[spokeChainId], - QUOTE_TIME_BUFFER, - FILL_DEADLINE_BUFFER, - USDC[spokeChainId], - L2_ADDRESS_MAP[spokeChainId].cctpTokenMessenger, - ]; - await deployNewProxy("DoctorWho_SpokePool", constructorArgs, initArgs); -}; -module.exports = func; -func.tags = ["DoctorWhoSpokePool", "doctorwho"]; diff --git a/deploy/112_deploy_bob_spokepool.ts b/deploy/112_deploy_bob_spokepool.ts deleted file mode 100644 index c21840f24..000000000 --- a/deploy/112_deploy_bob_spokepool.ts +++ /dev/null @@ -1,29 +0,0 @@ -import { HardhatRuntimeEnvironment } from "hardhat/types"; -import { DeployFunction } from "hardhat-deploy/types"; -import { deployNewProxy, getSpokePoolDeploymentInfo } from "../utils/utils.hre"; -import { FILL_DEADLINE_BUFFER, QUOTE_TIME_BUFFER, ZERO_ADDRESS } from "./consts"; - -const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { - const { hubPool } = await getSpokePoolDeploymentInfo(hre); - const WETH = "0x4200000000000000000000000000000000000006"; - const initArgs = [ - 1, - // Set hub pool as cross domain admin since it delegatecalls the Adapter logic. - hubPool.address, - hubPool.address, - ]; - const constructorArgs = [ - WETH, - QUOTE_TIME_BUFFER, - FILL_DEADLINE_BUFFER, - ZERO_ADDRESS, - // L2_ADDRESS_MAP[spokeChainId].cctpTokenMessenger, - // For now, we are not using the CCTP bridge and can disable by setting - // the cctpTokenMessenger to the zero address. - ZERO_ADDRESS, - ]; - - await deployNewProxy("Bob_SpokePool", constructorArgs, initArgs); -}; -module.exports = func; -func.tags = ["BobSpokePool", "Bob"]; diff --git a/deploy/consts.ts b/deploy/consts.ts index 3eee06198..56069c7c9 100644 --- a/deploy/consts.ts +++ b/deploy/consts.ts @@ -234,6 +234,14 @@ export const L2_ADDRESS_MAP: { [key: number]: { [contractName: string]: string } cctpMessageTransmitter: "0x7865fAfC2db2093669d92c0F33AeEF291086BEFD", uniswapV3SwapRouter: "0x7945814de23d76dfff0cfc6ecb76456b9f7ac648", // Mock_UniswapV3SwapRouter.sol }, + [CHAIN_IDs.BOB]: { + cctpTokenMessenger: "0x0000000000000000000000000000000000000000", + cctpMessageTransmitter: "0x0000000000000000000000000000000000000000", + }, + [CHAIN_IDs.BOB_SEPOLIA]: { + cctpTokenMessenger: "0x0000000000000000000000000000000000000000", + cctpMessageTransmitter: "0x0000000000000000000000000000000000000000", + }, [CHAIN_IDs.LENS]: { zkErc20Bridge: "0xfBEC23c5BB0E076F2ef4d0AaD7fe331aE5A01143", zkUSDCBridge: "0x7188B6975EeC82ae914b6eC7AC32b3c9a18b2c81", @@ -293,11 +301,23 @@ export const L2_ADDRESS_MAP: { [key: number]: { [contractName: string]: string } permit2: "0x000000000022D473030F116dDEE9F6B43aC78BA3", }, [CHAIN_IDs.REDSTONE]: { + cctpTokenMessenger: "0x0000000000000000000000000000000000000000", + cctpMessageTransmitter: "0x0000000000000000000000000000000000000000", permit2: "0x000000000022D473030F116dDEE9F6B43aC78BA3", }, [CHAIN_IDs.MODE]: { + cctpTokenMessenger: "0x0000000000000000000000000000000000000000", + cctpMessageTransmitter: "0x0000000000000000000000000000000000000000", permit2: "0x000000000022D473030F116dDEE9F6B43aC78BA3", }, + [CHAIN_IDs.MODE_SEPOLIA]: { + cctpTokenMessenger: "0x0000000000000000000000000000000000000000", + cctpMessageTransmitter: "0x0000000000000000000000000000000000000000", + }, + [CHAIN_IDs.ZORA]: { + cctpTokenMessenger: "0x0000000000000000000000000000000000000000", + cctpMessageTransmitter: "0x0000000000000000000000000000000000000000", + }, }; export const POLYGON_CHAIN_IDS: { [l1ChainId: number]: number } = { From 590fffc295e235ef23e9342c838e051b9e65e7bf Mon Sep 17 00:00:00 2001 From: Faisal Usmani Date: Tue, 23 Sep 2025 13:37:14 -0400 Subject: [PATCH 4/6] removed contract overrides Signed-off-by: Faisal Usmani --- hardhat.config.ts | 6 ------ 1 file changed, 6 deletions(-) diff --git a/hardhat.config.ts b/hardhat.config.ts index 400fbd173..373c130bf 100644 --- a/hardhat.config.ts +++ b/hardhat.config.ts @@ -118,19 +118,13 @@ const config: HardhatUserConfig = { "contracts/Arbitrum_SpokePool.sol": LARGE_CONTRACT_COMPILER_SETTINGS, "contracts/Scroll_SpokePool.sol": LARGE_CONTRACT_COMPILER_SETTINGS, "contracts/Lisk_SpokePool.sol": LARGE_CONTRACT_COMPILER_SETTINGS, - "contracts/Redstone_SpokePool.sol": LARGE_CONTRACT_COMPILER_SETTINGS, - "contracts/Zora_SpokePool.sol": LARGE_CONTRACT_COMPILER_SETTINGS, - "contracts/Mode_SpokePool.sol": LARGE_CONTRACT_COMPILER_SETTINGS, - "contracts/Base_SpokePool.sol": LARGE_CONTRACT_COMPILER_SETTINGS, "contracts/OP_SpokePool.sol": LARGE_CONTRACT_COMPILER_SETTINGS, "contracts/Optimism_SpokePool.sol": LARGE_CONTRACT_COMPILER_SETTINGS, "contracts/WorldChain_SpokePool.sol": LARGE_CONTRACT_COMPILER_SETTINGS, "contracts/Ink_SpokePool.sol": LARGE_CONTRACT_COMPILER_SETTINGS, "contracts/Cher_SpokePool.sol": LARGE_CONTRACT_COMPILER_SETTINGS, - "contracts/DoctorWho_SpokePool.sol": LARGE_CONTRACT_COMPILER_SETTINGS, "contracts/Blast_SpokePool.sol": LARGEST_CONTRACT_COMPILER_SETTINGS, "contracts/Tatara_SpokePool.sol": LARGE_CONTRACT_COMPILER_SETTINGS, - "contracts/Bob_SpokePool.sol": LARGE_CONTRACT_COMPILER_SETTINGS, }, }, zksolc: { From be08e44fd2270f0b6daa58d0b4d2f3145377bc8b Mon Sep 17 00:00:00 2001 From: Faisal Usmani Date: Tue, 23 Sep 2025 13:53:36 -0400 Subject: [PATCH 5/6] updated check storage layout script Signed-off-by: Faisal Usmani --- scripts/checkStorageLayout.sh | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/scripts/checkStorageLayout.sh b/scripts/checkStorageLayout.sh index f80d61650..6a5e929f8 100755 --- a/scripts/checkStorageLayout.sh +++ b/scripts/checkStorageLayout.sh @@ -1,14 +1,14 @@ #!/bin/bash -CONTRACTS=("Universal_SpokePool" "Arbitrum_SpokePool" "Optimism_SpokePool" "Polygon_SpokePool" "Linea_SpokePool" "ZkSync_SpokePool" "Ethereum_SpokePool" "Base_SpokePool" "Mode_SpokePool" "Blast_SpokePool" "AlephZero_SpokePool" "Redstone_SpokePool" "Scroll_SpokePool" "WorldChain_SpokePool" "Zora_SpokePool" "PolygonZkEVM_SpokePool") +CONTRACTS=("Universal_SpokePool" "Arbitrum_SpokePool" "Optimism_SpokePool" "Polygon_SpokePool" "Linea_SpokePool" "ZkSync_SpokePool" "Ethereum_SpokePool" "Blast_SpokePool" "AlephZero_SpokePool" "Scroll_SpokePool" "WorldChain_SpokePool" "PolygonZkEVM_SpokePool") if [[ "$1" == "--overwrite" ]]; then for CONTRACT in "${CONTRACTS[@]}"; do echo "Overwrite flag detected. Creating new storage layout snapshot of the $CONTRACT contract" - forge inspect $CONTRACT storagelayout --json > ./storage-layouts/temp.$CONTRACT.json + forge inspect $CONTRACT storagelayout --json >./storage-layouts/temp.$CONTRACT.json # Delete any astId keys from the file, which seem to change every time the bytecode changes # and the types object which also contains astId changes. We only care about the size and relative # location of state variable slots. - jq 'del(.storage[] | .astId)' ./storage-layouts/temp.$CONTRACT.json | jq 'del(.storage[] | .type)' | jq 'del(.types)' > ./storage-layouts/$CONTRACT.json + jq 'del(.storage[] | .astId)' ./storage-layouts/temp.$CONTRACT.json | jq 'del(.storage[] | .type)' | jq 'del(.types)' >./storage-layouts/$CONTRACT.json rm ./storage-layouts/temp.$CONTRACT.json echo "✅ 'forge inspect' saved new $CONTRACT storage layout at './storage-layouts/$CONTRACT.json'." done @@ -18,11 +18,11 @@ fi for CONTRACT in "${CONTRACTS[@]}"; do echo "Comparing storage layout snapshot of the $CONTRACT contract at ./storage-layouts/$CONTRACT.json with current storage layout" echo "Created temporary storage layout file at ./storage-layouts/proposed.$CONTRACT.json" - forge inspect $CONTRACT storagelayout --json > ./storage-layouts/temp.$CONTRACT.json + forge inspect $CONTRACT storagelayout --json >./storage-layouts/temp.$CONTRACT.json # Delete any astId keys from the file, which seem to change every time the bytecode changes # and the types object which also contains astId changes. We only care about the size and relative # location of state variable slots. - jq 'del(.storage[] | .astId)' ./storage-layouts/temp.$CONTRACT.json | jq 'del(.storage[] | .type)' | jq 'del(.types)' > ./storage-layouts/proposed.$CONTRACT.json + jq 'del(.storage[] | .astId)' ./storage-layouts/temp.$CONTRACT.json | jq 'del(.storage[] | .type)' | jq 'del(.types)' >./storage-layouts/proposed.$CONTRACT.json rm ./storage-layouts/temp.$CONTRACT.json echo "'forge inspect' command created temp storage layout file!" if ! diff -q "./storage-layouts/proposed.$CONTRACT.json" "./storage-layouts/$CONTRACT.json" &>/dev/null; then @@ -35,4 +35,3 @@ for CONTRACT in "${CONTRACTS[@]}"; do done exit 0 - From fd2319dc4cd8abe4a3aa06c05e28ea6b1443540b Mon Sep 17 00:00:00 2001 From: Faisal Usmani Date: Tue, 23 Sep 2025 14:03:02 -0400 Subject: [PATCH 6/6] fixed test Signed-off-by: Faisal Usmani --- test/evm/foundry/local/WithdrawalHelper.t.sol | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/test/evm/foundry/local/WithdrawalHelper.t.sol b/test/evm/foundry/local/WithdrawalHelper.t.sol index 4f180f835..b6bdac8cc 100644 --- a/test/evm/foundry/local/WithdrawalHelper.t.sol +++ b/test/evm/foundry/local/WithdrawalHelper.t.sol @@ -12,7 +12,7 @@ import { Ovm_WithdrawalHelper, IOvm_SpokePool } from "../../../../contracts/chai import { CircleDomainIds } from "../../../../contracts/libraries/CircleCCTPAdapter.sol"; import { L2GatewayRouter } from "../../../../contracts/test/ArbitrumMocks.sol"; import { MockBedrockL2StandardBridge, MockBedrockCrossDomainMessenger } from "../../../../contracts/test/MockBedrockStandardBridge.sol"; -import { Base_SpokePool } from "../../../../contracts/Base_SpokePool.sol"; +import { OP_SpokePool } from "../../../../contracts/OP_SpokePool.sol"; import { Ovm_SpokePool } from "../../../../contracts/Ovm_SpokePool.sol"; import { WithdrawalHelperBase } from "../../../../contracts/chain-adapters/l2/WithdrawalHelperBase.sol"; import { WETH9 } from "../../../../contracts/external/WETH9.sol"; @@ -34,7 +34,7 @@ contract WithdrawalAdapterTest is Test { uint32 constant fillDeadlineBuffer = type(uint32).max; Arbitrum_WithdrawalHelper arbitrumWithdrawalHelper; Ovm_WithdrawalHelper ovmWithdrawalHelper; - Base_SpokePool ovmSpokePool; + OP_SpokePool ovmSpokePool; L2GatewayRouter arbBridge; MockBedrockL2StandardBridge ovmBridge; @@ -87,7 +87,7 @@ contract WithdrawalAdapterTest is Test { // Construct the Ovm_SpokePool vm.startPrank(owner); arbBridge.setL2TokenAddress(address(l1Token), address(l2Token)); - Base_SpokePool implementation = new Base_SpokePool( + OP_SpokePool implementation = new OP_SpokePool( address(l2Weth), fillDeadlineBuffer, fillDeadlineBuffer, @@ -96,9 +96,9 @@ contract WithdrawalAdapterTest is Test { ); address proxy = address( // The cross domain admin is set as the messenger so that we may set remote token mappings. - new ERC1967Proxy(address(implementation), abi.encodeCall(Base_SpokePool.initialize, (0, hubPool, owner))) + new ERC1967Proxy(address(implementation), abi.encodeCall(OP_SpokePool.initialize, (0, hubPool, owner))) ); - ovmSpokePool = Base_SpokePool(payable(proxy)); + ovmSpokePool = OP_SpokePool(payable(proxy)); vm.stopPrank(); // Set a custom token and bridge mapping in the spoke pool.