diff --git a/cross-chain/arbitrum/deploy_l2/00_resolve_solana_wormhole_gateway.ts b/cross-chain/arbitrum/deploy_l2/00_resolve_solana_wormhole_gateway.ts new file mode 100644 index 000000000..3e6d35e5d --- /dev/null +++ b/cross-chain/arbitrum/deploy_l2/00_resolve_solana_wormhole_gateway.ts @@ -0,0 +1,28 @@ +import type { HardhatRuntimeEnvironment } from "hardhat/types" +import type { DeployFunction } from "hardhat-deploy/types" + +const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { + const { helpers, deployments } = hre + const { log } = deployments + + const SolanaWormholeGateway = await deployments.getOrNull( + "SolanaWormholeGateway" + ) + + if ( + SolanaWormholeGateway && + helpers.address.isValid(SolanaWormholeGateway.address) + ) { + log( + `using existing SolanaWormholeGateway at ${SolanaWormholeGateway.address}` + ) + } else if (hre.network.name === "hardhat") { + log("using fake SolanaWormholeGateway for hardhat network") + } else { + throw new Error("deployed SolanaWormholeGateway contract not found") + } +} + +export default func + +func.tags = ["SolanaWormholeGateway"] diff --git a/cross-chain/arbitrum/deploy_l2/16_update_with_solana_in_wormhole_gateway_mapping.ts b/cross-chain/arbitrum/deploy_l2/16_update_with_solana_in_wormhole_gateway_mapping.ts new file mode 100644 index 000000000..0f026846b --- /dev/null +++ b/cross-chain/arbitrum/deploy_l2/16_update_with_solana_in_wormhole_gateway_mapping.ts @@ -0,0 +1,39 @@ +import type { HardhatRuntimeEnvironment } from "hardhat/types" +import type { DeployFunction } from "hardhat-deploy/types" + +const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { + const { deployments, getNamedAccounts } = hre + const { execute, log } = deployments + const { deployer } = await getNamedAccounts() + + // Fake SolanaWormholeGateway for local development purposes only. + const fakeSolanaWormholeGateway = + "0x11a22dc2e01ecd2ae40864822d4406ff8aed4e2b8932385dabe818422ff67e1b" + + // See https://docs.wormhole.com/wormhole/blockchain-environments/solana + // This ID is valid for both Solana Devnet and Mainnet + const solanaWormholeChainID = 1 + + const solanaWormholeGateway = await deployments.getOrNull( + "SolanaWormholeGateway" + ) + + let solanaWormholeGatewayAddress = solanaWormholeGateway?.address + if (!solanaWormholeGatewayAddress && hre.network.name === "hardhat") { + solanaWormholeGatewayAddress = fakeSolanaWormholeGateway + log(`fake SolanaWormholeGateway address ${solanaWormholeGatewayAddress}`) + } + + await execute( + "ArbitrumWormholeGateway", + { from: deployer, log: true, waitConfirmations: 1 }, + "updateGatewayAddress", + solanaWormholeChainID, + solanaWormholeGatewayAddress + ) +} + +export default func + +func.tags = ["SetSolanaGatewayAddress"] +func.dependencies = ["ArbitrumWormholeGateway", "SolanaWormholeGateway"] diff --git a/cross-chain/arbitrum/external/arbitrumGoerli/SolanaWormholeGateway.json b/cross-chain/arbitrum/external/arbitrumGoerli/SolanaWormholeGateway.json new file mode 100644 index 000000000..dee25fa3e --- /dev/null +++ b/cross-chain/arbitrum/external/arbitrumGoerli/SolanaWormholeGateway.json @@ -0,0 +1,3 @@ +{ + "address": "0x69a22dc2e01ecd2ae40864822d4406ff8aed4e2b8932385dabe818422ff67e1b" +} diff --git a/cross-chain/arbitrum/external/arbitrumOne/SolanaWormholeGateway.json b/cross-chain/arbitrum/external/arbitrumOne/SolanaWormholeGateway.json new file mode 100644 index 000000000..dee25fa3e --- /dev/null +++ b/cross-chain/arbitrum/external/arbitrumOne/SolanaWormholeGateway.json @@ -0,0 +1,3 @@ +{ + "address": "0x69a22dc2e01ecd2ae40864822d4406ff8aed4e2b8932385dabe818422ff67e1b" +} diff --git a/cross-chain/base/deploy_l2/00_resolve_solana_wormhole_gateway.ts b/cross-chain/base/deploy_l2/00_resolve_solana_wormhole_gateway.ts new file mode 100644 index 000000000..3e6d35e5d --- /dev/null +++ b/cross-chain/base/deploy_l2/00_resolve_solana_wormhole_gateway.ts @@ -0,0 +1,28 @@ +import type { HardhatRuntimeEnvironment } from "hardhat/types" +import type { DeployFunction } from "hardhat-deploy/types" + +const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { + const { helpers, deployments } = hre + const { log } = deployments + + const SolanaWormholeGateway = await deployments.getOrNull( + "SolanaWormholeGateway" + ) + + if ( + SolanaWormholeGateway && + helpers.address.isValid(SolanaWormholeGateway.address) + ) { + log( + `using existing SolanaWormholeGateway at ${SolanaWormholeGateway.address}` + ) + } else if (hre.network.name === "hardhat") { + log("using fake SolanaWormholeGateway for hardhat network") + } else { + throw new Error("deployed SolanaWormholeGateway contract not found") + } +} + +export default func + +func.tags = ["SolanaWormholeGateway"] diff --git a/cross-chain/base/deploy_l2/16_update_with_solana_in_wormhole_gateway_mapping.ts b/cross-chain/base/deploy_l2/16_update_with_solana_in_wormhole_gateway_mapping.ts new file mode 100644 index 000000000..8a2e06762 --- /dev/null +++ b/cross-chain/base/deploy_l2/16_update_with_solana_in_wormhole_gateway_mapping.ts @@ -0,0 +1,39 @@ +import type { HardhatRuntimeEnvironment } from "hardhat/types" +import type { DeployFunction } from "hardhat-deploy/types" + +const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { + const { deployments, getNamedAccounts } = hre + const { execute, log } = deployments + const { deployer } = await getNamedAccounts() + + // Fake SolanaWormholeGateway for local development purposes only. + const fakeSolanaWormholeGateway = + "0x11a22dc2e01ecd2ae40864822d4406ff8aed4e2b8932385dabe818422ff67e1b" + + // See https://docs.wormhole.com/wormhole/blockchain-environments/solana + // This ID is valid for both Solana Devnet and Mainnet + const solanaWormholeChainID = 1 + + const solanaWormholeGateway = await deployments.getOrNull( + "SolanaWormholeGateway" + ) + + let solanaWormholeGatewayAddress = solanaWormholeGateway?.address + if (!solanaWormholeGatewayAddress && hre.network.name === "hardhat") { + solanaWormholeGatewayAddress = fakeSolanaWormholeGateway + log(`fake SolanaWormholeGateway address ${solanaWormholeGatewayAddress}`) + } + + await execute( + "BaseWormholeGateway", + { from: deployer, log: true, waitConfirmations: 1 }, + "updateGatewayAddress", + solanaWormholeChainID, + solanaWormholeGatewayAddress + ) +} + +export default func + +func.tags = ["SetSolanaGatewayAddress"] +func.dependencies = ["BaseWormholeGateway", "SolanaWormholeGateway"] diff --git a/cross-chain/base/external/base/SolanaWormholeGateway.json b/cross-chain/base/external/base/SolanaWormholeGateway.json new file mode 100644 index 000000000..dee25fa3e --- /dev/null +++ b/cross-chain/base/external/base/SolanaWormholeGateway.json @@ -0,0 +1,3 @@ +{ + "address": "0x69a22dc2e01ecd2ae40864822d4406ff8aed4e2b8932385dabe818422ff67e1b" +} diff --git a/cross-chain/base/external/baseGoerli/SolanaWormholeGateway.json b/cross-chain/base/external/baseGoerli/SolanaWormholeGateway.json new file mode 100644 index 000000000..dee25fa3e --- /dev/null +++ b/cross-chain/base/external/baseGoerli/SolanaWormholeGateway.json @@ -0,0 +1,3 @@ +{ + "address": "0x69a22dc2e01ecd2ae40864822d4406ff8aed4e2b8932385dabe818422ff67e1b" +} diff --git a/cross-chain/optimism/deploy_l2/00_resolve_solana_wormhole_gateway.ts b/cross-chain/optimism/deploy_l2/00_resolve_solana_wormhole_gateway.ts new file mode 100644 index 000000000..3e6d35e5d --- /dev/null +++ b/cross-chain/optimism/deploy_l2/00_resolve_solana_wormhole_gateway.ts @@ -0,0 +1,28 @@ +import type { HardhatRuntimeEnvironment } from "hardhat/types" +import type { DeployFunction } from "hardhat-deploy/types" + +const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { + const { helpers, deployments } = hre + const { log } = deployments + + const SolanaWormholeGateway = await deployments.getOrNull( + "SolanaWormholeGateway" + ) + + if ( + SolanaWormholeGateway && + helpers.address.isValid(SolanaWormholeGateway.address) + ) { + log( + `using existing SolanaWormholeGateway at ${SolanaWormholeGateway.address}` + ) + } else if (hre.network.name === "hardhat") { + log("using fake SolanaWormholeGateway for hardhat network") + } else { + throw new Error("deployed SolanaWormholeGateway contract not found") + } +} + +export default func + +func.tags = ["SolanaWormholeGateway"] diff --git a/cross-chain/optimism/deploy_l2/16_update_with_solana_in_wormhole_gateway_mapping.ts b/cross-chain/optimism/deploy_l2/16_update_with_solana_in_wormhole_gateway_mapping.ts new file mode 100644 index 000000000..2d5c85dca --- /dev/null +++ b/cross-chain/optimism/deploy_l2/16_update_with_solana_in_wormhole_gateway_mapping.ts @@ -0,0 +1,39 @@ +import type { HardhatRuntimeEnvironment } from "hardhat/types" +import type { DeployFunction } from "hardhat-deploy/types" + +const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { + const { deployments, getNamedAccounts } = hre + const { execute, log } = deployments + const { deployer } = await getNamedAccounts() + + // Fake SolanaWormholeGateway for local development purposes only. + const fakeSolanaWormholeGateway = + "0x11a22dc2e01ecd2ae40864822d4406ff8aed4e2b8932385dabe818422ff67e1b" + + // See https://docs.wormhole.com/wormhole/blockchain-environments/solana + // This ID is valid for both Solana Devnet and Mainnet + const solanaWormholeChainID = 1 + + const solanaWormholeGateway = await deployments.getOrNull( + "SolanaWormholeGateway" + ) + + let solanaWormholeGatewayAddress = solanaWormholeGateway?.address + if (!solanaWormholeGatewayAddress && hre.network.name === "hardhat") { + solanaWormholeGatewayAddress = fakeSolanaWormholeGateway + log(`fake SolanaWormholeGateway address ${solanaWormholeGatewayAddress}`) + } + + await execute( + "OptimismWormholeGateway", + { from: deployer, log: true, waitConfirmations: 1 }, + "updateGatewayAddress", + solanaWormholeChainID, + solanaWormholeGatewayAddress + ) +} + +export default func + +func.tags = ["SetSolanaGatewayAddress"] +func.dependencies = ["OptimismWormholeGateway", "SolanaWormholeGateway"] diff --git a/cross-chain/optimism/external/optimism/SolanaWormholeGateway.json b/cross-chain/optimism/external/optimism/SolanaWormholeGateway.json new file mode 100644 index 000000000..dee25fa3e --- /dev/null +++ b/cross-chain/optimism/external/optimism/SolanaWormholeGateway.json @@ -0,0 +1,3 @@ +{ + "address": "0x69a22dc2e01ecd2ae40864822d4406ff8aed4e2b8932385dabe818422ff67e1b" +} diff --git a/cross-chain/optimism/external/optimismGoerli/SolanaWormholeGateway.json b/cross-chain/optimism/external/optimismGoerli/SolanaWormholeGateway.json new file mode 100644 index 000000000..dee25fa3e --- /dev/null +++ b/cross-chain/optimism/external/optimismGoerli/SolanaWormholeGateway.json @@ -0,0 +1,3 @@ +{ + "address": "0x69a22dc2e01ecd2ae40864822d4406ff8aed4e2b8932385dabe818422ff67e1b" +} diff --git a/cross-chain/polygon/deploy_sidechain/00_resolve_solana_wormhole_gateway.ts b/cross-chain/polygon/deploy_sidechain/00_resolve_solana_wormhole_gateway.ts new file mode 100644 index 000000000..3e6d35e5d --- /dev/null +++ b/cross-chain/polygon/deploy_sidechain/00_resolve_solana_wormhole_gateway.ts @@ -0,0 +1,28 @@ +import type { HardhatRuntimeEnvironment } from "hardhat/types" +import type { DeployFunction } from "hardhat-deploy/types" + +const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { + const { helpers, deployments } = hre + const { log } = deployments + + const SolanaWormholeGateway = await deployments.getOrNull( + "SolanaWormholeGateway" + ) + + if ( + SolanaWormholeGateway && + helpers.address.isValid(SolanaWormholeGateway.address) + ) { + log( + `using existing SolanaWormholeGateway at ${SolanaWormholeGateway.address}` + ) + } else if (hre.network.name === "hardhat") { + log("using fake SolanaWormholeGateway for hardhat network") + } else { + throw new Error("deployed SolanaWormholeGateway contract not found") + } +} + +export default func + +func.tags = ["SolanaWormholeGateway"] diff --git a/cross-chain/polygon/deploy_sidechain/16_update_with_solana_in_wormhole_gateway_mapping.ts b/cross-chain/polygon/deploy_sidechain/16_update_with_solana_in_wormhole_gateway_mapping.ts new file mode 100644 index 000000000..1814f79c4 --- /dev/null +++ b/cross-chain/polygon/deploy_sidechain/16_update_with_solana_in_wormhole_gateway_mapping.ts @@ -0,0 +1,39 @@ +import type { HardhatRuntimeEnvironment } from "hardhat/types" +import type { DeployFunction } from "hardhat-deploy/types" + +const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { + const { deployments, getNamedAccounts } = hre + const { execute, log } = deployments + const { deployer } = await getNamedAccounts() + + // Fake SolanaWormholeGateway for local development purposes only. + const fakeSolanaWormholeGateway = + "0x11a22dc2e01ecd2ae40864822d4406ff8aed4e2b8932385dabe818422ff67e1b" + + // See https://docs.wormhole.com/wormhole/blockchain-environments/solana + // This ID is valid for both Solana Devnet and Mainnet + const solanaWormholeChainID = 1 + + const solanaWormholeGateway = await deployments.getOrNull( + "SolanaWormholeGateway" + ) + + let solanaWormholeGatewayAddress = solanaWormholeGateway?.address + if (!solanaWormholeGatewayAddress && hre.network.name === "hardhat") { + solanaWormholeGatewayAddress = fakeSolanaWormholeGateway + log(`fake SolanaWormholeGateway address ${solanaWormholeGatewayAddress}`) + } + + await execute( + "PolygonWormholeGateway", + { from: deployer, log: true, waitConfirmations: 1 }, + "updateGatewayAddress", + solanaWormholeChainID, + solanaWormholeGatewayAddress + ) +} + +export default func + +func.tags = ["SetSolanaGatewayAddress"] +func.dependencies = ["PolygonWormholeGateway", "SolanaWormholeGateway"] diff --git a/cross-chain/polygon/external/mumbai/SolanaWormholeGateway.json b/cross-chain/polygon/external/mumbai/SolanaWormholeGateway.json new file mode 100644 index 000000000..dee25fa3e --- /dev/null +++ b/cross-chain/polygon/external/mumbai/SolanaWormholeGateway.json @@ -0,0 +1,3 @@ +{ + "address": "0x69a22dc2e01ecd2ae40864822d4406ff8aed4e2b8932385dabe818422ff67e1b" +} diff --git a/cross-chain/polygon/external/polygon/SolanaWormholeGateway.json b/cross-chain/polygon/external/polygon/SolanaWormholeGateway.json new file mode 100644 index 000000000..dee25fa3e --- /dev/null +++ b/cross-chain/polygon/external/polygon/SolanaWormholeGateway.json @@ -0,0 +1,3 @@ +{ + "address": "0x69a22dc2e01ecd2ae40864822d4406ff8aed4e2b8932385dabe818422ff67e1b" +}