Skip to content

Commit

Permalink
Merge branch 'main' into update-typescript-ci
Browse files Browse the repository at this point in the history
  • Loading branch information
lukasz-zimnoch authored Oct 24, 2023
2 parents 18d4254 + 585b3a9 commit 8450e71
Show file tree
Hide file tree
Showing 293 changed files with 65,964 additions and 11,464 deletions.
1 change: 1 addition & 0 deletions .github/workflows/cross-chain-arbitrum.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ on:
paths:
- "cross-chain/arbitrum/**"
- ".github/workflows/cross-chain-arbitrum.yml"
pull_request:

jobs:
contracts-detect-changes:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/cross-chain-optimism.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ on:
paths:
- "cross-chain/optimism/**"
- ".github/workflows/cross-chain-optimism.yml"
pull_request:

jobs:
contracts-detect-changes:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/cross-chain-polygon.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ on:
paths:
- "cross-chain/polygon/**"
- ".github/workflows/cross-chain-polygon.yml"
pull_request:

jobs:
contracts-detect-changes:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/npm-typescript.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:

- uses: actions/setup-node@v3
with:
node-version: "14.x"
node-version: "18.x"
registry-url: "https://registry.npmjs.org"
cache: "yarn"
cache-dependency-path: typescript/yarn.lock
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/typescript.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ jobs:

- uses: actions/setup-node@v3
with:
node-version: "14.x"
node-version: "18.x"
cache: "yarn"
cache-dependency-path: typescript/yarn.lock

Expand Down Expand Up @@ -86,7 +86,7 @@ jobs:

- uses: actions/setup-node@v2
with:
node-version: "14.x"
node-version: "18.x"
cache: "yarn"
cache-dependency-path: typescript/yarn.lock
registry-url: "https://registry.npmjs.org"
Expand Down Expand Up @@ -160,7 +160,7 @@ jobs:

- uses: actions/setup-node@v3
with:
node-version: "14.x"
node-version: "18.x"
cache: "yarn"
cache-dependency-path: typescript/yarn.lock

Expand Down
164 changes: 164 additions & 0 deletions cross-chain/arbitrum/.openzeppelin/unknown-42161.json
Original file line number Diff line number Diff line change
Expand Up @@ -617,6 +617,170 @@
}
}
}
},
"4eab818d90a79d503842492e9ce92e35a3b96c1835245a0d54c5b023197ec36a": {
"address": "0xaaC423eDC4E3ee9ef81517e8093d52737165b71F",
"txHash": "0x86dee88c640d1cd36f7e5b6c9535062bc323be6b3f94f72989d713bf373cf9e7",
"layout": {
"solcVersion": "0.8.17",
"storage": [
{
"label": "_initialized",
"offset": 0,
"slot": "0",
"type": "t_uint8",
"contract": "Initializable",
"src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:62",
"retypedFrom": "bool"
},
{
"label": "_initializing",
"offset": 1,
"slot": "0",
"type": "t_bool",
"contract": "Initializable",
"src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:67"
},
{
"label": "__gap",
"offset": 0,
"slot": "1",
"type": "t_array(t_uint256)50_storage",
"contract": "ContextUpgradeable",
"src": "@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol:36"
},
{
"label": "_owner",
"offset": 0,
"slot": "51",
"type": "t_address",
"contract": "OwnableUpgradeable",
"src": "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol:22"
},
{
"label": "__gap",
"offset": 0,
"slot": "52",
"type": "t_array(t_uint256)49_storage",
"contract": "OwnableUpgradeable",
"src": "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol:94"
},
{
"label": "_status",
"offset": 0,
"slot": "101",
"type": "t_uint256",
"contract": "ReentrancyGuardUpgradeable",
"src": "@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol:38"
},
{
"label": "__gap",
"offset": 0,
"slot": "102",
"type": "t_array(t_uint256)49_storage",
"contract": "ReentrancyGuardUpgradeable",
"src": "@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol:80"
},
{
"label": "bridge",
"offset": 0,
"slot": "151",
"type": "t_contract(IWormholeTokenBridge)518",
"contract": "L2WormholeGateway",
"src": "@keep-network/tbtc-v2/contracts/l2/L2WormholeGateway.sol:122"
},
{
"label": "bridgeToken",
"offset": 0,
"slot": "152",
"type": "t_contract(IERC20Upgradeable)2208",
"contract": "L2WormholeGateway",
"src": "@keep-network/tbtc-v2/contracts/l2/L2WormholeGateway.sol:123"
},
{
"label": "tbtc",
"offset": 0,
"slot": "153",
"type": "t_contract(L2TBTC)443",
"contract": "L2WormholeGateway",
"src": "@keep-network/tbtc-v2/contracts/l2/L2WormholeGateway.sol:124"
},
{
"label": "gateways",
"offset": 0,
"slot": "154",
"type": "t_mapping(t_uint16,t_bytes32)",
"contract": "L2WormholeGateway",
"src": "@keep-network/tbtc-v2/contracts/l2/L2WormholeGateway.sol:136"
},
{
"label": "mintingLimit",
"offset": 0,
"slot": "155",
"type": "t_uint256",
"contract": "L2WormholeGateway",
"src": "@keep-network/tbtc-v2/contracts/l2/L2WormholeGateway.sol:147"
},
{
"label": "mintedAmount",
"offset": 0,
"slot": "156",
"type": "t_uint256",
"contract": "L2WormholeGateway",
"src": "@keep-network/tbtc-v2/contracts/l2/L2WormholeGateway.sol:151"
}
],
"types": {
"t_address": {
"label": "address",
"numberOfBytes": "20"
},
"t_array(t_uint256)49_storage": {
"label": "uint256[49]",
"numberOfBytes": "1568"
},
"t_array(t_uint256)50_storage": {
"label": "uint256[50]",
"numberOfBytes": "1600"
},
"t_bool": {
"label": "bool",
"numberOfBytes": "1"
},
"t_bytes32": {
"label": "bytes32",
"numberOfBytes": "32"
},
"t_contract(IERC20Upgradeable)2208": {
"label": "contract IERC20Upgradeable",
"numberOfBytes": "20"
},
"t_contract(IWormholeTokenBridge)518": {
"label": "contract IWormholeTokenBridge",
"numberOfBytes": "20"
},
"t_contract(L2TBTC)443": {
"label": "contract L2TBTC",
"numberOfBytes": "20"
},
"t_mapping(t_uint16,t_bytes32)": {
"label": "mapping(uint16 => bytes32)",
"numberOfBytes": "32"
},
"t_uint16": {
"label": "uint16",
"numberOfBytes": "2"
},
"t_uint256": {
"label": "uint256",
"numberOfBytes": "32"
},
"t_uint8": {
"label": "uint8",
"numberOfBytes": "1"
}
}
}
}
}
}
24 changes: 24 additions & 0 deletions cross-chain/arbitrum/deploy_l2/00_resolve_base_wormhole_gateway.ts
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"]
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"]
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"]
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"]
Loading

0 comments on commit 8450e71

Please sign in to comment.