From 52a1209b5f91ae48f0c44a0ca968f69a6461d6a8 Mon Sep 17 00:00:00 2001 From: mariapiamo Date: Fri, 9 Feb 2024 17:55:37 +0100 Subject: [PATCH 1/3] create proposa_04_CM_guard_guard --- .../proposals/proposal_04_CM_guard_goerli.js | 57 +++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 scripts/proposals/proposal_04_CM_guard_goerli.js diff --git a/scripts/proposals/proposal_04_CM_guard_goerli.js b/scripts/proposals/proposal_04_CM_guard_goerli.js new file mode 100644 index 0000000..1a8d096 --- /dev/null +++ b/scripts/proposals/proposal_04_CM_guard_goerli.js @@ -0,0 +1,57 @@ +/*global process*/ + +const { ethers } = require("hardhat"); + +async function main() { + const fs = require("fs"); + const globalsFile = "globals.json"; + const dataFromJSON = fs.readFileSync(globalsFile, "utf8"); + let parsedData = JSON.parse(dataFromJSON); + + const timelockAddress = parsedData.timelockAddress; + const treasuryAddress = parsedData.treasuryAddress; + const depositoryAddress = "0x5FDc466f4A7547c876eF40CD30fFA2A89F1EcDE7"; + const serviceRegistryTokenUtilityAddress = "0x6d9b08701Af43D68D991c074A27E4d90Af7f2276"; + const serviceRegistryL2PolygonAddress = "0xf805DfF246CC208CD2F08ffaD242b7C32bc93623"; + const serviceRegistryTokenUtilityPolygonAddress="0x131b5551c81e9B3E89E9ACE30A5B3D45144E3e42"; + const serviceRegistryL2GnosisAddress = "0x31D3202d8744B16A120117A053459DDFAE93c855"; + const serviceRegistryTokenUtilityGnosisAddress = "0xc2c7E40674f1C7Bb99eFe5680Efd79842502bED4"; + const guardCMAddress = parsedData.guardCMAddress; + const AMBContractProxyForeignAddress = "0x87A19d769D875964E9Cd41dDBfc397B2543764E6"; + const homeMediatorAddress = "0x670Ac235EE13C0B2a5065282bBB0c61cfB354592"; + const fxRootAddress = "0x3d1d3E34f7fB6D26245E6640E1c50710eFFf15bA"; + const fxGovernorTunnelAddress = "0x17806E2a12d5E0F48C9803cd397DB3F044DA3b77"; + const CMAddress = parsedData.CM; + + + + // Obtaining proposal values + console.log("Guard CM setup"); + const guardCM = await ethers.getContractAt("GuardCM", guardCMAddress); + const targets = [guardCMAddress, guardCMAddress]; + const values = new Array(2).fill(0); + const callDatas = [ + guardCM.interface.encodeFunctionData("setBridgeMediatorChainIds", [[AMBContractProxyForeignAddress, fxRootAddress], + [homeMediatorAddress, fxGovernorTunnelAddress], ["10200", "80001"]]), + guardCM.interface.encodeFunctionData("setTargetSelectorChainIds", [[treasuryAddress, treasuryAddress, depositoryAddress, + serviceRegistryTokenUtilityAddress, serviceRegistryL2PolygonAddress, serviceRegistryTokenUtilityPolygonAddress, serviceRegistryL2GnosisAddress, + serviceRegistryTokenUtilityGnosisAddress], + ["0x8456cb59", "0x8f202bf9", "0x58d3ec6a", "0xece53132", "0x9890220b","0xece53132", "0x9890220b", "0xece53132"], + [5, 5, 5, 5, 80001, 80001, 10200, 10200], + [true, true, true, true, true, true, true, true]]) + ]; + const description = "Guard CM setup"; + + // Proposal details + console.log("targets:", targets); + console.log("values:", values); + console.log("call datas:", callDatas); + console.log("description:", description); +} + +main() + .then(() => process.exit(0)) + .catch((error) => { + console.error(error); + process.exit(1); + }); From d116783e35bbca275edabf192625ae9d55893e6e Mon Sep 17 00:00:00 2001 From: mariapiamo Date: Fri, 9 Feb 2024 18:19:00 +0100 Subject: [PATCH 2/3] gitleaks --- .gitleaksignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitleaksignore b/.gitleaksignore index ebb0bb6..d7f87c7 100644 --- a/.gitleaksignore +++ b/.gitleaksignore @@ -47,3 +47,5 @@ ad016dbb808b6fa8c8a6a689a7140d68e868414d:scripts/deployment/globals_goerli.json: c91f775ec4afeb1737af25b8325201c090d48c23:scripts/proposals/proposal_04_CM_guard.js:generic-api-key:14 c91f775ec4afeb1737af25b8325201c090d48c23:scripts/proposals/proposal_04_CM_guard.js:generic-api-key:17 c91f775ec4afeb1737af25b8325201c090d48c23:scripts/deployment/globals_mainnet.json:generic-api-key:2 +ac5929932dad792efef12b2860753ca90bc4b3de:scripts/proposals/proposal_04_CM_guard_goerli.js:generic-api-key:14 +ac5929932dad792efef12b2860753ca90bc4b3de:scripts/proposals/proposal_04_CM_guard_goerli.js:generic-api-key:18 From 95c063271d8edb61ca83a1c4c44b106d6e0e6976 Mon Sep 17 00:00:00 2001 From: Aleksandr Kuperman Date: Fri, 9 Feb 2024 18:39:33 +0000 Subject: [PATCH 3/3] chore: gitleaksignore --- .gitleaksignore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitleaksignore b/.gitleaksignore index d7f87c7..7091a3a 100644 --- a/.gitleaksignore +++ b/.gitleaksignore @@ -49,3 +49,6 @@ c91f775ec4afeb1737af25b8325201c090d48c23:scripts/proposals/proposal_04_CM_guard. c91f775ec4afeb1737af25b8325201c090d48c23:scripts/deployment/globals_mainnet.json:generic-api-key:2 ac5929932dad792efef12b2860753ca90bc4b3de:scripts/proposals/proposal_04_CM_guard_goerli.js:generic-api-key:14 ac5929932dad792efef12b2860753ca90bc4b3de:scripts/proposals/proposal_04_CM_guard_goerli.js:generic-api-key:18 +c91f775ec4afeb1737af25b8325201c090d48c23:scripts/deployment/globals_mainnet.json:generic-api-key:1 +52a1209b5f91ae48f0c44a0ca968f69a6461d6a8:scripts/proposals/proposal_04_CM_guard_goerli.js:generic-api-key:14 +52a1209b5f91ae48f0c44a0ca968f69a6461d6a8:scripts/proposals/proposal_04_CM_guard_goerli.js:generic-api-key:18