-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/main' into support-sepolia
- Loading branch information
Showing
180 changed files
with
38,125 additions
and
169 deletions.
There are no files selected for viewing
24 changes: 24 additions & 0 deletions
24
cross-chain/arbitrum/deploy_l2/00_resolve_base_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,24 @@ | ||
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 BaseWormholeGateway = await deployments.getOrNull("BaseWormholeGateway") | ||
|
||
if ( | ||
BaseWormholeGateway && | ||
helpers.address.isValid(BaseWormholeGateway.address) | ||
) { | ||
log(`using existing BaseWormholeGateway at ${BaseWormholeGateway.address}`) | ||
} else if (hre.network.name === "hardhat") { | ||
log("using fake BaseWormholeGateway for hardhat network") | ||
} else { | ||
throw new Error("deployed BaseWormholeGateway contract not found") | ||
} | ||
} | ||
|
||
export default func | ||
|
||
func.tags = ["BaseWormholeGateway"] |
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"] |
36 changes: 36 additions & 0 deletions
36
cross-chain/arbitrum/deploy_l2/15_update_with_base_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,36 @@ | ||
import type { HardhatRuntimeEnvironment } from "hardhat/types" | ||
import type { DeployFunction } from "hardhat-deploy/types" | ||
|
||
const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { | ||
const { deployments, getNamedAccounts, ethers } = hre | ||
const { execute, log } = deployments | ||
const { deployer } = await getNamedAccounts() | ||
|
||
// Fake BaseWormholeGateway for local development purposes only. | ||
const fakeBaseWormholeGateway = "0x1af5DC16568EFF2d480a43A77E6C409e497FcFb9" | ||
|
||
// See https://docs.wormhole.com/wormhole/blockchain-environments/evm#base | ||
// This ID is valid for both Base Testnet and Mainnet | ||
const baseWormholeChainID = 30 | ||
|
||
const baseWormholeGateway = await deployments.getOrNull("BaseWormholeGateway") | ||
|
||
let baseWormholeGatewayAddress = baseWormholeGateway?.address | ||
if (!baseWormholeGatewayAddress && hre.network.name === "hardhat") { | ||
baseWormholeGatewayAddress = fakeBaseWormholeGateway | ||
log(`fake BaseWormholeGateway address ${baseWormholeGatewayAddress}`) | ||
} | ||
|
||
await execute( | ||
"ArbitrumWormholeGateway", | ||
{ from: deployer, log: true, waitConfirmations: 1 }, | ||
"updateGatewayAddress", | ||
baseWormholeChainID, | ||
ethers.utils.hexZeroPad(baseWormholeGatewayAddress, 32) | ||
) | ||
} | ||
|
||
export default func | ||
|
||
func.tags = ["SetBaseGatewayAddress"] | ||
func.dependencies = ["BaseWormholeGateway"] |
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", "SolanaWormholeGateway"] |
3 changes: 3 additions & 0 deletions
3
cross-chain/arbitrum/external/arbitrumGoerli/BaseWormholeGateway.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": "0xe3e0511EEbD87F08FbaE4486419cb5dFB06e1343" | ||
} |
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/BaseWormholeGateway.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": "0x09959798B95d00a3183d20FaC298E4594E599eab" | ||
} |
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" | ||
} |
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,8 @@ | ||
artifacts/ | ||
build/ | ||
cache/ | ||
deployments/ | ||
export/ | ||
hardhat-dependency-compiler/ | ||
typechain/ | ||
export.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,18 @@ | ||
{ | ||
"root": true, | ||
"extends": ["@thesis-co"], | ||
"parserOptions": { | ||
"ecmaVersion": 2017, | ||
"sourceType": "module" | ||
}, | ||
"env": { | ||
"es6": true, | ||
"mocha": true | ||
}, | ||
"rules": { | ||
"new-cap": "off", | ||
"import/no-extraneous-dependencies": "off", | ||
"@typescript-eslint/no-use-before-define": "off", | ||
"no-plusplus": ["error", { "allowForLoopAfterthoughts": true }] | ||
} | ||
} |
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,17 @@ | ||
# Hardhat | ||
/artifacts/ | ||
/build/ | ||
/cache/ | ||
/export/ | ||
/external/npm | ||
/typechain/ | ||
/export.json | ||
/deployments/* | ||
!/deployments/mainnet/ | ||
!/deployments/base/ | ||
!/deployments/baseGoerli/ | ||
|
||
# OZ | ||
/.openzeppelin/unknown-*.json | ||
!/.openzeppelin/unknown-84531.json | ||
!/.openzeppelin/unknown-8453.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 @@ | ||
{ | ||
"require": "ts-node/register/files" | ||
} |
Oops, something went wrong.