diff --git a/deploy/001_deploy_hubpool.ts b/deploy/001_deploy_hubpool.ts deleted file mode 100644 index db79a0219..000000000 --- a/deploy/001_deploy_hubpool.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { DeployFunction } from "hardhat-deploy/types"; -import { HardhatRuntimeEnvironment } from "hardhat/types"; -import { L1_ADDRESS_MAP, WETH, ZERO_ADDRESS } from "./consts"; - -const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { - const { deployer } = await hre.getNamedAccounts(); - const chainId = parseInt(await hre.getChainId()); - const lpTokenFactory = await hre.deployments.deploy("LpTokenFactory", { - from: deployer, - log: true, - skipIfAlreadyDeployed: true, - }); - - await hre.deployments.deploy("HubPool", { - from: deployer, - log: true, - skipIfAlreadyDeployed: true, - args: [lpTokenFactory.address, L1_ADDRESS_MAP[chainId].finder, WETH[chainId], ZERO_ADDRESS], - libraries: { MerkleLib: lpTokenFactory.address }, - }); -}; -module.exports = func; -func.tags = ["HubPool", "mainnet"]; diff --git a/deploy/002_deploy_optimism_adapter.ts b/deploy/002_deploy_optimism_adapter.ts deleted file mode 100644 index 0f7feaf57..000000000 --- a/deploy/002_deploy_optimism_adapter.ts +++ /dev/null @@ -1,30 +0,0 @@ -import { DeployFunction } from "hardhat-deploy/types"; -import { HardhatRuntimeEnvironment } from "hardhat/types"; -import { CHAIN_IDs } from "../utils"; -import { L1_ADDRESS_MAP, OP_STACK_ADDRESS_MAP, USDC, WETH } from "./consts"; - -const SPOKE_CHAIN_ID = CHAIN_IDs.OPTIMISM; - -const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { - const { deployer } = await hre.getNamedAccounts(); - const chainId = parseInt(await hre.getChainId()); - const opStack = OP_STACK_ADDRESS_MAP[chainId][SPOKE_CHAIN_ID]; - - const args = [ - WETH[chainId], - opStack.L1CrossDomainMessenger, - opStack.L1StandardBridge, - USDC[chainId], - L1_ADDRESS_MAP[chainId].cctpV2TokenMessenger, - ]; - const instance = await hre.deployments.deploy("Optimism_Adapter", { - from: deployer, - log: true, - skipIfAlreadyDeployed: false, - args: args, - }); - await hre.run("verify:verify", { address: instance.address, constructorArguments: args }); -}; - -module.exports = func; -func.tags = ["OptimismAdapter", "mainnet"]; diff --git a/deploy/003_deploy_optimism_spokepool.ts b/deploy/003_deploy_optimism_spokepool.ts deleted file mode 100644 index 58a6551a9..000000000 --- a/deploy/003_deploy_optimism_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, 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 = [ - // Initialize deposit counter to very high number of deposits to avoid duplicate deposit ID's - // with deprecated spoke pool. - 1_000_000, - // 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].cctpV2TokenMessenger, - ]; - await deployNewProxy("Optimism_SpokePool", constructorArgs, initArgs); -}; -module.exports = func; -func.tags = ["OptimismSpokePool", "optimism"]; diff --git a/deploy/004_deploy_arbitrum_adapter.ts b/deploy/004_deploy_arbitrum_adapter.ts deleted file mode 100644 index 66ce466c7..000000000 --- a/deploy/004_deploy_arbitrum_adapter.ts +++ /dev/null @@ -1,43 +0,0 @@ -import { CHAIN_IDs } from "@across-protocol/constants"; -import { getOftEid, toWei } from "../utils/utils"; -import { L1_ADDRESS_MAP, USDC } from "./consts"; -import { getDeployedAddress } from "../src/DeploymentUtils"; -import { DeployFunction } from "hardhat-deploy/types"; -import { HardhatRuntimeEnvironment } from "hardhat/types"; - -const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { - const { deployer } = await hre.getNamedAccounts(); - const chainId = parseInt(await hre.getChainId()); - - // This address receives gas refunds on the L2 after messages are relayed. Currently - // set to the Risk Labs relayer address. The deployer should change this if necessary. - const l2RefundAddress = "0x07aE8551Be970cB1cCa11Dd7a11F47Ae82e70E67"; - - const spokeChainId = chainId == CHAIN_IDs.MAINNET ? CHAIN_IDs.ARBITRUM : CHAIN_IDs.ARBITRUM_SEPOLIA; - - const oftDstEid = getOftEid(spokeChainId); - const oftFeeCap = toWei("1"); // 1 eth transfer fee cap - const adapterStore = getDeployedAddress("AdapterStore", chainId); - - const args = [ - L1_ADDRESS_MAP[chainId].l1ArbitrumInbox, - L1_ADDRESS_MAP[chainId].l1ERC20GatewayRouter, - l2RefundAddress, - USDC[chainId], - L1_ADDRESS_MAP[chainId].cctpV2TokenMessenger, - adapterStore, - oftDstEid, - oftFeeCap, - ]; - const instance = await hre.deployments.deploy("Arbitrum_Adapter", { - from: deployer, - log: true, - skipIfAlreadyDeployed: false, - gasLimit: 2000000, - args, - }); - await hre.run("verify:verify", { address: instance.address, constructorArguments: args }); -}; - -module.exports = func; -func.tags = ["ArbitrumAdapter", "mainnet"]; diff --git a/deploy/005_deploy_arbitrum_spokepool.ts b/deploy/005_deploy_arbitrum_spokepool.ts deleted file mode 100644 index e32bbc9be..000000000 --- a/deploy/005_deploy_arbitrum_spokepool.ts +++ /dev/null @@ -1,34 +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"; -import { getOftEid, toWei } from "../utils/utils"; - -const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { - const { hubPool, hubChainId, spokeChainId } = await getSpokePoolDeploymentInfo(hre); - - const initArgs = [ - // Initialize deposit counter to very high number of deposits to avoid duplicate deposit ID's - // with deprecated spoke pool. - 1_000_000, - L2_ADDRESS_MAP[spokeChainId].l2GatewayRouter, - // Set hub pool as cross domain admin since it delegatecalls the Adapter logic. - hubPool.address, - hubPool.address, - ]; - - const oftEid = getOftEid(hubChainId); - const oftFeeCap = toWei(1); // 1 eth fee cap - const constructorArgs = [ - WETH[spokeChainId], - QUOTE_TIME_BUFFER, - FILL_DEADLINE_BUFFER, - USDC[spokeChainId], - L2_ADDRESS_MAP[spokeChainId].cctpV2TokenMessenger, - oftEid, - oftFeeCap, - ]; - await deployNewProxy("Arbitrum_SpokePool", constructorArgs, initArgs); -}; -module.exports = func; -func.tags = ["ArbitrumSpokePool", "arbitrum"]; diff --git a/deploy/006_deploy_ethereum_adapter.ts b/deploy/006_deploy_ethereum_adapter.ts deleted file mode 100644 index 876a3d532..000000000 --- a/deploy/006_deploy_ethereum_adapter.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { DeployFunction } from "hardhat-deploy/types"; -import { HardhatRuntimeEnvironment } from "hardhat/types"; - -const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { - const { deployer } = await hre.getNamedAccounts(); - - await hre.deployments.deploy("Ethereum_Adapter", { - from: deployer, - log: true, - skipIfAlreadyDeployed: true, - args: [], - }); -}; - -module.exports = func; -func.dependencies = ["HubPool"]; -func.tags = ["EthereumAdapter", "mainnet"]; diff --git a/deploy/007_deploy_ethereum_spokepool.ts b/deploy/007_deploy_ethereum_spokepool.ts deleted file mode 100644 index 6cd135096..000000000 --- a/deploy/007_deploy_ethereum_spokepool.ts +++ /dev/null @@ -1,20 +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, WETH } from "./consts"; - -const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { - const { hubPool, spokeChainId } = await getSpokePoolDeploymentInfo(hre); - console.log(`Using HubPool @ ${hubPool.address}`); - - // Initialize deposit counter to very high number of deposits to avoid duplicate deposit ID's - // with deprecated spoke pool. - const initArgs = [1_000_000, hubPool.address]; - - const constructorArgs = [WETH[spokeChainId], QUOTE_TIME_BUFFER, FILL_DEADLINE_BUFFER]; - await deployNewProxy("Ethereum_SpokePool", constructorArgs, initArgs); - - // Transfer ownership to hub pool. -}; -module.exports = func; -func.tags = ["EthereumSpokePool", "mainnet"]; diff --git a/deploy/008_deploy_polygon_token_bridger_mainnet.ts b/deploy/008_deploy_polygon_token_bridger_mainnet.ts deleted file mode 100644 index c3b3fc025..000000000 --- a/deploy/008_deploy_polygon_token_bridger_mainnet.ts +++ /dev/null @@ -1,30 +0,0 @@ -import { DeployFunction } from "hardhat-deploy/types"; -import { HardhatRuntimeEnvironment } from "hardhat/types"; -import { L1_ADDRESS_MAP, POLYGON_CHAIN_IDS, WETH, WMATIC } from "./consts"; - -const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { - const { deployments } = hre; - const { deployer } = await hre.getNamedAccounts(); - const hubChainId = parseInt(await hre.getChainId()); - const spokeChainId = POLYGON_CHAIN_IDS[hubChainId]; - const hubPool = await deployments.get("HubPool"); - - await deployments.deploy("PolygonTokenBridger", { - from: deployer, - log: true, - skipIfAlreadyDeployed: true, - args: [ - hubPool.address, - L1_ADDRESS_MAP[hubChainId].polygonRegistry, - WETH[hubChainId], - WMATIC[spokeChainId], - hubChainId, - spokeChainId, - ], - deterministicDeployment: "0x1234", // Salt for the create2 call. - }); -}; - -module.exports = func; -func.dependencies = ["HubPool"]; -func.tags = ["PolygonTokenBridgerL1", "mainnet"]; diff --git a/deploy/009_deploy_polygon_adapter.ts b/deploy/009_deploy_polygon_adapter.ts deleted file mode 100644 index 0fe4ccf00..000000000 --- a/deploy/009_deploy_polygon_adapter.ts +++ /dev/null @@ -1,43 +0,0 @@ -import { DeployFunction } from "hardhat-deploy/types"; -import { HardhatRuntimeEnvironment } from "hardhat/types"; -import { CHAIN_IDs, TOKEN_SYMBOLS_MAP } from "../utils"; -import { getOftEid, toWei } from "../utils/utils"; -import { L1_ADDRESS_MAP, USDC, WETH } from "./consts"; -import { getDeployedAddress } from "../src/DeploymentUtils"; - -const MATIC = TOKEN_SYMBOLS_MAP.MATIC.addresses; - -const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { - const { deployer } = await hre.getNamedAccounts(); - const chainId = parseInt(await hre.getChainId()); - - const spokeChainId = chainId == CHAIN_IDs.MAINNET ? CHAIN_IDs.POLYGON : CHAIN_IDs.POLYGON_AMOY; - - const oftDstEid = getOftEid(spokeChainId); - const oftFeeCap = toWei("1"); // 1 eth transfer fee cap - const adapterStore = getDeployedAddress("AdapterStore", chainId); - - const args = [ - L1_ADDRESS_MAP[chainId].polygonRootChainManager, - L1_ADDRESS_MAP[chainId].polygonFxRoot, - L1_ADDRESS_MAP[chainId].polygonDepositManager, - L1_ADDRESS_MAP[chainId].polygonERC20Predicate, - MATIC[chainId], - WETH[chainId], - USDC[chainId], - L1_ADDRESS_MAP[chainId].cctpV2TokenMessenger, - adapterStore, - oftDstEid, - oftFeeCap, - ]; - const instance = await hre.deployments.deploy("Polygon_Adapter", { - from: deployer, - log: true, - skipIfAlreadyDeployed: false, - args, - }); - await hre.run("verify:verify", { address: instance.address, constructorArguments: args }); -}; - -module.exports = func; -func.tags = ["PolygonAdapter", "mainnet"]; diff --git a/deploy/011_deploy_polygon_spokepool.ts b/deploy/011_deploy_polygon_spokepool.ts deleted file mode 100644 index a97206343..000000000 --- a/deploy/011_deploy_polygon_spokepool.ts +++ /dev/null @@ -1,39 +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, WMATIC } from "./consts"; -import { getOftEid, toWei } from "../utils/utils"; - -const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { - const { hubPool, hubChainId, spokeChainId } = await getSpokePoolDeploymentInfo(hre); - - const initArgs = [ - // Initialize deposit counter to very high number of deposits to avoid duplicate deposit ID's - // with deprecated spoke pool. - 1_000_000, - // The same token bridger must be deployed on mainnet and polygon, so its easier - // to reuse it. - "0x0330E9b4D0325cCfF515E81DFbc7754F2a02ac57", - // Set hub pool as cross domain admin since it delegatecalls the Adapter logic. - hubPool.address, - hubPool.address, - L2_ADDRESS_MAP[spokeChainId].fxChild, - ]; - - const oftEid = getOftEid(hubChainId); - // Fee cap of 22K POL is roughly equivalent to $5K at current POL price of ~0.23 - const oftFeeCap = toWei(22000); - const constructorArgs = [ - WMATIC[spokeChainId], - QUOTE_TIME_BUFFER, - FILL_DEADLINE_BUFFER, - USDC[spokeChainId], - L2_ADDRESS_MAP[spokeChainId].cctpV2TokenMessenger, - oftEid, - oftFeeCap, - ]; - await deployNewProxy("Polygon_SpokePool", constructorArgs, initArgs); -}; - -module.exports = func; -func.tags = ["PolygonSpokePool", "polygon"]; diff --git a/deploy/024_deploy_base_adapter.ts b/deploy/024_deploy_base_adapter.ts deleted file mode 100644 index b8c92a70e..000000000 --- a/deploy/024_deploy_base_adapter.ts +++ /dev/null @@ -1,31 +0,0 @@ -import { DeployFunction } from "hardhat-deploy/types"; -import { HardhatRuntimeEnvironment } from "hardhat/types"; -import { CHAIN_IDs } from "../utils"; -import { L1_ADDRESS_MAP, OP_STACK_ADDRESS_MAP, USDC, WETH } from "./consts"; - -const SPOKE_CHAIN_ID = CHAIN_IDs.BASE; - -const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { - const { deployer } = await hre.getNamedAccounts(); - const chainId = parseInt(await hre.getChainId()); - const opStack = OP_STACK_ADDRESS_MAP[chainId][SPOKE_CHAIN_ID]; - - const args = [ - WETH[chainId], - opStack.L1CrossDomainMessenger, - opStack.L1StandardBridge, - USDC[chainId], - L1_ADDRESS_MAP[chainId].cctpV2TokenMessenger, - ]; - - const instance = await hre.deployments.deploy("Base_Adapter", { - from: deployer, - log: true, - skipIfAlreadyDeployed: false, - args, - }); - await hre.run("verify:verify", { address: instance.address, constructorArguments: args }); -}; - -module.exports = func; -func.tags = ["BaseAdapter", "mainnet"]; diff --git a/deploy/025_deploy_op_spokepool.ts b/deploy/025_deploy_op_spokepool.ts deleted file mode 100644 index 2297340d6..000000000 --- a/deploy/025_deploy_op_spokepool.ts +++ /dev/null @@ -1,27 +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, ZERO_ADDRESS } from "./consts"; - -const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { - const { hubPool, spokeChainId } = await getSpokePoolDeploymentInfo(hre); - - const initArgs = [ - // Initialize deposit counter to very high number of deposits to avoid duplicate deposit ID's - // with deprecated spoke pool. - 1_000_000, - // 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] ?? ZERO_ADDRESS, - L2_ADDRESS_MAP[spokeChainId].cctpV2TokenMessenger ?? ZERO_ADDRESS, - ]; - await deployNewProxy("OP_SpokePool", constructorArgs, initArgs); -}; -module.exports = func; -func.tags = ["OPSpokePool", "base", "unichain", "mode", "bob", "redstone", "zora"]; diff --git a/deploy/027_deploy_scroll_spokepool.ts b/deploy/027_deploy_scroll_spokepool.ts deleted file mode 100644 index bab18cc9c..000000000 --- a/deploy/027_deploy_scroll_spokepool.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { HardhatRuntimeEnvironment } from "hardhat/types"; -import { DeployFunction } from "hardhat-deploy/types"; -import { deployNewProxy, getSpokePoolDeploymentInfo } from "../utils/utils.hre"; -import { FILL_DEADLINE_BUFFER, L2_ADDRESS_MAP, QUOTE_TIME_BUFFER, WETH } from "./consts"; - -const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { - const { hubPool } = await getSpokePoolDeploymentInfo(hre); - const chainId = parseInt(await hre.getChainId()); - - // Initialize deposit counter to very high number of deposits to avoid duplicate deposit ID's - // with deprecated spoke pool. - // Set hub pool as cross domain admin since it delegatecalls the Adapter logic. - const initArgs = [ - L2_ADDRESS_MAP[chainId].scrollERC20GatewayRouter, - L2_ADDRESS_MAP[chainId].scrollMessenger, - 1_000_000, - hubPool.address, - hubPool.address, - ]; - const constructorArgs = [WETH[chainId], QUOTE_TIME_BUFFER, FILL_DEADLINE_BUFFER]; - - await deployNewProxy("Scroll_SpokePool", constructorArgs, initArgs); -}; -module.exports = func; -func.tags = ["ScrollSpokePool", "scroll"]; diff --git a/deploy/036_deploy_blast_spokepool.ts b/deploy/036_deploy_blast_spokepool.ts deleted file mode 100644 index b10eebd1b..000000000 --- a/deploy/036_deploy_blast_spokepool.ts +++ /dev/null @@ -1,38 +0,0 @@ -import { DeployFunction } from "hardhat-deploy/types"; -import { HardhatRuntimeEnvironment } from "hardhat/types"; -import { deployNewProxy, getSpokePoolDeploymentInfo } from "../utils/utils.hre"; -import { FILL_DEADLINE_BUFFER, L1_ADDRESS_MAP, WETH, QUOTE_TIME_BUFFER, ZERO_ADDRESS } from "./consts"; -import { TOKEN_SYMBOLS_MAP } from "@across-protocol/constants"; - -const USDB = TOKEN_SYMBOLS_MAP.USDB.addresses; - -const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { - const { hubPool, spokeChainId, hubChainId } = await getSpokePoolDeploymentInfo(hre); - - const initArgs = [ - // Initialize deposit counter to very high number of deposits to avoid duplicate deposit ID's - // with deprecated spoke pool. - 1_000_000, - // 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, - USDB[spokeChainId], - USDB[hubChainId], - "0x8bA929bE3462a809AFB3Bf9e100Ee110D2CFE531", - L1_ADDRESS_MAP[hubChainId].blastDaiRetriever, // Address of mainnet retriever contract to facilitate USDB finalizations. - ]; - await deployNewProxy("Blast_SpokePool", constructorArgs, initArgs); -}; -module.exports = func; -func.tags = ["BlastSpokePool", "blast"]; diff --git a/deploy/054_deploy_alephzero_spokepool.ts b/deploy/054_deploy_alephzero_spokepool.ts deleted file mode 100644 index ead7b95d7..000000000 --- a/deploy/054_deploy_alephzero_spokepool.ts +++ /dev/null @@ -1,34 +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, WAZERO, ZERO_ADDRESS } from "./consts"; - -const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { - const { hubPool, spokeChainId } = await getSpokePoolDeploymentInfo(hre); - - const initArgs = [ - 0, - L2_ADDRESS_MAP[spokeChainId].l2GatewayRouter, - // Set hub pool as cross domain admin since it delegatecalls the Adapter logic. - hubPool.address, - hubPool.address, - ]; - - const constructorArgs = [ - WAZERO[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, - // For now, we are not using OFT bridge and can disable by setting the - // oftMessenger and USDT token to the zero address. - ZERO_ADDRESS, - ZERO_ADDRESS, - ]; - await deployNewProxy("AlephZero_SpokePool", constructorArgs, initArgs); -}; -module.exports = func; -func.tags = ["AlephZeroSpokePool", "alephzero"]; diff --git a/deploy/057_deploy_ink_spokepool.ts b/deploy/057_deploy_ink_spokepool.ts deleted file mode 100644 index d914ee5c8..000000000 --- a/deploy/057_deploy_ink_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("Ink_SpokePool", constructorArgs, initArgs); -}; -module.exports = func; -func.tags = ["InkSpokePool", "ink"]; diff --git a/deploy/060_deploy_cher_spokepool.ts b/deploy/060_deploy_cher_spokepool.ts deleted file mode 100644 index c36bab20b..000000000 --- a/deploy/060_deploy_cher_spokepool.ts +++ /dev/null @@ -1,31 +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, USDCe } 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, - // Cher's bridged USDC is upgradeable to native. There are not two different - // addresses for bridges/native USDC. This address is also used in the spoke pool - // to determine whether to use CCTP (in the future) or the custom USDC bridge. - USDCe[spokeChainId], - // 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("Cher_SpokePool", constructorArgs, initArgs); -}; -module.exports = func; -func.tags = ["CherSpokePool", "cher"]; diff --git a/deploy/061_deploy_unichain_adapter.ts b/deploy/061_deploy_unichain_adapter.ts deleted file mode 100644 index 82fccc75c..000000000 --- a/deploy/061_deploy_unichain_adapter.ts +++ /dev/null @@ -1,36 +0,0 @@ -import { DeployFunction } from "hardhat-deploy/types"; -import { HardhatRuntimeEnvironment } from "hardhat/types"; -import { CHAIN_IDs } from "../utils"; -import { L1_ADDRESS_MAP, OP_STACK_ADDRESS_MAP, USDC, WETH } from "./consts"; -import assert from "assert"; - -const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { - const { SPOKE_CHAIN_ID = CHAIN_IDs.UNICHAIN } = process.env; - assert( - [CHAIN_IDs.UNICHAIN_SEPOLIA, CHAIN_IDs.UNICHAIN].includes(parseInt(SPOKE_CHAIN_ID)), - "SPOKE_CHAIN_ID must be either UNICHAIN_SEPOLIA or UNICHAIN" - ); - - const { deployer } = await hre.getNamedAccounts(); - const chainId = parseInt(await hre.getChainId()); - const opStack = OP_STACK_ADDRESS_MAP[chainId][SPOKE_CHAIN_ID]; - - const args = [ - WETH[chainId], - opStack.L1CrossDomainMessenger, - opStack.L1StandardBridge, - USDC[chainId], - L1_ADDRESS_MAP[chainId].cctpV2TokenMessenger, - ]; - - const instance = await hre.deployments.deploy("DoctorWho_Adapter", { - from: deployer, - log: true, - skipIfAlreadyDeployed: false, - args, - }); - await hre.run("verify:verify", { address: instance.address, constructorArguments: args }); -}; - -module.exports = func; -func.tags = ["DoctorWhoAdapter", "doctorwho"]; diff --git a/deploy/110_deploy_universal_adapter.ts b/deploy/110_deploy_universal_adapter.ts deleted file mode 100644 index 670e944b3..000000000 --- a/deploy/110_deploy_universal_adapter.ts +++ /dev/null @@ -1,47 +0,0 @@ -import { DeployFunction } from "hardhat-deploy/types"; -import { getOftEid, toWei } from "../utils/utils"; -import { HardhatRuntimeEnvironment } from "hardhat/types"; -import { CIRCLE_DOMAIN_IDs, L1_ADDRESS_MAP, USDC, ZERO_ADDRESS } from "./consts"; -import { CCTP_NO_DOMAIN } from "@across-protocol/constants"; -import { CIRCLE_UNINITIALIZED_DOMAIN_ID } from "./consts"; -import assert from "assert"; -import { getDeployedAddress } from "../src/DeploymentUtils"; - -const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { - const { SPOKE_CHAIN_ID } = process.env; - assert(SPOKE_CHAIN_ID, "SPOKE_CHAIN_ID is required"); - - const { deployer } = await hre.getNamedAccounts(); - const chainId = parseInt(await hre.getChainId()); - - // Warning: re-using the same HubPoolStore for different L2's is only safe if the L2 spoke pools have - // unique addresses, since the relayed message `targets` are part of the unique data hash. - const hubPoolStore = getDeployedAddress("HubPoolStore", chainId); - - // todo: implement similar treatment to `CIRCLE_DOMAIN_IDs` - const oftDstEid = getOftEid(Number(SPOKE_CHAIN_ID)); - const oftFeeCap = toWei("1"); // 1 eth transfer fee cap - const adapterStore = getDeployedAddress("AdapterStore", chainId); - - const cctpDomainId = CIRCLE_DOMAIN_IDs[Number(SPOKE_CHAIN_ID)] ?? CCTP_NO_DOMAIN; - const args = [ - hubPoolStore, - USDC[chainId], - // ! Notice: pick `cctpV2TokenMessenger` / `cctpTokenMessenger` here to match your spoke CCTP version - cctpDomainId === CCTP_NO_DOMAIN ? ZERO_ADDRESS : L1_ADDRESS_MAP[chainId].cctpV2TokenMessenger, - cctpDomainId === CCTP_NO_DOMAIN ? CIRCLE_UNINITIALIZED_DOMAIN_ID : cctpDomainId, - adapterStore, - oftDstEid, - oftFeeCap, - ]; - const instance = await hre.deployments.deploy("Universal_Adapter", { - from: deployer, - log: true, - skipIfAlreadyDeployed: false, - args, - }); - await hre.run("verify:verify", { address: instance.address, constructorArguments: args }); -}; - -module.exports = func; -func.tags = ["UniversalAdapter"]; diff --git a/deploy/111_deploy_universal_spokepool.ts b/deploy/111_deploy_universal_spokepool.ts deleted file mode 100644 index c9398c2ef..000000000 --- a/deploy/111_deploy_universal_spokepool.ts +++ /dev/null @@ -1,78 +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, ZERO_ADDRESS } from "./consts"; -import { CHAIN_IDs, PRODUCTION_NETWORKS, TOKEN_SYMBOLS_MAP } from "../utils/constants"; -import { getOftEid, toWei } from "../utils/utils"; -import { getDeployedAddress } from "../src/DeploymentUtils"; -import "@nomiclabs/hardhat-ethers"; - -const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { - const { hubPool, hubChainId, spokeChainId } = await getSpokePoolDeploymentInfo(hre); - if (spokeChainId == CHAIN_IDs.BSC) { - console.log("For BSC deployment to work, `hardhat.config.ts` might need a tweak"); - // Set these in hardhat.config.ts networks.bsc - // gas: "auto", - // gasPrice: 3e8, // 0.3 GWEI - // gasMultiplier: 4.0, - } - - const initArgs = [1, hubPool.address, hubPool.address]; - - // Get Wrapped native token address: - const nativeTokenSymbol = PRODUCTION_NETWORKS[spokeChainId].nativeToken; - const wrappedPrefix = "W"; - const wrappedNativeSymbol = `${wrappedPrefix}${nativeTokenSymbol}`; - const expectedWrappedNative = TOKEN_SYMBOLS_MAP[wrappedNativeSymbol].addresses[spokeChainId]; - if (!expectedWrappedNative) { - throw new Error(`Wrapped native token not found for ${wrappedNativeSymbol} on chainId ${spokeChainId}`); - } - - const oftEid = getOftEid(hubChainId); - // ! Notice. Deployer has to adjust this fee cap based on dst chain's native token. 4.4 BNB for BSC - let oftFeeCap = toWei("1"); // 1 ETH fee cap - switch (spokeChainId) { - case CHAIN_IDs.MONAD: - oftFeeCap = toWei(78_000); // ~1 ETH fee cap - break; - case CHAIN_IDs.BSC: - oftFeeCap = toWei(4.4); // ~1 ETH fee cap - break; - case CHAIN_IDs.HYPEREVM: - oftFeeCap = toWei(100); // ~1ETH fee cap - break; - } - - const heliosAddress = getDeployedAddress("Helios", spokeChainId); - - const constructorArgs = [ - 24 * 60 * 60, // 1 day; Helios latest head timestamp must be 1 day old before an admin can force execute a message. - heliosAddress, - getDeployedAddress("HubPoolStore", hubChainId), - expectedWrappedNative, - QUOTE_TIME_BUFFER, - FILL_DEADLINE_BUFFER, - USDC[spokeChainId] ?? ZERO_ADDRESS, - // ! Notice: pick `cctpV2TokenMessenger` / `cctpTokenMessenger` here to match your adapter CCTP version - L2_ADDRESS_MAP[spokeChainId]?.cctpV2TokenMessenger ?? ZERO_ADDRESS, - oftEid, - oftFeeCap, - ]; - console.log(`Deploying new Universal SpokePool on ${spokeChainId} with constructor arguments:`, constructorArgs); - console.log(`Deploying implementation with initialization arguments:`, initArgs); - - // @dev Deploy on different address for each chain. - // The Universal Adapter writes calldata to be relayed to L2 by associating it with the - // target address of the spoke pool. This is because the HubPool does not pass in the chainId when calling - // relayMessage() on the Adapter. Therefore, if Universal SpokePools share the same address, - // then a message designed to be sent to one chain could be sent to another's SpokePool. - const { proxyAddress } = await deployNewProxy("Universal_SpokePool", constructorArgs, initArgs); - - if (!proxyAddress) { - return; - } - - console.log(`Deployed Universal SpokePool at ${proxyAddress}! Remember to transfer ownership to the Gnosis Safe!`); -}; -module.exports = func; -func.tags = ["UniversalSpokePool"];