-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding Solana gateway address for supported x-chains #689
Merged
Merged
Changes from 2 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
f4aae4c
Adding Solana gateway address for supported x-chains
dimpar a736dad
Updating with Solana mainnet address
dimpar d9a4e7c
Adding SolanaWormholeGateway tag dependency for EVMs
dimpar a32fa29
Merge branch 'main' into update-gateways-with-solana
nkuba File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
28 changes: 28 additions & 0 deletions
28
cross-chain/arbitrum/deploy_l2/00_resolve_solana_wormhole_gateway.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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"] |
39 changes: 39 additions & 0 deletions
39
cross-chain/arbitrum/deploy_l2/16_update_with_solana_in_wormhole_gateway_mapping.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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"] | ||
3 changes: 3 additions & 0 deletions
3
cross-chain/arbitrum/external/arbitrumGoerli/SolanaWormholeGateway.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"address": "0x69a22dc2e01ecd2ae40864822d4406ff8aed4e2b8932385dabe818422ff67e1b" | ||
} |
3 changes: 3 additions & 0 deletions
3
cross-chain/arbitrum/external/arbitrumOne/SolanaWormholeGateway.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"address": "0x69a22dc2e01ecd2ae40864822d4406ff8aed4e2b8932385dabe818422ff67e1b" | ||
} |
28 changes: 28 additions & 0 deletions
28
cross-chain/base/deploy_l2/00_resolve_solana_wormhole_gateway.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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"] |
39 changes: 39 additions & 0 deletions
39
cross-chain/base/deploy_l2/16_update_with_solana_in_wormhole_gateway_mapping.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"address": "0x69a22dc2e01ecd2ae40864822d4406ff8aed4e2b8932385dabe818422ff67e1b" | ||
} |
3 changes: 3 additions & 0 deletions
3
cross-chain/base/external/baseGoerli/SolanaWormholeGateway.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"address": "0x69a22dc2e01ecd2ae40864822d4406ff8aed4e2b8932385dabe818422ff67e1b" | ||
} |
28 changes: 28 additions & 0 deletions
28
cross-chain/optimism/deploy_l2/00_resolve_solana_wormhole_gateway.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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"] |
39 changes: 39 additions & 0 deletions
39
cross-chain/optimism/deploy_l2/16_update_with_solana_in_wormhole_gateway_mapping.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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"] |
3 changes: 3 additions & 0 deletions
3
cross-chain/optimism/external/optimism/SolanaWormholeGateway.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"address": "0x69a22dc2e01ecd2ae40864822d4406ff8aed4e2b8932385dabe818422ff67e1b" | ||
} |
3 changes: 3 additions & 0 deletions
3
cross-chain/optimism/external/optimismGoerli/SolanaWormholeGateway.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"address": "0x69a22dc2e01ecd2ae40864822d4406ff8aed4e2b8932385dabe818422ff67e1b" | ||
} |
28 changes: 28 additions & 0 deletions
28
cross-chain/polygon/deploy_sidechain/00_resolve_solana_wormhole_gateway.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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"] |
39 changes: 39 additions & 0 deletions
39
cross-chain/polygon/deploy_sidechain/16_update_with_solana_in_wormhole_gateway_mapping.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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"] |
3 changes: 3 additions & 0 deletions
3
cross-chain/polygon/external/mumbai/SolanaWormholeGateway.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"address": "0x69a22dc2e01ecd2ae40864822d4406ff8aed4e2b8932385dabe818422ff67e1b" | ||
} |
3 changes: 3 additions & 0 deletions
3
cross-chain/polygon/external/polygon/SolanaWormholeGateway.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"address": "0x69a22dc2e01ecd2ae40864822d4406ff8aed4e2b8932385dabe818422ff67e1b" | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we define both contracts to be resolved as dependencies? Can we update it similarly in other scripts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure d9a4e7c