From c51abbb49c6fa86353d32f2f0d9bb0de70770326 Mon Sep 17 00:00:00 2001 From: Goran Vladika Date: Wed, 18 Oct 2023 15:22:07 +0200 Subject: [PATCH 01/14] Add skeleton for Orbit gov deployment --- package.json | 1 + .../orbitGovernanceDeployer.ts | 97 +++++++++++++++++++ 2 files changed, 98 insertions(+) create mode 100644 scripts/orbit-chain-governance/orbitGovernanceDeployer.ts diff --git a/package.json b/package.json index 1cae0a9c..43ad9fda 100644 --- a/package.json +++ b/package.json @@ -19,6 +19,7 @@ "deploy:note-store": "ts-node ./scripts/deployNoteStore.ts", "deploy:vested-wallets": "ts-node ./scripts/vestedWalletsDeployer.ts", "deploy:dummy-elections": "yarn build:sc-mgmt && ts-node scripts/security-council-mgmt-deployment/deployDummyElectionsContracts.ts", + "deploy:orbit:governance": "ts-node ./scripts/orbit-chain-governance/orbitGovernanceDeployer.ts", "verify:vested-wallets": "ts-node ./scripts/vestedWalletsDeploymentVerifier.ts", "verify:governance": "ts-node ./scripts/governanceDeploymentVerifier.ts", "deploy:sc-mgmt": "yarn build:sc-mgmt && yarn build:gnosis-safe-types && ts-node ./scripts/security-council-mgmt-deployment/main.ts", diff --git a/scripts/orbit-chain-governance/orbitGovernanceDeployer.ts b/scripts/orbit-chain-governance/orbitGovernanceDeployer.ts new file mode 100644 index 00000000..6bb4e2ea --- /dev/null +++ b/scripts/orbit-chain-governance/orbitGovernanceDeployer.ts @@ -0,0 +1,97 @@ +import { Wallet, ethers } from "ethers"; +import { + GovernanceChainGovFactory__factory, + ParentChainGovFactory__factory, + WrappedNativeGovToken__factory, +} from "../../typechain-types"; +import { JsonRpcProvider } from "@ethersproject/providers"; +import { execSync } from "child_process"; + +import dotenv from "dotenv"; +dotenv.config(); + +export const deployGovernance = async () => { + // load env vars + const parentChainRpc = process.env["PARENT_CHAIN_RPC"] as string; + const parentChainDeployKey = process.env["PARENT_CHAIN_DEPLOY_KEY"] as string; + const childChainRpc = process.env["CHILD_CHAIN_RPC"] as string; + const childChainDeployKey = process.env["CHILD_CHAIN_DEPLOY_KEY"] as string; + if (![parentChainRpc, parentChainDeployKey, childChainRpc, childChainDeployKey].every(Boolean)) { + throw new Error( + "Following env vars have to be set: PARENT_CHAIN_RPC, PARENT_CHAIN_DEPLOY_KEY, CHILD_CHAIN_RPC, CHILD_CHAIN_DEPLOY_KEY" + ); + } + + // deploy parent chain governance factory + const parentChainDeployerWallet = new Wallet(parentChainDeployKey).connect( + new JsonRpcProvider(parentChainRpc) + ); + const parentChainFactoryFac = await new ParentChainGovFactory__factory( + parentChainDeployerWallet + ).deploy(); + const parentChainFactory = await parentChainFactoryFac.deployed(); + console.log("ParentChainGovFactory: ", parentChainFactory.address); + + // deploy child chain governance factory + const childChainDeployerWallet = new Wallet(childChainDeployKey).connect( + new JsonRpcProvider(childChainRpc) + ); + const childChainFactoryFac = await new GovernanceChainGovFactory__factory( + childChainDeployerWallet + ).deploy(); + const childChainFactory = await childChainFactoryFac.deployed(); + console.log("GovernanceChainGov: ", childChainFactory.address); + + // deploy governance token + const governanceTokenFac = await new WrappedNativeGovToken__factory( + childChainDeployerWallet + ).deploy(); + const governanceToken = await governanceTokenFac.deployed(); + + // get deployment data + const rollupData = await getDeploymentData(); + + /// step1 + await ( + await childChainFactory.deployStep1({ + _governanceToken: governanceToken.address, + _govChainUpExec: governanceToken.address, // TODO set proper address + _govChainProxyAdmin: governanceToken.address, // TODO set proper address + _proposalThreshold: 100, + _votingPeriod: 10, + _votingDelay: 10, + _minTimelockDelay: 7, + _minPeriodAfterQuorum: 1, + _coreQuorumThreshold: 500, + }) + ).wait(); +}; + +async function getDeploymentData() { + let sequencerContainer = execSync('docker ps --filter "name=l3node" --format "{{.Names}}"') + .toString() + .trim(); + + const deploymentData = execSync( + `docker exec ${sequencerContainer} cat /config/l3deployment.json` + ).toString(); + + const parsedDeploymentData = JSON.parse(deploymentData) as { + bridge: string; + inbox: string; + ["sequencer-inbox"]: string; + rollup: string; + ["native-token"]: string; + ["upgrade-executor"]: string; + }; + + return parsedDeploymentData; +} + +async function main() { + console.log("Start governance deployment process..."); + await deployGovernance(); + console.log("Deployment finished!"); +} + +main().then(() => console.log("Done.")); From fd338c85a85e98cb7f2de71cd903470cb25f5a74 Mon Sep 17 00:00:00 2001 From: Goran Vladika Date: Sat, 21 Oct 2023 08:39:26 +0200 Subject: [PATCH 02/14] Fetch rollup data and do step1 --- .../orbitGovernanceDeployer.ts | 171 +++++++++++++++++- 1 file changed, 163 insertions(+), 8 deletions(-) diff --git a/scripts/orbit-chain-governance/orbitGovernanceDeployer.ts b/scripts/orbit-chain-governance/orbitGovernanceDeployer.ts index 6bb4e2ea..9305c733 100644 --- a/scripts/orbit-chain-governance/orbitGovernanceDeployer.ts +++ b/scripts/orbit-chain-governance/orbitGovernanceDeployer.ts @@ -1,13 +1,19 @@ import { Wallet, ethers } from "ethers"; import { GovernanceChainGovFactory__factory, + IBridge__factory, + IInbox__factory, + IRollupCore__factory, + IRollupGetter__factory, ParentChainGovFactory__factory, WrappedNativeGovToken__factory, } from "../../typechain-types"; -import { JsonRpcProvider } from "@ethersproject/providers"; +import { Filter, JsonRpcProvider, Provider } from "@ethersproject/providers"; import { execSync } from "child_process"; import dotenv from "dotenv"; +import { Interface } from "@ethersproject/abi"; +import { RollupCore__factory } from "@arbitrum/sdk/dist/lib/abi/factories/RollupCore__factory"; dotenv.config(); export const deployGovernance = async () => { @@ -49,14 +55,16 @@ export const deployGovernance = async () => { const governanceToken = await governanceTokenFac.deployed(); // get deployment data - const rollupData = await getDeploymentData(); + const rollupData = await getDeploymentData(parentChainDeployerWallet.provider!); + + console.log(rollupData); /// step1 await ( await childChainFactory.deployStep1({ _governanceToken: governanceToken.address, - _govChainUpExec: governanceToken.address, // TODO set proper address - _govChainProxyAdmin: governanceToken.address, // TODO set proper address + _govChainUpExec: rollupData.childChainUpgradeExecutor, + _govChainProxyAdmin: rollupData.childChainUpgradeExecutor, _proposalThreshold: 100, _votingPeriod: 10, _votingDelay: 10, @@ -67,15 +75,14 @@ export const deployGovernance = async () => { ).wait(); }; -async function getDeploymentData() { +async function getDeploymentData(parentChainProvider: Provider) { + /// get rollup data from config file let sequencerContainer = execSync('docker ps --filter "name=l3node" --format "{{.Names}}"') .toString() .trim(); - const deploymentData = execSync( `docker exec ${sequencerContainer} cat /config/l3deployment.json` ).toString(); - const parsedDeploymentData = JSON.parse(deploymentData) as { bridge: string; inbox: string; @@ -85,9 +92,157 @@ async function getDeploymentData() { ["upgrade-executor"]: string; }; - return parsedDeploymentData; + //// get parent chain deployment data + const filter: Filter = { + topics: [ + ethers.utils.id( + "OrbitTokenBridgeCreated(address,address,address,address,address,address,address,address)" + ), + ethers.utils.hexZeroPad(parsedDeploymentData.inbox, 32), + ], + }; + const logs = await parentChainProvider.getLogs({ + ...filter, + fromBlock: 0, + toBlock: "latest", + }); + if (logs.length === 0) { + throw new Error("Couldn't find any OrbitTokenBridgeCreated events in block range[0,latest]"); + } + const eventIface = new Interface(eventABI); + const parentChainDeploymentData = eventIface.parseLog(logs[0]); + + ///// get child chain deployment data + const rollup = await IBridge__factory.connect( + await IInbox__factory.connect(parsedDeploymentData.inbox, parentChainProvider).bridge(), + parentChainProvider + ).rollup(); + const chainId = await RollupCore__factory.connect(rollup, parentChainProvider).chainId(); + + const tokenBridgeCreatorAddress = logs[0].address; + const tokenBridgeCreator = new ethers.Contract( + tokenBridgeCreatorAddress, + tokenBridgeCreatorABI, + parentChainProvider + ); + const childChainUpgradeExecutor = await tokenBridgeCreator.getCanonicalL2UpgradeExecutorAddress( + chainId + ); + const childChainProxyAdmin = await tokenBridgeCreator.getCanonicalL2ProxyAdminAddress(chainId); + + let data = { + ...parsedDeploymentData, + parentChainRouter: parentChainDeploymentData.args.router, + parentChainStandardGateway: parentChainDeploymentData.args.standardGateway, + parentChainCustomGateway: parentChainDeploymentData.args.customGateway, + childChainUpgradeExecutor: childChainUpgradeExecutor, + childChainProxyAdmin: childChainProxyAdmin, + }; + + return data; } +//// OrbitTokenBridgeCreated event ABI +const eventABI = [ + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "inbox", + type: "address", + }, + { + indexed: true, + internalType: "address", + name: "owner", + type: "address", + }, + { + indexed: false, + internalType: "address", + name: "router", + type: "address", + }, + { + indexed: false, + internalType: "address", + name: "standardGateway", + type: "address", + }, + { + indexed: false, + internalType: "address", + name: "customGateway", + type: "address", + }, + { + indexed: false, + internalType: "address", + name: "wethGateway", + type: "address", + }, + { + indexed: false, + internalType: "address", + name: "proxyAdmin", + type: "address", + }, + { + indexed: false, + internalType: "address", + name: "upgradeExecutor", + type: "address", + }, + ], + name: "OrbitTokenBridgeCreated", + type: "event", + }, +]; + +//// subset of token bridge creator ABI +const tokenBridgeCreatorABI = [ + { + inputs: [ + { + internalType: "uint256", + name: "chainId", + type: "uint256", + }, + ], + name: "getCanonicalL2UpgradeExecutorAddress", + outputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "chainId", + type: "uint256", + }, + ], + name: "getCanonicalL2ProxyAdminAddress", + outputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, +]; + async function main() { console.log("Start governance deployment process..."); await deployGovernance(); From daf2f85baebca59ebd06632c56499848d4257a45 Mon Sep 17 00:00:00 2001 From: Goran Vladika Date: Sat, 21 Oct 2023 08:56:31 +0200 Subject: [PATCH 03/14] Perform step2 of gov deployment --- .../orbitGovernanceDeployer.ts | 38 +++++++++++++++++-- 1 file changed, 35 insertions(+), 3 deletions(-) diff --git a/scripts/orbit-chain-governance/orbitGovernanceDeployer.ts b/scripts/orbit-chain-governance/orbitGovernanceDeployer.ts index 9305c733..da11fe73 100644 --- a/scripts/orbit-chain-governance/orbitGovernanceDeployer.ts +++ b/scripts/orbit-chain-governance/orbitGovernanceDeployer.ts @@ -57,10 +57,8 @@ export const deployGovernance = async () => { // get deployment data const rollupData = await getDeploymentData(parentChainDeployerWallet.provider!); - console.log(rollupData); - /// step1 - await ( + const deploymentReceipt = await ( await childChainFactory.deployStep1({ _governanceToken: governanceToken.address, _govChainUpExec: rollupData.childChainUpgradeExecutor, @@ -73,6 +71,26 @@ export const deployGovernance = async () => { _coreQuorumThreshold: 500, }) ).wait(); + console.log("Step1 finished"); + + //// step 2 + const _parentChainUpExec = rollupData["upgrade-executor"]; + const _parentChainProxyAdmin = rollupData.parentChainProxyAdmin; + const _inbox = rollupData.inbox; + const { coreTimelock: _childChainCoreTimelock, coreGoverner: _childChainCoreGov } = + _getParsedLogs(deploymentReceipt.logs, childChainFactory.interface, "Deployed")[0].args; + const _minTimelockDelay = 7; + + await ( + await parentChainFactory.deployStep2( + _parentChainUpExec, + _parentChainProxyAdmin, + _inbox, + _childChainCoreTimelock, + _minTimelockDelay + ) + ).wait(); + console.log("Step2 finished"); }; async function getDeploymentData(parentChainProvider: Provider) { @@ -132,6 +150,8 @@ async function getDeploymentData(parentChainProvider: Provider) { let data = { ...parsedDeploymentData, + parentChainInbox: parsedDeploymentData.inbox, + parentChainProxyAdmin: parentChainDeploymentData.args.proxyAdmin, parentChainRouter: parentChainDeploymentData.args.router, parentChainStandardGateway: parentChainDeploymentData.args.standardGateway, parentChainCustomGateway: parentChainDeploymentData.args.customGateway, @@ -142,6 +162,18 @@ async function getDeploymentData(parentChainProvider: Provider) { return data; } +export const _getParsedLogs = ( + logs: ethers.providers.Log[], + iface: ethers.utils.Interface, + eventName: string +) => { + const eventFragment = iface.getEvent(eventName); + const parsedLogs = logs + .filter((curr: any) => curr.topics[0] === iface.getEventTopic(eventFragment)) + .map((curr: any) => iface.parseLog(curr)); + return parsedLogs; +}; + //// OrbitTokenBridgeCreated event ABI const eventABI = [ { From 97d177a991bba3d262c7d90cb86e1a3523591c4a Mon Sep 17 00:00:00 2001 From: Goran Vladika Date: Sat, 21 Oct 2023 08:57:05 +0200 Subject: [PATCH 04/14] Remove unused imports --- scripts/orbit-chain-governance/orbitGovernanceDeployer.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/scripts/orbit-chain-governance/orbitGovernanceDeployer.ts b/scripts/orbit-chain-governance/orbitGovernanceDeployer.ts index da11fe73..57e9a78c 100644 --- a/scripts/orbit-chain-governance/orbitGovernanceDeployer.ts +++ b/scripts/orbit-chain-governance/orbitGovernanceDeployer.ts @@ -3,8 +3,6 @@ import { GovernanceChainGovFactory__factory, IBridge__factory, IInbox__factory, - IRollupCore__factory, - IRollupGetter__factory, ParentChainGovFactory__factory, WrappedNativeGovToken__factory, } from "../../typechain-types"; From 8305f7f77b09029a6e32a89426b37043a284b6bc Mon Sep 17 00:00:00 2001 From: Goran Vladika Date: Fri, 8 Mar 2024 16:00:12 +0100 Subject: [PATCH 05/14] Bump token bridge contracts --- package.json | 2 +- token-bridge-contracts | 2 +- yarn.lock | 508 +++++++++++++++++++++++++++++++++++++---- 3 files changed, 468 insertions(+), 44 deletions(-) diff --git a/package.json b/package.json index 43ad9fda..a7afc3e5 100644 --- a/package.json +++ b/package.json @@ -75,7 +75,7 @@ }, "dependencies": { "@arbitrum/nitro-contracts": "1.0.1", - "@arbitrum/token-bridge-contracts": "1.0.0-beta.0", + "@arbitrum/token-bridge-contracts": "1.2.1", "@gnosis.pm/safe-contracts": "1.3.0", "@openzeppelin/contracts": "4.7.3", "@openzeppelin/contracts-upgradeable": "4.7.3", diff --git a/token-bridge-contracts b/token-bridge-contracts index 5cd15667..747d6a8b 160000 --- a/token-bridge-contracts +++ b/token-bridge-contracts @@ -1 +1 @@ -Subproject commit 5cd156677faa2ee4aa2185dee89d072a6c5fd4a7 +Subproject commit 747d6a8b6606a0ef2cbc0fb740a813353fec257d diff --git a/yarn.lock b/yarn.lock index 874201ff..be745d91 100644 --- a/yarn.lock +++ b/yarn.lock @@ -19,14 +19,15 @@ optionalDependencies: sol2uml "2.2.0" -"@arbitrum/nitro-contracts@^1.0.0-beta.8": - version "1.0.0-beta.8" - resolved "https://registry.npmjs.org/@arbitrum/nitro-contracts/-/nitro-contracts-1.0.0-beta.8.tgz" - integrity sha512-idzrJ/yGbcVUaqm45kFzV157B7V8W05G0cyMZazNhkWs39zO/moVwjMUCJpQ/SGW4OlOQggI8Xuw4xfocno7Xg== +"@arbitrum/nitro-contracts@1.1.1": + version "1.1.1" + resolved "https://registry.yarnpkg.com/@arbitrum/nitro-contracts/-/nitro-contracts-1.1.1.tgz#2d8a2f9ab757bb7654562aebe435bff833c4b98d" + integrity sha512-4Tyk3XVHz+bm8UujUC78LYSw3xAxyYvBCxfEX4z3qE4/ww7Qck/rmce5gbHMzQjArEAzAP2YSfYIFuIFuRXtfg== dependencies: + "@offchainlabs/upgrade-executor" "1.1.0-beta.0" "@openzeppelin/contracts" "4.5.0" "@openzeppelin/contracts-upgradeable" "4.5.2" - hardhat "^2.6.6" + patch-package "^6.4.7" "@arbitrum/sdk@^3.1.11": version "3.1.11" @@ -38,16 +39,17 @@ "@ethersproject/bytes" "^5.0.8" ethers "^5.1.0" -"@arbitrum/token-bridge-contracts@1.0.0-beta.0": - version "1.0.0-beta.0" - resolved "https://registry.npmjs.org/@arbitrum/token-bridge-contracts/-/token-bridge-contracts-1.0.0-beta.0.tgz" - integrity sha512-70V42hrH+2OU/RIxWngM5Zgj9DgD655N085kJo9EFCXxHSh4r2+9JzsBdFuwz0D+5OGqBS33Jw5x60OGVGzBPQ== +"@arbitrum/token-bridge-contracts@1.2.1": + version "1.2.1" + resolved "https://registry.yarnpkg.com/@arbitrum/token-bridge-contracts/-/token-bridge-contracts-1.2.1.tgz#4838d70182bc0d6b36adfd733d7b4650e596c979" + integrity sha512-ngKeay/0O91QyVLCbcd2pyJIWtzKi2KsPm+O9q3xCfPkjuCZ0+MK5OdhYKCbvGc0jf39R7izRsvmUHE0qA603A== dependencies: - "@arbitrum/nitro-contracts" "^1.0.0-beta.8" - "@openzeppelin/contracts" "3.4.2" - "@openzeppelin/contracts-upgradeable" "3.4.2" + "@arbitrum/nitro-contracts" "1.1.1" + "@offchainlabs/upgrade-executor" "1.1.0-beta.0" + "@openzeppelin/contracts" "4.8.3" + "@openzeppelin/contracts-upgradeable" "4.8.3" optionalDependencies: - "@openzeppelin/upgrades-core" "^1.7.6" + "@openzeppelin/upgrades-core" "^1.24.1" "@chainsafe/as-sha256@^0.3.1": version "0.3.1" @@ -938,10 +940,13 @@ table "^6.8.0" undici "^5.4.0" -"@openzeppelin/contracts-upgradeable@3.4.2": - version "3.4.2" - resolved "https://registry.npmjs.org/@openzeppelin/contracts-upgradeable/-/contracts-upgradeable-3.4.2.tgz" - integrity sha512-mDlBS17ymb2wpaLcrqRYdnBAmP1EwqhOXMvqWk2c5Q1N1pm5TkiCtXM9Xzznh4bYsQBq0aIWEkFFE2+iLSN1Tw== +"@offchainlabs/upgrade-executor@1.1.0-beta.0": + version "1.1.0-beta.0" + resolved "https://registry.yarnpkg.com/@offchainlabs/upgrade-executor/-/upgrade-executor-1.1.0-beta.0.tgz#c4b1375176546a18aaef01a43956abfb58250e0a" + integrity sha512-mpn6PHjH/KDDjNX0pXHEKdyv8m6DVGQiI2nGzQn0JbM1nOSHJpWx6fvfjtH7YxHJ6zBZTcsKkqGkFKDtCfoSLw== + dependencies: + "@openzeppelin/contracts" "4.7.3" + "@openzeppelin/contracts-upgradeable" "4.7.3" "@openzeppelin/contracts-upgradeable@4.5.2": version "4.5.2" @@ -953,10 +958,10 @@ resolved "https://registry.npmjs.org/@openzeppelin/contracts-upgradeable/-/contracts-upgradeable-4.7.3.tgz" integrity sha512-+wuegAMaLcZnLCJIvrVUDzA9z/Wp93f0Dla/4jJvIhijRrPabjQbZe6fWiECLaJyfn5ci9fqf9vTw3xpQOad2A== -"@openzeppelin/contracts@3.4.2": - version "3.4.2" - resolved "https://registry.npmjs.org/@openzeppelin/contracts/-/contracts-3.4.2.tgz" - integrity sha512-z0zMCjyhhp4y7XKAcDAi3Vgms4T2PstwBdahiO0+9NaGICQKjynK3wduSRplTgk4LXmoO1yfDGO5RbjKYxtuxA== +"@openzeppelin/contracts-upgradeable@4.8.3": + version "4.8.3" + resolved "https://registry.yarnpkg.com/@openzeppelin/contracts-upgradeable/-/contracts-upgradeable-4.8.3.tgz#6b076a7b751811b90fe3a172a7faeaa603e13a3f" + integrity sha512-SXDRl7HKpl2WDoJpn7CK/M9U4Z8gNXDHHChAKh0Iz+Wew3wu6CmFYBeie3je8V0GSXZAIYYwUktSrnW/kwVPtg== "@openzeppelin/contracts@4.5.0": version "4.5.0" @@ -968,18 +973,24 @@ resolved "https://registry.npmjs.org/@openzeppelin/contracts/-/contracts-4.7.3.tgz" integrity sha512-dGRS0agJzu8ybo44pCIf3xBaPQN/65AIXNgK8+4gzKd5kbvlqyxryUYVLJv7fK98Seyd2hDZzVEHSWAh0Bt1Yw== -"@openzeppelin/upgrades-core@^1.7.6": - version "1.20.2" - resolved "https://registry.npmjs.org/@openzeppelin/upgrades-core/-/upgrades-core-1.20.2.tgz" - integrity sha512-7PnC12zoDBwdMVdVNt+iLr+pvuRMQXkmiqARDEDsj+z3RWjmMtX0QGjVXKT8H0aFe1WQBcMFCNjQ+Ue8zP8ZCA== +"@openzeppelin/contracts@4.8.3": + version "4.8.3" + resolved "https://registry.yarnpkg.com/@openzeppelin/contracts/-/contracts-4.8.3.tgz#cbef3146bfc570849405f59cba18235da95a252a" + integrity sha512-bQHV8R9Me8IaJoJ2vPG4rXcL7seB7YVuskr4f+f5RyOStSZetwzkWtoqDMl5erkBJy0lDRUnIR2WIkPiC0GJlg== + +"@openzeppelin/upgrades-core@^1.24.1": + version "1.32.5" + resolved "https://registry.yarnpkg.com/@openzeppelin/upgrades-core/-/upgrades-core-1.32.5.tgz#2496174fd1f47be4dd8f36b29714d4e1f8240632" + integrity sha512-R0wprsyJ4xWiRW05kaTfZZkRVpG2g0af3/hpjE7t2mX0Eb2n40MQLokTwqIk4LDzpp910JfLSpB0vBuZ6WNPog== dependencies: - cbor "^8.0.0" + cbor "^9.0.0" chalk "^4.1.0" - compare-versions "^5.0.0" + compare-versions "^6.0.0" debug "^4.1.1" ethereumjs-util "^7.0.3" + minimist "^1.2.7" proper-lockfile "^4.1.1" - solidity-ast "^0.4.15" + solidity-ast "^0.4.51" "@safe-global/protocol-kit@^1.2.0": version "1.2.0" @@ -1569,6 +1580,14 @@ array-back@^4.0.1, array-back@^4.0.2: resolved "https://registry.npmjs.org/array-back/-/array-back-4.0.2.tgz" integrity sha512-NbdMezxqf94cnNfWLL7V/im0Ub+Anbb0IoZhvzie8+4HJ4nMQuzHuy49FkGYCJK2yAloZ3meiB6AVMClbrI1vg== +array-buffer-byte-length@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/array-buffer-byte-length/-/array-buffer-byte-length-1.0.1.tgz#1e5583ec16763540a27ae52eed99ff899223568f" + integrity sha512-ahC5W1xgou+KTXix4sAO8Ki12Q+jf4i0+tmk3sC+zgcynshkHxzpXdImBehiUYKKKDwvfFiJl1tZt6ewscS1Mg== + dependencies: + call-bind "^1.0.5" + is-array-buffer "^3.0.4" + array-flatten@1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/array-flatten/-/array-flatten-1.1.1.tgz#9a5f699051b1e7073328f2a008968b64ea2955d2" @@ -1584,6 +1603,17 @@ array-uniq@1.0.3: resolved "https://registry.npmjs.org/array-uniq/-/array-uniq-1.0.3.tgz" integrity sha512-MNha4BWQ6JbwhFhj03YK552f7cb3AzoE8SzeljgChvL1dl3IcvggXVz1DilzySZkCja+CXuZbdW7yATchWn8/Q== +array.prototype.findlast@^1.2.2: + version "1.2.4" + resolved "https://registry.yarnpkg.com/array.prototype.findlast/-/array.prototype.findlast-1.2.4.tgz#eeb9e45fc894055c82e5675c463e8077b827ad36" + integrity sha512-BMtLxpV+8BD+6ZPFIWmnUBpQoy+A+ujcg4rhp2iwCRJYA7PEh2MS4NL3lz8EiDlLrJPp2hg9qWihr5pd//jcGw== + dependencies: + call-bind "^1.0.5" + define-properties "^1.2.1" + es-abstract "^1.22.3" + es-errors "^1.3.0" + es-shim-unscopables "^1.0.2" + array.prototype.reduce@^1.0.4: version "1.0.4" resolved "https://registry.npmjs.org/array.prototype.reduce/-/array.prototype.reduce-1.0.4.tgz" @@ -1595,6 +1625,20 @@ array.prototype.reduce@^1.0.4: es-array-method-boxes-properly "^1.0.0" is-string "^1.0.7" +arraybuffer.prototype.slice@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/arraybuffer.prototype.slice/-/arraybuffer.prototype.slice-1.0.3.tgz#097972f4255e41bc3425e37dc3f6421cf9aefde6" + integrity sha512-bMxMKAjg13EBSVscxTaYA4mRc5t1UAXa2kXiGTNfZ079HIWXEkKmkgFrh/nJqamaLSrXO5H4WFFkPEaLJWbs3A== + dependencies: + array-buffer-byte-length "^1.0.1" + call-bind "^1.0.5" + define-properties "^1.2.1" + es-abstract "^1.22.3" + es-errors "^1.2.1" + get-intrinsic "^1.2.3" + is-array-buffer "^3.0.4" + is-shared-array-buffer "^1.0.2" + asap@~2.0.6: version "2.0.6" resolved "https://registry.npmjs.org/asap/-/asap-2.0.6.tgz" @@ -1675,6 +1719,13 @@ available-typed-arrays@^1.0.5: resolved "https://registry.yarnpkg.com/available-typed-arrays/-/available-typed-arrays-1.0.5.tgz#92f95616501069d07d10edb2fc37d3e1c65123b7" integrity sha512-DMD0KiN46eipeziST1LPP/STfDU0sufISXmjSgvVsoU2tqxctQeASejWcfNtxYKqETM1UxQ8sp2OrSBWpHY6sw== +available-typed-arrays@^1.0.6, available-typed-arrays@^1.0.7: + version "1.0.7" + resolved "https://registry.yarnpkg.com/available-typed-arrays/-/available-typed-arrays-1.0.7.tgz#a5cc375d6a03c2efc87a553f3e0b1522def14846" + integrity sha512-wvUjBtSGN7+7SjNpq/9M2Tg350UZD3q62IFZLbRAR1bSMlCo1ZaeW+BJ+D090e4hIIZLBcTDWe4Mh4jvUDajzQ== + dependencies: + possible-typed-array-names "^1.0.0" + aws-sign2@~0.7.0: version "0.7.0" resolved "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz" @@ -1987,6 +2038,17 @@ call-bind@^1.0.0, call-bind@^1.0.2: function-bind "^1.1.1" get-intrinsic "^1.0.2" +call-bind@^1.0.5, call-bind@^1.0.6, call-bind@^1.0.7: + version "1.0.7" + resolved "https://registry.yarnpkg.com/call-bind/-/call-bind-1.0.7.tgz#06016599c40c56498c18769d2730be242b6fa3b9" + integrity sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w== + dependencies: + es-define-property "^1.0.0" + es-errors "^1.3.0" + function-bind "^1.1.2" + get-intrinsic "^1.2.4" + set-function-length "^1.2.1" + camelcase@^5.0.0: version "5.3.1" resolved "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz" @@ -2020,10 +2082,10 @@ cbor@^5.0.2: bignumber.js "^9.0.1" nofilter "^1.0.4" -cbor@^8.0.0: - version "8.1.0" - resolved "https://registry.npmjs.org/cbor/-/cbor-8.1.0.tgz" - integrity sha512-DwGjNW9omn6EwP70aXsn7FQJx5kO12tX0bZkaTjzdVFM6/7nhA4t0EENocKGx6D2Bch9PE2KzCUf5SceBdeijg== +cbor@^9.0.0: + version "9.0.2" + resolved "https://registry.yarnpkg.com/cbor/-/cbor-9.0.2.tgz#536b4f2d544411e70ec2b19a2453f10f83cd9fdb" + integrity sha512-JPypkxsB10s9QOWwa6zwPzqE1Md3vqpPc+cai4sAecuCsRyAtAl/pMyhPlMbT/xtPnm2dznJZYRLui57qiRhaQ== dependencies: nofilter "^3.1.0" @@ -2294,10 +2356,10 @@ commander@^9.2.0, commander@^9.4.0: resolved "https://registry.npmjs.org/commander/-/commander-9.5.0.tgz" integrity sha512-KRs7WVDKg86PWiuAqhDrAQnTXZKraVcCc6vFdL14qrZ/DcWwuRo7VoiYXalXO7S5GKpqYiVEwCbgFDfxNHKJBQ== -compare-versions@^5.0.0: - version "5.0.1" - resolved "https://registry.npmjs.org/compare-versions/-/compare-versions-5.0.1.tgz" - integrity sha512-v8Au3l0b+Nwkp4G142JcgJFh1/TUhdxut7wzD1Nq1dyp5oa3tXaqb03EXOAB6jS4gMlalkjAUPZBMiAfKUixHQ== +compare-versions@^6.0.0: + version "6.1.0" + resolved "https://registry.yarnpkg.com/compare-versions/-/compare-versions-6.1.0.tgz#3f2131e3ae93577df111dba133e6db876ffe127a" + integrity sha512-LNZQXhqUvqUTotpZ00qLSaify3b4VFD588aRr8MKFw4CMUr98ytzCW5wDH5qx/DEY5kCDXcbcRuCqL0szEf2tg== concat-map@0.0.1: version "0.0.1" @@ -2591,6 +2653,15 @@ defer-to-connect@^2.0.0, defer-to-connect@^2.0.1: resolved "https://registry.yarnpkg.com/defer-to-connect/-/defer-to-connect-2.0.1.tgz#8016bdb4143e4632b77a3449c6236277de520587" integrity sha512-4tvttepXG1VaYGrRibk5EwJd1t4udunSOVMdLSAL6mId1ix438oPwPZMALY41FCijukO1L0twNcGsdzS7dHgDg== +define-data-property@^1.0.1, define-data-property@^1.1.2, define-data-property@^1.1.4: + version "1.1.4" + resolved "https://registry.yarnpkg.com/define-data-property/-/define-data-property-1.1.4.tgz#894dc141bb7d3060ae4366f6a0107e68fbe48c5e" + integrity sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A== + dependencies: + es-define-property "^1.0.0" + es-errors "^1.3.0" + gopd "^1.0.1" + define-properties@^1.1.2, define-properties@^1.1.3, define-properties@^1.1.4: version "1.1.4" resolved "https://registry.npmjs.org/define-properties/-/define-properties-1.1.4.tgz" @@ -2599,6 +2670,15 @@ define-properties@^1.1.2, define-properties@^1.1.3, define-properties@^1.1.4: has-property-descriptors "^1.0.0" object-keys "^1.1.1" +define-properties@^1.2.0, define-properties@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/define-properties/-/define-properties-1.2.1.tgz#10781cc616eb951a80a034bafcaa7377f6af2b6c" + integrity sha512-8QmQKqEASLd5nx0U1B1okLElbUuuttJ/AnYmRXbbbGDWh6uS208EjD4Xqq/I9wK7u0v6O08XhTWnt5XtEbR6Dg== + dependencies: + define-data-property "^1.0.1" + has-property-descriptors "^1.0.0" + object-keys "^1.1.1" + delayed-stream@~1.0.0: version "1.0.0" resolved "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz" @@ -2796,11 +2876,86 @@ es-abstract@^1.19.0, es-abstract@^1.19.2, es-abstract@^1.19.5, es-abstract@^1.20 string.prototype.trimstart "^1.0.5" unbox-primitive "^1.0.2" +es-abstract@^1.22.1, es-abstract@^1.22.3: + version "1.22.5" + resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.22.5.tgz#1417df4e97cc55f09bf7e58d1e614bc61cb8df46" + integrity sha512-oW69R+4q2wG+Hc3KZePPZxOiisRIqfKBVo/HLx94QcJeWGU/8sZhCvc829rd1kS366vlJbzBfXf9yWwf0+Ko7w== + dependencies: + array-buffer-byte-length "^1.0.1" + arraybuffer.prototype.slice "^1.0.3" + available-typed-arrays "^1.0.7" + call-bind "^1.0.7" + es-define-property "^1.0.0" + es-errors "^1.3.0" + es-set-tostringtag "^2.0.3" + es-to-primitive "^1.2.1" + function.prototype.name "^1.1.6" + get-intrinsic "^1.2.4" + get-symbol-description "^1.0.2" + globalthis "^1.0.3" + gopd "^1.0.1" + has-property-descriptors "^1.0.2" + has-proto "^1.0.3" + has-symbols "^1.0.3" + hasown "^2.0.1" + internal-slot "^1.0.7" + is-array-buffer "^3.0.4" + is-callable "^1.2.7" + is-negative-zero "^2.0.3" + is-regex "^1.1.4" + is-shared-array-buffer "^1.0.3" + is-string "^1.0.7" + is-typed-array "^1.1.13" + is-weakref "^1.0.2" + object-inspect "^1.13.1" + object-keys "^1.1.1" + object.assign "^4.1.5" + regexp.prototype.flags "^1.5.2" + safe-array-concat "^1.1.0" + safe-regex-test "^1.0.3" + string.prototype.trim "^1.2.8" + string.prototype.trimend "^1.0.7" + string.prototype.trimstart "^1.0.7" + typed-array-buffer "^1.0.2" + typed-array-byte-length "^1.0.1" + typed-array-byte-offset "^1.0.2" + typed-array-length "^1.0.5" + unbox-primitive "^1.0.2" + which-typed-array "^1.1.14" + es-array-method-boxes-properly@^1.0.0: version "1.0.0" resolved "https://registry.npmjs.org/es-array-method-boxes-properly/-/es-array-method-boxes-properly-1.0.0.tgz" integrity sha512-wd6JXUmyHmt8T5a2xreUwKcGPq6f1f+WwIJkijUqiGcJz1qqnZgP6XIK+QyIWU5lT7imeNxUll48bziG+TSYcA== +es-define-property@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/es-define-property/-/es-define-property-1.0.0.tgz#c7faefbdff8b2696cf5f46921edfb77cc4ba3845" + integrity sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ== + dependencies: + get-intrinsic "^1.2.4" + +es-errors@^1.2.1, es-errors@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/es-errors/-/es-errors-1.3.0.tgz#05f75a25dab98e4fb1dcd5e1472c0546d5057c8f" + integrity sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw== + +es-set-tostringtag@^2.0.3: + version "2.0.3" + resolved "https://registry.yarnpkg.com/es-set-tostringtag/-/es-set-tostringtag-2.0.3.tgz#8bb60f0a440c2e4281962428438d58545af39777" + integrity sha512-3T8uNMC3OQTHkFUsFq8r/BwAXLHvU/9O9mE0fBc/MY5iq/8H7ncvO947LmYA6ldWw9Uh8Yhf25zu6n7nML5QWQ== + dependencies: + get-intrinsic "^1.2.4" + has-tostringtag "^1.0.2" + hasown "^2.0.1" + +es-shim-unscopables@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/es-shim-unscopables/-/es-shim-unscopables-1.0.2.tgz#1f6942e71ecc7835ed1c8a83006d8771a63a3763" + integrity sha512-J3yBRXCzDu4ULnQwxyToo/OjdMx6akgVC7K6few0a7F/0wLtmKKN7I73AH5T2836UuXRqN7Qg+IIUw/+YJksRw== + dependencies: + hasown "^2.0.0" + es-to-primitive@^1.2.1: version "1.2.1" resolved "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz" @@ -3481,6 +3636,11 @@ function-bind@^1.1.1: resolved "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz" integrity sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A== +function-bind@^1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.2.tgz#2c02d864d97f3ea6c8830c464cbd11ab6eab7a1c" + integrity sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA== + function.prototype.name@^1.1.5: version "1.1.5" resolved "https://registry.npmjs.org/function.prototype.name/-/function.prototype.name-1.1.5.tgz" @@ -3491,14 +3651,24 @@ function.prototype.name@^1.1.5: es-abstract "^1.19.0" functions-have-names "^1.2.2" +function.prototype.name@^1.1.6: + version "1.1.6" + resolved "https://registry.yarnpkg.com/function.prototype.name/-/function.prototype.name-1.1.6.tgz#cdf315b7d90ee77a4c6ee216c3c3362da07533fd" + integrity sha512-Z5kx79swU5P27WEayXM1tBi5Ze/lbIyiNgU3qyXUOf9b2rgXYyF9Dy9Cx+IQv/Lc8WCG6L82zwUPpSS9hGehIg== + dependencies: + call-bind "^1.0.2" + define-properties "^1.2.0" + es-abstract "^1.22.1" + functions-have-names "^1.2.3" + functional-red-black-tree@^1.0.1: version "1.0.1" resolved "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz" integrity sha512-dsKNQNdj6xA3T+QlADDA7mOSlX0qiMINjn0cgr+eGHGsbSHzTabcIogz2+p/iqP1Xs6EP/sS2SbqH+brGTbq0g== -functions-have-names@^1.2.2: +functions-have-names@^1.2.2, functions-have-names@^1.2.3: version "1.2.3" - resolved "https://registry.npmjs.org/functions-have-names/-/functions-have-names-1.2.3.tgz" + resolved "https://registry.yarnpkg.com/functions-have-names/-/functions-have-names-1.2.3.tgz#0404fe4ee2ba2f607f0e0ec3c80bae994133b834" integrity sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ== get-caller-file@^2.0.1, get-caller-file@^2.0.5: @@ -3520,6 +3690,17 @@ get-intrinsic@^1.0.2, get-intrinsic@^1.1.0, get-intrinsic@^1.1.1, get-intrinsic@ has "^1.0.3" has-symbols "^1.0.3" +get-intrinsic@^1.2.1, get-intrinsic@^1.2.2, get-intrinsic@^1.2.3, get-intrinsic@^1.2.4: + version "1.2.4" + resolved "https://registry.yarnpkg.com/get-intrinsic/-/get-intrinsic-1.2.4.tgz#e385f5a4b5227d449c3eabbad05494ef0abbeadd" + integrity sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ== + dependencies: + es-errors "^1.3.0" + function-bind "^1.1.2" + has-proto "^1.0.1" + has-symbols "^1.0.3" + hasown "^2.0.0" + get-port@^3.1.0: version "3.2.0" resolved "https://registry.npmjs.org/get-port/-/get-port-3.2.0.tgz" @@ -3550,6 +3731,15 @@ get-symbol-description@^1.0.0: call-bind "^1.0.2" get-intrinsic "^1.1.1" +get-symbol-description@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/get-symbol-description/-/get-symbol-description-1.0.2.tgz#533744d5aa20aca4e079c8e5daf7fd44202821f5" + integrity sha512-g0QYk1dZBxGwk+Ngc+ltRH2IBp2f7zBkBMBJZCDerh6EhlhSR6+9irMCuT/09zD6qkarHUSn529sK/yL4S27mg== + dependencies: + call-bind "^1.0.5" + es-errors "^1.3.0" + get-intrinsic "^1.2.4" + getpass@^0.1.1: version "0.1.7" resolved "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz" @@ -3666,6 +3856,13 @@ global@~4.4.0: min-document "^2.19.0" process "^0.11.10" +globalthis@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/globalthis/-/globalthis-1.0.3.tgz#5852882a52b80dc301b0660273e1ed082f0b6ccf" + integrity sha512-sFdI5LyBiNTHjRd7cGPWapiHWMOXKyuBNX/cWJ3NfzrZQVa8GI/8cofCl74AOVqq9W5kNmguTIzJ/1s2gyI9wA== + dependencies: + define-properties "^1.1.3" + globby@^10.0.1: version "10.0.2" resolved "https://registry.npmjs.org/globby/-/globby-10.0.2.tgz" @@ -3905,6 +4102,18 @@ has-property-descriptors@^1.0.0: dependencies: get-intrinsic "^1.1.1" +has-property-descriptors@^1.0.1, has-property-descriptors@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz#963ed7d071dc7bf5f084c5bfbe0d1b6222586854" + integrity sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg== + dependencies: + es-define-property "^1.0.0" + +has-proto@^1.0.1, has-proto@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/has-proto/-/has-proto-1.0.3.tgz#b31ddfe9b0e6e9914536a6ab286426d0214f77fd" + integrity sha512-SJ1amZAJUiZS+PhsVLf5tGydlaVB8EdFpaSO4gmiUKUOxk8qzn5AIy4ZeJUmh22znIdk/uMAUT2pl3FxzVUH+Q== + has-symbols@^1.0.0, has-symbols@^1.0.2, has-symbols@^1.0.3: version "1.0.3" resolved "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz" @@ -3917,6 +4126,13 @@ has-tostringtag@^1.0.0: dependencies: has-symbols "^1.0.2" +has-tostringtag@^1.0.1, has-tostringtag@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/has-tostringtag/-/has-tostringtag-1.0.2.tgz#2cdc42d40bef2e5b4eeab7c01a73c54ce7ab5abc" + integrity sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw== + dependencies: + has-symbols "^1.0.3" + has@^1.0.3: version "1.0.3" resolved "https://registry.npmjs.org/has/-/has-1.0.3.tgz" @@ -3949,6 +4165,13 @@ hash.js@1.1.7, hash.js@^1.0.0, hash.js@^1.0.3, hash.js@^1.1.7: inherits "^2.0.3" minimalistic-assert "^1.0.1" +hasown@^2.0.0, hasown@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/hasown/-/hasown-2.0.1.tgz#26f48f039de2c0f8d3356c223fb8d50253519faa" + integrity sha512-1/th4MHjnwncwXsIW6QMzlvYL9kG5e/CpVvLRZe4XPa8TOUNbCELqmvhDmnkNsAjwaG4+I8gJJL0JBvTTLO9qA== + dependencies: + function-bind "^1.1.2" + he@1.2.0, he@^1.2.0: version "1.2.0" resolved "https://registry.npmjs.org/he/-/he-1.2.0.tgz" @@ -4152,6 +4375,15 @@ internal-slot@^1.0.3: has "^1.0.3" side-channel "^1.0.4" +internal-slot@^1.0.7: + version "1.0.7" + resolved "https://registry.yarnpkg.com/internal-slot/-/internal-slot-1.0.7.tgz#c06dcca3ed874249881007b0a5523b172a190802" + integrity sha512-NGnrKwXzSms2qUUih/ILZ5JBqNTSa1+ZmP6flaIp6KmSElgE9qdndzS3cqjrDovwFdmwsGsLdeFgB6suw+1e9g== + dependencies: + es-errors "^1.3.0" + hasown "^2.0.0" + side-channel "^1.0.4" + interpret@^1.0.0: version "1.4.0" resolved "https://registry.npmjs.org/interpret/-/interpret-1.4.0.tgz" @@ -4177,6 +4409,14 @@ is-arguments@^1.0.4: call-bind "^1.0.2" has-tostringtag "^1.0.0" +is-array-buffer@^3.0.4: + version "3.0.4" + resolved "https://registry.yarnpkg.com/is-array-buffer/-/is-array-buffer-3.0.4.tgz#7a1f92b3d61edd2bc65d24f130530ea93d7fae98" + integrity sha512-wcjaerHw0ydZwfhiKbXJWLDY8A7yV7KhjQOpb83hGgGfId/aQa4TOvwyzn2PuswW2gPCYEL/nEAiSVpdOj1lXw== + dependencies: + call-bind "^1.0.2" + get-intrinsic "^1.2.1" + is-bigint@^1.0.1: version "1.0.4" resolved "https://registry.npmjs.org/is-bigint/-/is-bigint-1.0.4.tgz" @@ -4279,6 +4519,11 @@ is-negative-zero@^2.0.2: resolved "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.2.tgz" integrity sha512-dqJvarLawXsFbNDeJW7zAz8ItJ9cd28YufuuFzh0G8pNHjJMnY08Dv7sYX2uF5UpQOwieAeOExEYAWWfu7ZZUA== +is-negative-zero@^2.0.3: + version "2.0.3" + resolved "https://registry.yarnpkg.com/is-negative-zero/-/is-negative-zero-2.0.3.tgz#ced903a027aca6381b777a5743069d7376a49747" + integrity sha512-5KoIu2Ngpyek75jXodFvnafB6DJgr3u8uuK0LEZJjrU19DrMD3EVERaR8sjz8CCGgpZvxPl9SuE1GMVPFHx1mw== + is-number-object@^1.0.4: version "1.0.7" resolved "https://registry.npmjs.org/is-number-object/-/is-number-object-1.0.7.tgz" @@ -4311,6 +4556,13 @@ is-shared-array-buffer@^1.0.2: dependencies: call-bind "^1.0.2" +is-shared-array-buffer@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/is-shared-array-buffer/-/is-shared-array-buffer-1.0.3.tgz#1237f1cba059cdb62431d378dcc37d9680181688" + integrity sha512-nA2hv5XIhLR3uVzDDfCIknerhx8XUKnstuOERPNNIinXG7v9u+ohXF67vxm4TPTEPU6lm61ZkwP3c9PCB97rhg== + dependencies: + call-bind "^1.0.7" + is-string@^1.0.5, is-string@^1.0.7: version "1.0.7" resolved "https://registry.npmjs.org/is-string/-/is-string-1.0.7.tgz" @@ -4325,6 +4577,13 @@ is-symbol@^1.0.2, is-symbol@^1.0.3: dependencies: has-symbols "^1.0.2" +is-typed-array@^1.1.13: + version "1.1.13" + resolved "https://registry.yarnpkg.com/is-typed-array/-/is-typed-array-1.1.13.tgz#d6c5ca56df62334959322d7d7dd1cca50debe229" + integrity sha512-uZ25/bUAlUY5fR4OKT4rZQEBrzQWYV9ZJYGGsUmEJ6thodVJ1HX64ePQ6Z0qPWP+m+Uq6e9UugrE38jeYsDSMw== + dependencies: + which-typed-array "^1.1.14" + is-typed-array@^1.1.3: version "1.1.12" resolved "https://registry.yarnpkg.com/is-typed-array/-/is-typed-array-1.1.12.tgz#d0bab5686ef4a76f7a73097b95470ab199c57d4a" @@ -4356,6 +4615,11 @@ is-wsl@^2.1.1: dependencies: is-docker "^2.0.0" +isarray@^2.0.5: + version "2.0.5" + resolved "https://registry.yarnpkg.com/isarray/-/isarray-2.0.5.tgz#8af1e4c1221244cc62459faf38940d4e644a5723" + integrity sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw== + isarray@~1.0.0: version "1.0.0" resolved "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz" @@ -4820,6 +5084,11 @@ minimist@^1.2.5, minimist@^1.2.6: resolved "https://registry.npmjs.org/minimist/-/minimist-1.2.7.tgz" integrity sha512-bzfL1YUZsP41gmu/qjrEk0Q6i2ix/cVeAhbCbqH9u3zYutS1cLg00qhrD0M2MVdCcx4Sc0UpP2eBWo9rotpq6g== +minimist@^1.2.7: + version "1.2.8" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.8.tgz#c1a464e7693302e082a075cee0c057741ac4772c" + integrity sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA== + minipass@^2.6.0, minipass@^2.9.0: version "2.9.0" resolved "https://registry.yarnpkg.com/minipass/-/minipass-2.9.0.tgz#e713762e7d3e32fed803115cf93e04bca9fcc9a6" @@ -5166,6 +5435,11 @@ object-inspect@^1.12.2, object-inspect@^1.9.0: resolved "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.2.tgz" integrity sha512-z+cPxW0QGUp0mcqcsgQyLVRDoXFQbXOwBaqyF7VIgI4TWNQsDHrBpUQslRmIfAoYWdYzs6UlKJtB2XJpTaNSpQ== +object-inspect@^1.13.1: + version "1.13.1" + resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.13.1.tgz#b96c6109324ccfef6b12216a956ca4dc2ff94bc2" + integrity sha512-5qoj1RUiKOMsCCNLV1CBiPYE10sziTsnmNxkAI/rZhiD63CF7IqdFGC/XzjWjpSgLf0LxXX3bDFIh0E18f6UhQ== + object-keys@^1.0.11, object-keys@^1.1.1: version "1.1.1" resolved "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz" @@ -5191,6 +5465,16 @@ object.assign@^4.1.4: has-symbols "^1.0.3" object-keys "^1.1.1" +object.assign@^4.1.5: + version "4.1.5" + resolved "https://registry.yarnpkg.com/object.assign/-/object.assign-4.1.5.tgz#3a833f9ab7fdb80fc9e8d2300c803d216d8fdbb0" + integrity sha512-byy+U7gp+FVwmyzKPYhW2h5l3crpmGsxl7X2s8y43IgxvG4g3QZ6CffDtsNQy1WsmZpQbO+ybo0AlW7TY6DcBQ== + dependencies: + call-bind "^1.0.5" + define-properties "^1.2.1" + has-symbols "^1.0.3" + object-keys "^1.1.1" + object.getownpropertydescriptors@^2.0.3: version "2.1.4" resolved "https://registry.npmjs.org/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.1.4.tgz" @@ -5492,6 +5776,11 @@ portfinder@^1.0.28: debug "^3.2.7" mkdirp "^0.5.6" +possible-typed-array-names@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/possible-typed-array-names/-/possible-typed-array-names-1.0.0.tgz#89bb63c6fada2c3e90adc4a647beeeb39cc7bf8f" + integrity sha512-d7Uw+eZoloe0EHDIYoe+bQ5WXnGMOpmiZFTuMWCwpjzzkL2nTjcKiAk4hh8TjnGye2TwWOk3UXucZ+3rbmBa8Q== + prelude-ls@~1.1.2: version "1.1.2" resolved "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz" @@ -5719,6 +6008,16 @@ regexp.prototype.flags@^1.4.3: define-properties "^1.1.3" functions-have-names "^1.2.2" +regexp.prototype.flags@^1.5.2: + version "1.5.2" + resolved "https://registry.yarnpkg.com/regexp.prototype.flags/-/regexp.prototype.flags-1.5.2.tgz#138f644a3350f981a858c44f6bb1a61ff59be334" + integrity sha512-NcDiDkTLuPR+++OCKB0nWafEmhg/Da8aUPLPMQbK+bxKKCm1/S5he+AqYa4PlMCVBalb4/yxIRub6qkEx5yJbw== + dependencies: + call-bind "^1.0.6" + define-properties "^1.2.1" + es-errors "^1.3.0" + set-function-name "^2.0.1" + req-cwd@^2.0.0: version "2.0.0" resolved "https://registry.npmjs.org/req-cwd/-/req-cwd-2.0.0.tgz" @@ -5891,6 +6190,16 @@ rustbn.js@~0.2.0: resolved "https://registry.npmjs.org/rustbn.js/-/rustbn.js-0.2.0.tgz" integrity sha512-4VlvkRUuCJvr2J6Y0ImW7NvTCriMi7ErOAqWk1y69vAdoNIzCF3yPmgeNzx+RQTLEDFq5sHfscn1MwHxP9hNfA== +safe-array-concat@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/safe-array-concat/-/safe-array-concat-1.1.0.tgz#8d0cae9cb806d6d1c06e08ab13d847293ebe0692" + integrity sha512-ZdQ0Jeb9Ofti4hbt5lX3T2JcAamT9hfzYU1MNB+z/jaEbB6wfFfPIR/zEORmZqobkCCJhSjodobH6WHNmJ97dg== + dependencies: + call-bind "^1.0.5" + get-intrinsic "^1.2.2" + has-symbols "^1.0.3" + isarray "^2.0.5" + safe-buffer@5.1.2, safe-buffer@~5.1.0, safe-buffer@~5.1.1: version "5.1.2" resolved "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz" @@ -5910,6 +6219,15 @@ safe-regex-test@^1.0.0: get-intrinsic "^1.1.3" is-regex "^1.1.4" +safe-regex-test@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/safe-regex-test/-/safe-regex-test-1.0.3.tgz#a5b4c0f06e0ab50ea2c395c14d8371232924c377" + integrity sha512-CdASjNJPvRa7roO6Ra/gLYBTzYzzPyyBXxIMdGW3USQLyjWEls2RgW5UBTXaQVp+OrpeCK3bLem8smtmheoRuw== + dependencies: + call-bind "^1.0.6" + es-errors "^1.3.0" + is-regex "^1.1.4" + "safer-buffer@>= 2.1.2 < 3", "safer-buffer@>= 2.1.2 < 3.0.0", safer-buffer@^2.0.2, safer-buffer@^2.1.0, safer-buffer@~2.1.0: version "2.1.2" resolved "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz" @@ -6035,6 +6353,28 @@ set-blocking@^2.0.0: resolved "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz" integrity sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw== +set-function-length@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/set-function-length/-/set-function-length-1.2.1.tgz#47cc5945f2c771e2cf261c6737cf9684a2a5e425" + integrity sha512-j4t6ccc+VsKwYHso+kElc5neZpjtq9EnRICFZtWyBsLojhmeF/ZBd/elqm22WJh/BziDe/SBiOeAt0m2mfLD0g== + dependencies: + define-data-property "^1.1.2" + es-errors "^1.3.0" + function-bind "^1.1.2" + get-intrinsic "^1.2.3" + gopd "^1.0.1" + has-property-descriptors "^1.0.1" + +set-function-name@^2.0.1: + version "2.0.2" + resolved "https://registry.yarnpkg.com/set-function-name/-/set-function-name-2.0.2.tgz#16a705c5a0dc2f5e638ca96d8a8cd4e1c2b90985" + integrity sha512-7PGFlmtwsEADb0WYyvCMa1t+yke6daIG4Wirafur5kcf+MhUnPms1UeR0CKQdTZD81yESwMHbtn+TR+dMviakQ== + dependencies: + define-data-property "^1.1.4" + es-errors "^1.3.0" + functions-have-names "^1.2.3" + has-property-descriptors "^1.0.2" + setimmediate@1.0.4: version "1.0.4" resolved "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.4.tgz" @@ -6176,10 +6516,12 @@ solc@0.7.3: semver "^5.5.0" tmp "0.0.33" -solidity-ast@^0.4.15: - version "0.4.35" - resolved "https://registry.npmjs.org/solidity-ast/-/solidity-ast-0.4.35.tgz" - integrity sha512-F5bTDLh3rmDxRmLSrs3qt3nvxJprWSEkS7h2KmuXDx7XTfJ6ZKVTV1rtPIYCqJAuPsU/qa8YUeFn7jdOAZcTPA== +solidity-ast@^0.4.51: + version "0.4.55" + resolved "https://registry.yarnpkg.com/solidity-ast/-/solidity-ast-0.4.55.tgz#00b685e6eefb2e8dfb67df1fe0afbe3b3bfb4b28" + integrity sha512-qeEU/r/K+V5lrAw8iswf2/yfWAnSGs3WKPHI+zAFKFjX0dIBVXEU/swQ8eJQYHf6PJWUZFO2uWV4V1wEOkeQbA== + dependencies: + array.prototype.findlast "^1.2.2" solidity-coverage@^0.8.2: version "0.8.2" @@ -6320,6 +6662,15 @@ string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: is-fullwidth-code-point "^3.0.0" strip-ansi "^6.0.1" +string.prototype.trim@^1.2.8: + version "1.2.8" + resolved "https://registry.yarnpkg.com/string.prototype.trim/-/string.prototype.trim-1.2.8.tgz#f9ac6f8af4bd55ddfa8895e6aea92a96395393bd" + integrity sha512-lfjY4HcixfQXOfaqCvcBuOIapyaroTXhbkfJN3gcB1OtyupngWK4sEET9Knd0cXd28kTUqu/kHoV4HKSJdnjiQ== + dependencies: + call-bind "^1.0.2" + define-properties "^1.2.0" + es-abstract "^1.22.1" + string.prototype.trimend@^1.0.5: version "1.0.5" resolved "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.5.tgz" @@ -6329,6 +6680,15 @@ string.prototype.trimend@^1.0.5: define-properties "^1.1.4" es-abstract "^1.19.5" +string.prototype.trimend@^1.0.7: + version "1.0.7" + resolved "https://registry.yarnpkg.com/string.prototype.trimend/-/string.prototype.trimend-1.0.7.tgz#1bb3afc5008661d73e2dc015cd4853732d6c471e" + integrity sha512-Ni79DqeB72ZFq1uH/L6zJ+DKZTkOtPIHovb3YZHQViE+HDouuU4mBrLOLDn5Dde3RF8qw5qVETEjhu9locMLvA== + dependencies: + call-bind "^1.0.2" + define-properties "^1.2.0" + es-abstract "^1.22.1" + string.prototype.trimstart@^1.0.5: version "1.0.5" resolved "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.5.tgz" @@ -6338,6 +6698,15 @@ string.prototype.trimstart@^1.0.5: define-properties "^1.1.4" es-abstract "^1.19.5" +string.prototype.trimstart@^1.0.7: + version "1.0.7" + resolved "https://registry.yarnpkg.com/string.prototype.trimstart/-/string.prototype.trimstart-1.0.7.tgz#d4cdb44b83a4737ffbac2d406e405d43d0184298" + integrity sha512-NGhtDFu3jCEm7B4Fy0DpLewdJQOZcQ0rGbwQ/+stjnrp2i+rlKeCvos9hOIeCmqwratM47OBxY7uFZzjxHXmrg== + dependencies: + call-bind "^1.0.2" + define-properties "^1.2.0" + es-abstract "^1.22.1" + string_decoder@^1.1.1: version "1.3.0" resolved "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz" @@ -6706,6 +7075,50 @@ typechain@^8.1.0: ts-command-line-args "^2.2.0" ts-essentials "^7.0.1" +typed-array-buffer@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/typed-array-buffer/-/typed-array-buffer-1.0.2.tgz#1867c5d83b20fcb5ccf32649e5e2fc7424474ff3" + integrity sha512-gEymJYKZtKXzzBzM4jqa9w6Q1Jjm7x2d+sh19AdsD4wqnMPDYyvwpsIc2Q/835kHuo3BEQ7CjelGhfTsoBb2MQ== + dependencies: + call-bind "^1.0.7" + es-errors "^1.3.0" + is-typed-array "^1.1.13" + +typed-array-byte-length@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/typed-array-byte-length/-/typed-array-byte-length-1.0.1.tgz#d92972d3cff99a3fa2e765a28fcdc0f1d89dec67" + integrity sha512-3iMJ9q0ao7WE9tWcaYKIptkNBuOIcZCCT0d4MRvuuH88fEoEH62IuQe0OtraD3ebQEoTRk8XCBoknUNc1Y67pw== + dependencies: + call-bind "^1.0.7" + for-each "^0.3.3" + gopd "^1.0.1" + has-proto "^1.0.3" + is-typed-array "^1.1.13" + +typed-array-byte-offset@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/typed-array-byte-offset/-/typed-array-byte-offset-1.0.2.tgz#f9ec1acb9259f395093e4567eb3c28a580d02063" + integrity sha512-Ous0vodHa56FviZucS2E63zkgtgrACj7omjwd/8lTEMEPFFyjfixMZ1ZXenpgCFBBt4EC1J2XsyVS2gkG0eTFA== + dependencies: + available-typed-arrays "^1.0.7" + call-bind "^1.0.7" + for-each "^0.3.3" + gopd "^1.0.1" + has-proto "^1.0.3" + is-typed-array "^1.1.13" + +typed-array-length@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/typed-array-length/-/typed-array-length-1.0.5.tgz#57d44da160296d8663fd63180a1802ebf25905d5" + integrity sha512-yMi0PlwuznKHxKmcpoOdeLwxBoVPkqZxd7q2FgMkmD3bNwvF5VW0+UlUQ1k1vmktTu4Yu13Q0RIxEP8+B+wloA== + dependencies: + call-bind "^1.0.7" + for-each "^0.3.3" + gopd "^1.0.1" + has-proto "^1.0.3" + is-typed-array "^1.1.13" + possible-typed-array-names "^1.0.0" + typedarray-to-buffer@^3.1.5: version "3.1.5" resolved "https://registry.yarnpkg.com/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz#a97ee7a9ff42691b9f783ff1bc5112fe3fca9080" @@ -7193,6 +7606,17 @@ which-typed-array@^1.1.11, which-typed-array@^1.1.2: gopd "^1.0.1" has-tostringtag "^1.0.0" +which-typed-array@^1.1.14: + version "1.1.14" + resolved "https://registry.yarnpkg.com/which-typed-array/-/which-typed-array-1.1.14.tgz#1f78a111aee1e131ca66164d8bdc3ab062c95a06" + integrity sha512-VnXFiIW8yNn9kIHN88xvZ4yOWchftKDsRJ8fEPacX/wl1lOvBrhsJ/OeJCXq7B0AaijRuqgzSKalJoPk+D8MPg== + dependencies: + available-typed-arrays "^1.0.6" + call-bind "^1.0.5" + for-each "^0.3.3" + gopd "^1.0.1" + has-tostringtag "^1.0.1" + which@1.3.1, which@^1.1.1, which@^1.2.9, which@^1.3.1: version "1.3.1" resolved "https://registry.npmjs.org/which/-/which-1.3.1.tgz" From d9cdfb685e6865a612b2fbbd865514c504dd05d6 Mon Sep 17 00:00:00 2001 From: Goran Vladika Date: Fri, 8 Mar 2024 16:41:51 +0100 Subject: [PATCH 06/14] Get chain info using up-to-date interfaces --- .../orbitGovernanceDeployer.ts | 211 +++++++++--------- 1 file changed, 104 insertions(+), 107 deletions(-) diff --git a/scripts/orbit-chain-governance/orbitGovernanceDeployer.ts b/scripts/orbit-chain-governance/orbitGovernanceDeployer.ts index 57e9a78c..4cd2f692 100644 --- a/scripts/orbit-chain-governance/orbitGovernanceDeployer.ts +++ b/scripts/orbit-chain-governance/orbitGovernanceDeployer.ts @@ -8,10 +8,11 @@ import { } from "../../typechain-types"; import { Filter, JsonRpcProvider, Provider } from "@ethersproject/providers"; import { execSync } from "child_process"; - import dotenv from "dotenv"; import { Interface } from "@ethersproject/abi"; import { RollupCore__factory } from "@arbitrum/sdk/dist/lib/abi/factories/RollupCore__factory"; +import { IOwnable__factory } from "../../token-bridge-contracts/build/types"; + dotenv.config(); export const deployGovernance = async () => { @@ -20,9 +21,20 @@ export const deployGovernance = async () => { const parentChainDeployKey = process.env["PARENT_CHAIN_DEPLOY_KEY"] as string; const childChainRpc = process.env["CHILD_CHAIN_RPC"] as string; const childChainDeployKey = process.env["CHILD_CHAIN_DEPLOY_KEY"] as string; - if (![parentChainRpc, parentChainDeployKey, childChainRpc, childChainDeployKey].every(Boolean)) { + const inboxAddress = process.env["INBOX_ADDRESS"] as string; + const tokenBridgeCreatorAddress = process.env["TOKEN_BRIDGE_CREATOR_ADDRESS"] as string; + if ( + ![ + parentChainRpc, + parentChainDeployKey, + childChainRpc, + childChainDeployKey, + inboxAddress, + tokenBridgeCreatorAddress, + ].every(Boolean) + ) { throw new Error( - "Following env vars have to be set: PARENT_CHAIN_RPC, PARENT_CHAIN_DEPLOY_KEY, CHILD_CHAIN_RPC, CHILD_CHAIN_DEPLOY_KEY" + "Following env vars have to be set: PARENT_CHAIN_RPC, PARENT_CHAIN_DEPLOY_KEY, CHILD_CHAIN_RPC, CHILD_CHAIN_DEPLOY_KEY, INBOX_ADDRESS, TOKEN_BRIDGE_CREATOR_ADDRESS" ); } @@ -53,14 +65,19 @@ export const deployGovernance = async () => { const governanceToken = await governanceTokenFac.deployed(); // get deployment data - const rollupData = await getDeploymentData(parentChainDeployerWallet.provider!); + const { childChainUpExec, childChainProxyAdmin, parentChainUpExec, parentChainProxyAdmin } = + await getDeploymentData( + parentChainDeployerWallet.provider!, + inboxAddress, + tokenBridgeCreatorAddress + ); /// step1 const deploymentReceipt = await ( await childChainFactory.deployStep1({ _governanceToken: governanceToken.address, - _govChainUpExec: rollupData.childChainUpgradeExecutor, - _govChainProxyAdmin: rollupData.childChainUpgradeExecutor, + _govChainUpExec: childChainUpExec, + _govChainProxyAdmin: childChainProxyAdmin, _proposalThreshold: 100, _votingPeriod: 10, _votingDelay: 10, @@ -72,18 +89,15 @@ export const deployGovernance = async () => { console.log("Step1 finished"); //// step 2 - const _parentChainUpExec = rollupData["upgrade-executor"]; - const _parentChainProxyAdmin = rollupData.parentChainProxyAdmin; - const _inbox = rollupData.inbox; const { coreTimelock: _childChainCoreTimelock, coreGoverner: _childChainCoreGov } = _getParsedLogs(deploymentReceipt.logs, childChainFactory.interface, "Deployed")[0].args; const _minTimelockDelay = 7; await ( await parentChainFactory.deployStep2( - _parentChainUpExec, - _parentChainProxyAdmin, - _inbox, + parentChainUpExec, + parentChainProxyAdmin, + inboxAddress, _childChainCoreTimelock, _minTimelockDelay ) @@ -91,70 +105,36 @@ export const deployGovernance = async () => { console.log("Step2 finished"); }; -async function getDeploymentData(parentChainProvider: Provider) { - /// get rollup data from config file - let sequencerContainer = execSync('docker ps --filter "name=l3node" --format "{{.Names}}"') - .toString() - .trim(); - const deploymentData = execSync( - `docker exec ${sequencerContainer} cat /config/l3deployment.json` - ).toString(); - const parsedDeploymentData = JSON.parse(deploymentData) as { - bridge: string; - inbox: string; - ["sequencer-inbox"]: string; - rollup: string; - ["native-token"]: string; - ["upgrade-executor"]: string; - }; - - //// get parent chain deployment data - const filter: Filter = { - topics: [ - ethers.utils.id( - "OrbitTokenBridgeCreated(address,address,address,address,address,address,address,address)" - ), - ethers.utils.hexZeroPad(parsedDeploymentData.inbox, 32), - ], - }; - const logs = await parentChainProvider.getLogs({ - ...filter, - fromBlock: 0, - toBlock: "latest", - }); - if (logs.length === 0) { - throw new Error("Couldn't find any OrbitTokenBridgeCreated events in block range[0,latest]"); - } - const eventIface = new Interface(eventABI); - const parentChainDeploymentData = eventIface.parseLog(logs[0]); - - ///// get child chain deployment data - const rollup = await IBridge__factory.connect( - await IInbox__factory.connect(parsedDeploymentData.inbox, parentChainProvider).bridge(), - parentChainProvider - ).rollup(); - const chainId = await RollupCore__factory.connect(rollup, parentChainProvider).chainId(); - - const tokenBridgeCreatorAddress = logs[0].address; +async function getDeploymentData( + parentChainProvider: Provider, + inboxAddress: string, + tokenBridgeCreatorAddress: string +) { + /// get child chain deployment data const tokenBridgeCreator = new ethers.Contract( tokenBridgeCreatorAddress, tokenBridgeCreatorABI, parentChainProvider ); - const childChainUpgradeExecutor = await tokenBridgeCreator.getCanonicalL2UpgradeExecutorAddress( - chainId + const [, , , , , childChainProxyAdmin, , childChainUpExec, ,] = + tokenBridgeCreator.inboxToL2Deployment(inboxAddress); + + /// get parent chain info + const bridge = await IInbox__factory.connect(inboxAddress, parentChainProvider).bridge(); + const rollup = await IBridge__factory.connect(bridge, parentChainProvider).rollup(); + const parentChainUpExec = await IOwnable__factory.connect(rollup, parentChainProvider).owner(); + const iinboxProxyAdmin = new ethers.Contract( + inboxAddress, + iinboxProxyAdminABI, + parentChainProvider ); - const childChainProxyAdmin = await tokenBridgeCreator.getCanonicalL2ProxyAdminAddress(chainId); + const parentChainProxyAdmin = await iinboxProxyAdmin.getProxyAdmin(); let data = { - ...parsedDeploymentData, - parentChainInbox: parsedDeploymentData.inbox, - parentChainProxyAdmin: parentChainDeploymentData.args.proxyAdmin, - parentChainRouter: parentChainDeploymentData.args.router, - parentChainStandardGateway: parentChainDeploymentData.args.standardGateway, - parentChainCustomGateway: parentChainDeploymentData.args.customGateway, - childChainUpgradeExecutor: childChainUpgradeExecutor, - childChainProxyAdmin: childChainProxyAdmin, + childChainProxyAdmin, + childChainUpExec, + parentChainUpExec, + parentChainProxyAdmin, }; return data; @@ -172,95 +152,112 @@ export const _getParsedLogs = ( return parsedLogs; }; -//// OrbitTokenBridgeCreated event ABI -const eventABI = [ +//// subset of token bridge creator ABI +const tokenBridgeCreatorABI = [ { - anonymous: false, inputs: [ { - indexed: true, internalType: "address", - name: "inbox", + name: "", + type: "address", + }, + ], + name: "inboxToL1Deployment", + outputs: [ + { + internalType: "address", + name: "router", + type: "address", + }, + { + internalType: "address", + name: "standardGateway", + type: "address", + }, + { + internalType: "address", + name: "customGateway", + type: "address", + }, + { + internalType: "address", + name: "wethGateway", + type: "address", + }, + { + internalType: "address", + name: "weth", type: "address", }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ { - indexed: true, internalType: "address", - name: "owner", + name: "", type: "address", }, + ], + name: "inboxToL2Deployment", + outputs: [ { - indexed: false, internalType: "address", name: "router", type: "address", }, { - indexed: false, internalType: "address", name: "standardGateway", type: "address", }, { - indexed: false, internalType: "address", name: "customGateway", type: "address", }, { - indexed: false, internalType: "address", name: "wethGateway", type: "address", }, { - indexed: false, + internalType: "address", + name: "weth", + type: "address", + }, + { internalType: "address", name: "proxyAdmin", type: "address", }, { - indexed: false, internalType: "address", - name: "upgradeExecutor", + name: "beaconProxyFactory", type: "address", }, - ], - name: "OrbitTokenBridgeCreated", - type: "event", - }, -]; - -//// subset of token bridge creator ABI -const tokenBridgeCreatorABI = [ - { - inputs: [ { - internalType: "uint256", - name: "chainId", - type: "uint256", + internalType: "address", + name: "upgradeExecutor", + type: "address", }, - ], - name: "getCanonicalL2UpgradeExecutorAddress", - outputs: [ { internalType: "address", - name: "", + name: "multicall", type: "address", }, ], stateMutability: "view", type: "function", }, +]; + +const iinboxProxyAdminABI = [ { - inputs: [ - { - internalType: "uint256", - name: "chainId", - type: "uint256", - }, - ], - name: "getCanonicalL2ProxyAdminAddress", + inputs: [], + name: "getProxyAdmin", outputs: [ { internalType: "address", From deb65c1f09a39871576119651fc321683b1dfd71 Mon Sep 17 00:00:00 2001 From: Goran Vladika Date: Fri, 8 Mar 2024 18:32:07 +0100 Subject: [PATCH 07/14] Missing await --- scripts/orbit-chain-governance/orbitGovernanceDeployer.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/orbit-chain-governance/orbitGovernanceDeployer.ts b/scripts/orbit-chain-governance/orbitGovernanceDeployer.ts index 4cd2f692..c79ff064 100644 --- a/scripts/orbit-chain-governance/orbitGovernanceDeployer.ts +++ b/scripts/orbit-chain-governance/orbitGovernanceDeployer.ts @@ -117,7 +117,7 @@ async function getDeploymentData( parentChainProvider ); const [, , , , , childChainProxyAdmin, , childChainUpExec, ,] = - tokenBridgeCreator.inboxToL2Deployment(inboxAddress); + await tokenBridgeCreator.inboxToL2Deployment(inboxAddress); /// get parent chain info const bridge = await IInbox__factory.connect(inboxAddress, parentChainProvider).bridge(); From 551feb6c04fa4ecd51e87da307d8ed4a2a1507e2 Mon Sep 17 00:00:00 2001 From: Goran Vladika Date: Mon, 11 Mar 2024 10:35:33 +0100 Subject: [PATCH 08/14] Put in role grants in right order --- .../factories/ParentChainGovFactory.sol | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/orbit-chain-governance/factories/ParentChainGovFactory.sol b/src/orbit-chain-governance/factories/ParentChainGovFactory.sol index f26435ee..d5a7bac3 100644 --- a/src/orbit-chain-governance/factories/ParentChainGovFactory.sol +++ b/src/orbit-chain-governance/factories/ParentChainGovFactory.sol @@ -56,14 +56,16 @@ contract ParentChainGovFactory is Ownable { // anyone can execute timelock.grantRole(timelock.EXECUTOR_ROLE(), address(0)); - // revoke admin rights and give them to the upgrade executor + // grant admin rights to the upgrade executor timelock.grantRole(timelock.TIMELOCK_ADMIN_ROLE(), address(_parentChainUpExec)); - timelock.revokeRole(timelock.TIMELOCK_ADMIN_ROLE(), address(timelock)); - timelock.revokeRole(timelock.TIMELOCK_ADMIN_ROLE(), address(this)); - // grant canceller role to upgrade executor; this can be used e.g. by an admin with executor affordance granted to the upgrade executor + // grant canceller role to upgrade executor; this can be used e.g. by an admin with executor affordance granted to the upgrade executor timelock.grantRole(timelock.CANCELLER_ROLE(), address(_parentChainUpExec)); + // revoke admin rights + timelock.revokeRole(timelock.TIMELOCK_ADMIN_ROLE(), address(timelock)); + timelock.revokeRole(timelock.TIMELOCK_ADMIN_ROLE(), address(this)); + emit Deployed(timelock); } From 7d84cb4b75887fa1b1af41dee0110a8ac4123a5f Mon Sep 17 00:00:00 2001 From: Goran Vladika Date: Mon, 11 Mar 2024 10:36:45 +0100 Subject: [PATCH 09/14] Fix return params order --- scripts/orbit-chain-governance/orbitGovernanceDeployer.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/scripts/orbit-chain-governance/orbitGovernanceDeployer.ts b/scripts/orbit-chain-governance/orbitGovernanceDeployer.ts index c79ff064..fcda3eec 100644 --- a/scripts/orbit-chain-governance/orbitGovernanceDeployer.ts +++ b/scripts/orbit-chain-governance/orbitGovernanceDeployer.ts @@ -86,7 +86,6 @@ export const deployGovernance = async () => { _coreQuorumThreshold: 500, }) ).wait(); - console.log("Step1 finished"); //// step 2 const { coreTimelock: _childChainCoreTimelock, coreGoverner: _childChainCoreGov } = @@ -131,8 +130,8 @@ async function getDeploymentData( const parentChainProxyAdmin = await iinboxProxyAdmin.getProxyAdmin(); let data = { - childChainProxyAdmin, childChainUpExec, + childChainProxyAdmin, parentChainUpExec, parentChainProxyAdmin, }; From 1da8c41f2d0bebf60bb1d64fcfc9c8cb0d79f5da Mon Sep 17 00:00:00 2001 From: Goran Vladika Date: Wed, 30 Oct 2024 13:22:46 +0100 Subject: [PATCH 10/14] Bump nitro contracts and token bridge contracts --- package.json | 4 ++-- yarn.lock | 30 ++++++++++++++++++++++++++---- 2 files changed, 28 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index 1d39fe35..57e30783 100644 --- a/package.json +++ b/package.json @@ -77,8 +77,8 @@ "typescript": "^4.8.4" }, "dependencies": { - "@arbitrum/nitro-contracts": "1.1.1", - "@arbitrum/token-bridge-contracts": "1.2.1", + "@arbitrum/nitro-contracts": "^2.1.0", + "@arbitrum/token-bridge-contracts": "^1.2.3", "@gnosis.pm/safe-contracts": "1.3.0", "@openzeppelin/contracts": "4.7.3", "@openzeppelin/contracts-upgradeable": "4.7.3", diff --git a/yarn.lock b/yarn.lock index 2edba854..a91b60ad 100644 --- a/yarn.lock +++ b/yarn.lock @@ -12,6 +12,17 @@ "@openzeppelin/contracts-upgradeable" "4.5.2" patch-package "^6.4.7" +"@arbitrum/nitro-contracts@^2.1.0": + version "2.1.0" + resolved "https://registry.yarnpkg.com/@arbitrum/nitro-contracts/-/nitro-contracts-2.1.0.tgz#b2900c0b9fad38716dce29c2b3cc96eb35611b55" + integrity sha512-Bh89H5/ihWVcAI2eNBc1McybZAmpTHJ5eFLauLz8bjicZTOD545vSYAreJN41Uo+AlHKVAMtODUQdoP0NVtg3Q== + dependencies: + "@offchainlabs/upgrade-executor" "1.1.0-beta.0" + "@openzeppelin/contracts" "4.5.0" + "@openzeppelin/contracts-upgradeable" "4.5.2" + patch-package "^6.4.7" + solady "0.0.182" + "@arbitrum/sdk@^3.1.11": version "3.1.11" resolved "https://registry.yarnpkg.com/@arbitrum/sdk/-/sdk-3.1.11.tgz#14fa67daceef7568b949e4a2695d561dd47eec5b" @@ -22,12 +33,13 @@ "@ethersproject/bytes" "^5.0.8" ethers "^5.1.0" -"@arbitrum/token-bridge-contracts@1.2.1": - version "1.2.1" - resolved "https://registry.yarnpkg.com/@arbitrum/token-bridge-contracts/-/token-bridge-contracts-1.2.1.tgz#4838d70182bc0d6b36adfd733d7b4650e596c979" - integrity sha512-ngKeay/0O91QyVLCbcd2pyJIWtzKi2KsPm+O9q3xCfPkjuCZ0+MK5OdhYKCbvGc0jf39R7izRsvmUHE0qA603A== +"@arbitrum/token-bridge-contracts@^1.2.3": + version "1.2.3" + resolved "https://registry.yarnpkg.com/@arbitrum/token-bridge-contracts/-/token-bridge-contracts-1.2.3.tgz#b08b22b5dcac255149a10bd8b66b0b55be7f3329" + integrity sha512-Gpw0vGv7oS9tgPMb0JfWW6Ve7yOvcmTdfhuxCgvCOG6ntVoJVhB030RhhfIV9jSpDatQi0T1Jqq2RIMXJIxqyQ== dependencies: "@arbitrum/nitro-contracts" "1.1.1" + "@offchainlabs/stablecoin-evm" "1.0.0-orbit-alpha.2" "@offchainlabs/upgrade-executor" "1.1.0-beta.0" "@openzeppelin/contracts" "4.8.3" "@openzeppelin/contracts-upgradeable" "4.8.3" @@ -791,6 +803,11 @@ table "^6.8.0" undici "^5.4.0" +"@offchainlabs/stablecoin-evm@1.0.0-orbit-alpha.2": + version "1.0.0-orbit-alpha.2" + resolved "https://registry.yarnpkg.com/@offchainlabs/stablecoin-evm/-/stablecoin-evm-1.0.0-orbit-alpha.2.tgz#1156ab9436d0791739b56b355d7cff2e3aadaede" + integrity sha512-g9SO/KD4QoIA5Mvo+wE7GDe3PwNtQ0IK3b+RNRClHKH2if4emneQtEj/eD0Tc32BuYzPRK5cbd4/lBjARo9izQ== + "@offchainlabs/upgrade-executor@1.1.0-beta.0": version "1.1.0-beta.0" resolved "https://registry.yarnpkg.com/@offchainlabs/upgrade-executor/-/upgrade-executor-1.1.0-beta.0.tgz#c4b1375176546a18aaef01a43956abfb58250e0a" @@ -5945,6 +5962,11 @@ slice-ansi@^4.0.0: astral-regex "^2.0.0" is-fullwidth-code-point "^3.0.0" +solady@0.0.182: + version "0.0.182" + resolved "https://registry.yarnpkg.com/solady/-/solady-0.0.182.tgz#bd8c47f128a3a752358ad052782773966d74c400" + integrity sha512-FW6xo1akJoYpkXMzu58/56FcNU3HYYNamEbnFO3iSibXk0nSHo0DV2Gu/zI3FPg3So5CCX6IYli1TT1IWATnvg== + solc@0.7.3: version "0.7.3" resolved "https://registry.npmjs.org/solc/-/solc-0.7.3.tgz" From f83f50ce02433f4f5e5296da58530e56e2a77555 Mon Sep 17 00:00:00 2001 From: Goran Vladika Date: Wed, 30 Oct 2024 13:38:55 +0100 Subject: [PATCH 11/14] Update test --- test/util/ActionTestBase.sol | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/util/ActionTestBase.sol b/test/util/ActionTestBase.sol index d82c7aa8..8f07ba2c 100644 --- a/test/util/ActionTestBase.sol +++ b/test/util/ActionTestBase.sol @@ -73,10 +73,10 @@ abstract contract ActionTestBase { rollup.transferOwnership(address(ue)); bridge = Bridge(TestUtil.deployProxy(address(new Bridge()))); bridge.initialize(IOwnable(address(rollup))); - si = SequencerInbox(TestUtil.deployProxy(address(new SequencerInbox(117964)))); + si = SequencerInbox(TestUtil.deployProxy(address(new SequencerInbox(117964, IReader4844(address(200)), false)))); si.initialize(bridge, ISequencerInbox.MaxTimeVariation(0, 0, 0, 0)); inbox = Inbox(TestUtil.deployProxy(address(new Inbox(117964)))); - inbox.initialize(bridge, si); + inbox.initialize(bridge, si); l1Timelock = L1ArbitrumTimelock(payable(TestUtil.deployProxy(address(new L1ArbitrumTimelock())))); From fbd6e8249191f986bceb9be78823ac670befa5e6 Mon Sep 17 00:00:00 2001 From: Goran Vladika Date: Wed, 6 Nov 2024 15:04:50 +0100 Subject: [PATCH 12/14] Remove double role granting --- .../factories/ParentChainGovFactory.sol | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/orbit-chain-governance/factories/ParentChainGovFactory.sol b/src/orbit-chain-governance/factories/ParentChainGovFactory.sol index 94857bc9..5647be06 100644 --- a/src/orbit-chain-governance/factories/ParentChainGovFactory.sol +++ b/src/orbit-chain-governance/factories/ParentChainGovFactory.sol @@ -56,7 +56,7 @@ contract ParentChainGovFactory is Ownable { // anyone can execute timelock.grantRole(timelock.EXECUTOR_ROLE(), address(0)); - // grant admin rights to the upgrade executor + // grant timelock admin rights to the upgrade executor timelock.grantRole(timelock.TIMELOCK_ADMIN_ROLE(), address(_parentChainUpExec)); // grant canceller role to upgrade executor; this can be used e.g. by an admin with executor affordance granted to the upgrade executor @@ -66,9 +66,6 @@ contract ParentChainGovFactory is Ownable { timelock.revokeRole(timelock.TIMELOCK_ADMIN_ROLE(), address(timelock)); timelock.revokeRole(timelock.TIMELOCK_ADMIN_ROLE(), address(this)); - // grant canceller role to upgrade executor; this can be used e.g. by an admin with executor affordance granted to the upgrade executor - timelock.grantRole(timelock.CANCELLER_ROLE(), address(_parentChainUpExec)); - emit Deployed(timelock, _inbox); } From b36a5685471ed69845e180e5167c95c91e6e5f4d Mon Sep 17 00:00:00 2001 From: Goran Vladika Date: Wed, 6 Nov 2024 15:07:21 +0100 Subject: [PATCH 13/14] Add logging --- scripts/orbit-chain-governance/orbitGovernanceDeployer.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/orbit-chain-governance/orbitGovernanceDeployer.ts b/scripts/orbit-chain-governance/orbitGovernanceDeployer.ts index fcda3eec..6863f8e7 100644 --- a/scripts/orbit-chain-governance/orbitGovernanceDeployer.ts +++ b/scripts/orbit-chain-governance/orbitGovernanceDeployer.ts @@ -63,6 +63,7 @@ export const deployGovernance = async () => { childChainDeployerWallet ).deploy(); const governanceToken = await governanceTokenFac.deployed(); + console.log("GovernanceToken: ", governanceToken.address); // get deployment data const { childChainUpExec, childChainProxyAdmin, parentChainUpExec, parentChainProxyAdmin } = @@ -86,6 +87,7 @@ export const deployGovernance = async () => { _coreQuorumThreshold: 500, }) ).wait(); + console.log("Step1 finished"); //// step 2 const { coreTimelock: _childChainCoreTimelock, coreGoverner: _childChainCoreGov } = From e5265b73df9b4043c3818ca735df71c72bd336ab Mon Sep 17 00:00:00 2001 From: Goran Vladika Date: Wed, 6 Nov 2024 15:44:11 +0100 Subject: [PATCH 14/14] Gas snapshot --- .gas-snapshot | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.gas-snapshot b/.gas-snapshot index 4b10097b..40750545 100644 --- a/.gas-snapshot +++ b/.gas-snapshot @@ -101,7 +101,7 @@ L2SecurityCouncilMgmtFactoryTest:testRemovalGovDeployment() (gas: 30526232) L2SecurityCouncilMgmtFactoryTest:testSecurityCouncilManagerDeployment() (gas: 30545325) NomineeGovernorV2UpgradeActionTest:testAction() (gas: 8153) OfficeHoursActionTest:testConstructor() (gas: 9050) -OfficeHoursActionTest:testFuzzOfficeHoursDeployment(uint256,uint256,int256,uint256,uint256,uint256) (runs: 258, μ: 317071, ~: 317184) +OfficeHoursActionTest:testFuzzOfficeHoursDeployment(uint256,uint256,int256,uint256,uint256,uint256) (runs: 256, μ: 317064, ~: 317184) OfficeHoursActionTest:testInvalidConstructorParameters() (gas: 235740) OfficeHoursActionTest:testPerformBeforeMinimumTimestamp() (gas: 8646) OfficeHoursActionTest:testPerformDuringOfficeHours() (gas: 9140) @@ -153,7 +153,7 @@ SecurityCouncilMemberElectionGovernorTest:testOnlyNomineeElectionGovernorCanProp SecurityCouncilMemberElectionGovernorTest:testProperInitialization() (gas: 49388) SecurityCouncilMemberElectionGovernorTest:testProposeReverts() (gas: 32916) SecurityCouncilMemberElectionGovernorTest:testRelay() (gas: 42229) -SecurityCouncilMemberElectionGovernorTest:testSelectTopNominees(uint256) (runs: 258, μ: 339983, ~: 339822) +SecurityCouncilMemberElectionGovernorTest:testSelectTopNominees(uint256) (runs: 256, μ: 340112, ~: 339983) SecurityCouncilMemberElectionGovernorTest:testSelectTopNomineesFails() (gas: 273335) SecurityCouncilMemberElectionGovernorTest:testSetFullWeightDuration() (gas: 34951) SecurityCouncilMemberElectionGovernorTest:testVotesToWeight() (gas: 152898) @@ -202,11 +202,11 @@ SecurityCouncilNomineeElectionGovernorTest:testProperInitialization() (gas: 7811 SecurityCouncilNomineeElectionGovernorTest:testProposeFails() (gas: 19740) SecurityCouncilNomineeElectionGovernorTest:testRelay() (gas: 42427) SecurityCouncilNomineeElectionGovernorTest:testSetNomineeVetter() (gas: 39905) -SequencerActionsTest:testAddAndRemoveSequencer() (gas: 483532) +SequencerActionsTest:testAddAndRemoveSequencer() (gas: 483628) SequencerActionsTest:testCantAddZeroAddress() (gas: 235614) SetInitialGovParamsActionTest:testL1() (gas: 259904) SetInitialGovParamsActionTest:testL2() (gas: 688888) -SetSequencerInboxMaxTimeVariationAction:testSetMaxTimeVariation() (gas: 374262) +SetSequencerInboxMaxTimeVariationAction:testSetMaxTimeVariation() (gas: 308231) SwitchManagerRolesActionTest:testAction() (gas: 6313) TokenDistributorTest:testClaim() (gas: 5742744) TokenDistributorTest:testClaimAndDelegate() (gas: 5850827)