Skip to content

Commit

Permalink
Merge branch 'main' into support-sepolia
Browse files Browse the repository at this point in the history
  • Loading branch information
lukasz-zimnoch authored Oct 24, 2023
2 parents 2a27c65 + 6f8ae4e commit 6dfd4fa
Show file tree
Hide file tree
Showing 118 changed files with 27,998 additions and 11,457 deletions.
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
8 changes: 4 additions & 4 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 @@ -139,7 +139,7 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.CI_GITHUB_TOKEN }}
with:
module: "github.com/keep-network/tbtc-v2.ts"
module: "github.com/keep-network/typescript"
url: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
environment: ${{ github.event.inputs.environment }}
upstream_builds: ${{ github.event.inputs.upstream_builds }}
Expand All @@ -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"
}
}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
import type { Artifact, HardhatRuntimeEnvironment } from "hardhat/types"
import type { DeployFunction, Deployment } from "hardhat-deploy/types"
import { ContractFactory } from "ethers"

const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
const { ethers, helpers, deployments } = hre

const { deployer } = await helpers.signers.getNamedSigners()

const proxyDeployment: Deployment = await deployments.get(
"ArbitrumWormholeGateway"
)
const implementationContractFactory: ContractFactory =
await ethers.getContractFactory("L2WormholeGateway", {
signer: deployer,
})

// Deploy new implementation contract
const newImplementationAddress: string = (await hre.upgrades.prepareUpgrade(
proxyDeployment,
implementationContractFactory,
{
kind: "transparent",
}
)) as string

deployments.log(
`new implementation contract deployed at: ${newImplementationAddress}`
)

// Assemble proxy upgrade transaction.
const proxyAdmin = await hre.upgrades.admin.getInstance()
const proxyAdminOwner = await proxyAdmin.owner()

const upgradeTxData = await proxyAdmin.interface.encodeFunctionData(
"upgrade",
[proxyDeployment.address, newImplementationAddress]
)

deployments.log(
`proxy admin owner ${proxyAdminOwner} is required to upgrade proxy implementation with transaction:\n` +
`\t\tfrom: ${proxyAdminOwner}\n` +
`\t\tto: ${proxyAdmin.address}\n` +
`\t\tdata: ${upgradeTxData}`
)

// Update Deployment Artifact
const gatewayArtifact: Artifact =
hre.artifacts.readArtifactSync("L2WormholeGateway")

await deployments.save("ArbitrumWormholeGateway", {
...proxyDeployment,
abi: gatewayArtifact.abi,
implementation: newImplementationAddress,
})

// Contracts can be verified on L2 Arbiscan in a similar way as we do it on
// L1 Etherscan
if (hre.network.tags.arbiscan) {
// We use `verify` instead of `verify:verify` as the `verify` task is defined
// in "@openzeppelin/hardhat-upgrades" to verify the proxy’s implementation
// contract, the proxy itself and any proxy-related contracts, as well as
// link the proxy to the implementation contract’s ABI on (Ether)scan.
await hre.run("verify", {
address: newImplementationAddress,
constructorArgsParams: proxyDeployment.args,
})
}
}

export default func

func.tags = ["ManualUpgradeArbitrumWormholeGateway"]

// Comment this line when running an upgrade.
// yarn deploy --tags ManualUpgradeArbitrumWormholeGateway --network <network>
func.skip = async () => true
Original file line number Diff line number Diff line change
Expand Up @@ -172,19 +172,6 @@
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "amount",
"type": "uint256"
}
],
"name": "depositWormholeTbtc",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
Expand Down Expand Up @@ -451,7 +438,7 @@
"status": 1,
"byzantium": true
},
"numDeployments": 2,
"implementation": "0xa10aD2570ea7b93d19fDae6Bd7189fF4929Bc747",
"numDeployments": 3,
"implementation": "0xaaC423eDC4E3ee9ef81517e8093d52737165b71F",
"devdoc": "Contract deployed as upgradable proxy"
}
Loading

0 comments on commit 6dfd4fa

Please sign in to comment.