diff --git a/.gitleaksignore b/.gitleaksignore index cfa9849..ebb0bb6 100644 --- a/.gitleaksignore +++ b/.gitleaksignore @@ -36,3 +36,14 @@ bd442a4d40914bfc4d062cc5625b5b3d532328d8:scripts/deployment/globals_goerli.json: bd442a4d40914bfc4d062cc5625b5b3d532328d8:scripts/deployment/globals_goerli.json:generic-api-key:2 ad016dbb808b6fa8c8a6a689a7140d68e868414d:scripts/deployment/globals_goerli.json:generic-api-key:1 ad016dbb808b6fa8c8a6a689a7140d68e868414d:scripts/deployment/globals_goerli.json:generic-api-key:2 +84085316cf76a2b672b04ebb059d6708513d60ec:scripts/deployment/globals_mainnet.json:generic-api-key:1 +84085316cf76a2b672b04ebb059d6708513d60ec:scripts/deployment/globals_mainnet.json:generic-api-key:2 +315db969e64f91be368626b58bce68147d1d64ff:scripts/deployment/globals_mainnet.json:generic-api-key:1 +315db969e64f91be368626b58bce68147d1d64ff:scripts/deployment/globals_mainnet.json:generic-api-key:2 +6000d77e8fe678f7e4b0c025bdac834183825afd:scripts/deployment/globals_mainnet.json:generic-api-key:1 +6000d77e8fe678f7e4b0c025bdac834183825afd:scripts/deployment/globals_mainnet.json:generic-api-key:2 +6000d77e8fe678f7e4b0c025bdac834183825afd:scripts/proposals/proposal_04_CM_guard.js:generic-api-key:17 +6000d77e8fe678f7e4b0c025bdac834183825afd:scripts/proposals/proposal_04_CM_guard.js:generic-api-key:14 +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 diff --git a/docs/configuration.json b/docs/configuration.json index 609ce0e..1bc76c7 100644 --- a/docs/configuration.json +++ b/docs/configuration.json @@ -36,7 +36,7 @@ { "name": "GuardCM", "artifact": "abis/0.8.23/GuardCM.json", - "address": "0x1a0bADb278dE44E261DEC9f4225E3DD761336DA8" + "address": "0x7bB7998b210cFfE10ca1e41f16341Abe53f76f3a" }, { "name": "BridgedERC20", diff --git a/scripts/deployment/globals_mainnet.json b/scripts/deployment/globals_mainnet.json index def9f17..8252f6d 100644 --- a/scripts/deployment/globals_mainnet.json +++ b/scripts/deployment/globals_mainnet.json @@ -1 +1 @@ -{"contractVerification":true,"useLedger":true,"valoryMultisig":"0x87cc0d34f6111c8A7A4Bdf758a9a715A3675f941","derivationPath":"m/44'/60'/2'/0/0","CM":"0x04C06323Fe3D53Deb7364c0055E1F68458Cc2570","providerName":"mainnet","olasSaltString":"0xeb2a22b27c7ad5eee424fd90b376c745e60f914e25fe2b399268300038939d65","timelockMinDelay":"13091","veOlasSaltString":"0xeb2a22b27c7ad5eee424fd90b376c745e60f914e8c4b6f56e64f24010eba714f","initialVotingDelay":"13091","initialVotingPeriod":"19636","initialProposalThreshold":"5000000000000000000000","quorum":"3","initSupply":"526500000000000000000000000","timelockSupply":"100000000000000000000000000","saleSupply":"292874580000000000000000000","valorySupply":"133625420000000000000000000","GnosisSafe":"0xd9Db270c1B5E3Bd161E8c8503c55cEABeE709552","GnosisSafeProxyFactory":"0xa6B71E26C5e0845f74c812102Ca7114b6a896AB2","MultiSendCallOnly":"0x40A2aCCbd92BCA938b02010E17A5b8929b49130D","deploymentFactory":"0x9338b5153AE39BB89f50468E608eD9d764B755fD","olasAddress":"0x0001A500A6B18995B03f44bb040A5fFc28E45CB0","timelockAddress":"0x3C1fF68f5aa342D296d4DEe4Bb1cACCA912D95fE","veOLASAddress":"0x7e01A500805f8A52Fad229b3015AD130A332B7b3","governorAddress":"0x34C895f302D0b5cf52ec0Edd3945321EB0f83dd5","buOLASAddress":"0xb09CcF0Dbf0C178806Aaee28956c74bd66d21f73","wveOLASAddress":"0x4039B809E0C0Ad04F6Fc880193366b251dDf4B40","governorTwoAddress":"0x8E84B5055492901988B831817e4Ace5275A3b401","treasuryAddress":"0xa0DA53447C0f6C4987964d8463da7e6628B30f82","guardCMAddress":"0x1a0bADb278dE44E261DEC9f4225E3DD761336DA8","depositoryAddress":"0xfF8697d8d2998d6AA2e09B405795C6F4BEeB0C81","serviceRegistryTokenUtilityAddress":"0x3Fb926116D454b95c669B6Bf2E7c3bad8d19affA","bridgedERC20Address":"0x06512E620A8317da51a73690A596Aca97287b31D","fxRootAddress":"0xfe5e5D361b2ad62c541bAb87C45a0B9B018389a2","childTokenAddress":"0x62309056c759c36879Cde93693E7903bF415E4Bc","checkpointManagerAddress":"0x86E4Dc95c7FBdBf52e33D563BbDB00823894C287","fxERC20RootTunnelAddress":"0x1737408def992AF04b29C8Ba4BBcD7397B08c930", "fxERC20ChildTunnelAddress": "0x1fe74A08ac89300B102AdCd474C721AE8764E850"} \ No newline at end of file +{"contractVerification":true,"useLedger":true,"valoryMultisig":"0x87cc0d34f6111c8A7A4Bdf758a9a715A3675f941","derivationPath":"m/44'/60'/2'/0/0","CM":"0x04C06323Fe3D53Deb7364c0055E1F68458Cc2570","providerName":"mainnet","olasSaltString":"0xeb2a22b27c7ad5eee424fd90b376c745e60f914e25fe2b399268300038939d65","timelockMinDelay":"13091","veOlasSaltString":"0xeb2a22b27c7ad5eee424fd90b376c745e60f914e8c4b6f56e64f24010eba714f","initialVotingDelay":"13091","initialVotingPeriod":"19636","initialProposalThreshold":"5000000000000000000000","quorum":"3","initSupply":"526500000000000000000000000","timelockSupply":"100000000000000000000000000","saleSupply":"292874580000000000000000000","valorySupply":"133625420000000000000000000","GnosisSafe":"0xd9Db270c1B5E3Bd161E8c8503c55cEABeE709552","GnosisSafeProxyFactory":"0xa6B71E26C5e0845f74c812102Ca7114b6a896AB2","MultiSendCallOnly":"0x40A2aCCbd92BCA938b02010E17A5b8929b49130D","deploymentFactory":"0x9338b5153AE39BB89f50468E608eD9d764B755fD","olasAddress":"0x0001A500A6B18995B03f44bb040A5fFc28E45CB0","timelockAddress":"0x3C1fF68f5aa342D296d4DEe4Bb1cACCA912D95fE","veOLASAddress":"0x7e01A500805f8A52Fad229b3015AD130A332B7b3","governorAddress":"0x34C895f302D0b5cf52ec0Edd3945321EB0f83dd5","buOLASAddress":"0xb09CcF0Dbf0C178806Aaee28956c74bd66d21f73","wveOLASAddress":"0x4039B809E0C0Ad04F6Fc880193366b251dDf4B40","governorTwoAddress":"0x8E84B5055492901988B831817e4Ace5275A3b401","treasuryAddress":"0xa0DA53447C0f6C4987964d8463da7e6628B30f82","guardCMAddress":"0x7bB7998b210cFfE10ca1e41f16341Abe53f76f3a","depositoryAddress":"0xfF8697d8d2998d6AA2e09B405795C6F4BEeB0C81","bridgedERC20Address":"0x06512E620A8317da51a73690A596Aca97287b31D","fxRootAddress":"0xfe5e5D361b2ad62c541bAb87C45a0B9B018389a2","childTokenAddress":"0x62309056c759c36879Cde93693E7903bF415E4Bc","checkpointManagerAddress":"0x86E4Dc95c7FBdBf52e33D563BbDB00823894C287","fxERC20RootTunnelAddress":"0x1737408def992AF04b29C8Ba4BBcD7397B08c930", "fxERC20ChildTunnelAddress": "0x1fe74A08ac89300B102AdCd474C721AE8764E850"} \ No newline at end of file diff --git a/scripts/proposals/proposal_04_CM_guard.js b/scripts/proposals/proposal_04_CM_guard.js index 0b4e3c5..b96bae2 100644 --- a/scripts/proposals/proposal_04_CM_guard.js +++ b/scripts/proposals/proposal_04_CM_guard.js @@ -8,26 +8,38 @@ async function main() { const dataFromJSON = fs.readFileSync(globalsFile, "utf8"); let parsedData = JSON.parse(dataFromJSON); - const cancellerRole = ethers.utils.id("CANCELLER_ROLE"); const timelockAddress = parsedData.timelockAddress; const treasuryAddress = parsedData.treasuryAddress; const depositoryAddress = parsedData.depositoryAddress; - const serviceRegistryTokenUtilityAddress = parsedData.serviceRegistryTokenUtilityAddress; + const serviceRegistryTokenUtilityAddress = "0x3Fb926116D454b95c669B6Bf2E7c3bad8d19affA"; + const serviceRegistryL2PolygonAddress = "0xE3607b00E75f6405248323A9417ff6b39B244b50"; + const serviceRegistryL2GnosisAddress = "0x9338b5153AE39BB89f50468E608eD9d764B755fD"; + const serviceRegistryTokenUtilityGnosisAddress = "0xa45E64d13A30a51b91ae0eb182e88a40e9b18eD8"; const guardCMAddress = parsedData.guardCMAddress; + const AMBContractProxyForeignAddress = "0x4C36d2919e407f0Cc2Ee3c993ccF8ac26d9CE64e"; + const homeMediatorAddress = "0x15bd56669F57192a97dF41A2aa8f4403e9491776"; + const fxRootAddress = parsedData.fxRootAddress; + const fxGovernorTunnelAddress = "0x9338b5153AE39BB89f50468E608eD9d764B755fD"; const CMAddress = parsedData.CM; + + // Obtaining proposal values - console.log("Revoking canceller role of CM in the Timelock, updating proposal Id and enabling selectors"); - const timelock = await ethers.getContractAt("Timelock", timelockAddress); + console.log("Guard CM setup"); const guardCM = await ethers.getContractAt("GuardCM", guardCMAddress); - const targets = [guardCMAddress, guardCMAddress, timelockAddress]; - const values = new Array(3).fill(0); + const targets = [guardCMAddress, guardCMAddress]; + const values = new Array(2).fill(0); const callDatas = [ - guardCM.interface.encodeFunctionData("changeGovernorCheckProposalId", ["88250008686885504216650933897987879122244685460173810624866685274624741477673"]), - guardCM.interface.encodeFunctionData("setTargetSelectors", [[treasuryAddress, treasuryAddress, depositoryAddress, serviceRegistryTokenUtilityAddress], [0x8456cb59, 0x8f202bf9, 0x58d3ec6a, 0xece53132], [true, true, true, true]]), - timelock.interface.encodeFunctionData("revokeRole", [cancellerRole, CMAddress]) + guardCM.interface.encodeFunctionData("setBridgeMediatorChainIds", [[AMBContractProxyForeignAddress, fxRootAddress], + [homeMediatorAddress, fxGovernorTunnelAddress], ["100", "137"]]), + guardCM.interface.encodeFunctionData("setTargetSelectorChainIds", [[treasuryAddress, treasuryAddress, depositoryAddress, + serviceRegistryTokenUtilityAddress, serviceRegistryL2PolygonAddress, serviceRegistryL2GnosisAddress, + serviceRegistryTokenUtilityGnosisAddress], + ["0x8456cb59", "0x8f202bf9", "0x58d3ec6a", "0xece53132", "0x9890220b", "0x9890220b", "0xece53132"], + [1, 1, 1, 1, 137, 100, 100], + [true, true, true, true, true, true, true]]) ]; - const description = "Timelock to revoke CM roles"; + const description = "Guard CM setup"; // Proposal details console.log("targets:", targets); diff --git a/scripts/proposals/proposal_05_CM_guard.js b/scripts/proposals/proposal_05_CM_guard.js new file mode 100644 index 0000000..a816bee --- /dev/null +++ b/scripts/proposals/proposal_05_CM_guard.js @@ -0,0 +1,42 @@ +/*global process*/ + +const { ethers } = require("hardhat"); +const safeContracts = require("@gnosis.pm/safe-contracts"); + +async function main() { + const fs = require("fs"); + const globalsFile = "globals.json"; + const dataFromJSON = fs.readFileSync(globalsFile, "utf8"); + const parsedData = JSON.parse(dataFromJSON); + + // Get the multisig + const multisig = await ethers.getContractAt("GnosisSafe", parsedData.CM); + const nonce = await multisig.nonce(); + + const timelockAddress = parsedData.timelockAddress; + const guardCMAddress = parsedData.guardCMAddress; + + // Construct the payload for the multisig to swap the guard by the Timelock + const txHashData = await safeContracts.buildContractCall(multisig, "setGuard", [guardCMAddress], nonce, 0, 0); + + console.log("Set new guard via Timelock Module"); + const targets = [multisig.address]; + const values = new Array(1).fill(0); + const callDatas = [ + multisig.interface.encodeFunctionData("execTransactionFromModule", [txHashData.to, 0, txHashData.data, txHashData.operation]) + ]; + const description = "Timelock to change guard via module and select selects"; + + // 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); + });