From 9bdd5f9550d8785d6d87f67af818c061d1fbeb15 Mon Sep 17 00:00:00 2001
From: mariapiamo <mariapia.moscatiello@valory.xyz>
Date: Fri, 19 Jan 2024 16:05:42 +0100
Subject: [PATCH 01/11] create proposal_05

---
 scripts/proposals/proposal_05_CM_guard.js | 78 +++++++++++++++++++++++
 1 file changed, 78 insertions(+)
 create mode 100644 scripts/proposals/proposal_05_CM_guard.js

diff --git a/scripts/proposals/proposal_05_CM_guard.js b/scripts/proposals/proposal_05_CM_guard.js
new file mode 100644
index 0000000..72c5d19
--- /dev/null
+++ b/scripts/proposals/proposal_05_CM_guard.js
@@ -0,0 +1,78 @@
+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 signers = await ethers.getSigners();
+    const safeThreshold = 7;
+    const AddressZero = "0x" + "0".repeat(40);
+
+    // Deploy Safe multisig
+    const safeSigners = signers.slice(1, 10).map(currentElement => currentElement.address);
+
+    const GnosisSafe = await ethers.getContractFactory("GnosisSafe");
+    const gnosisSafe = await GnosisSafe.deploy();
+    await gnosisSafe.deployed();
+
+    const GnosisSafeProxyFactory = await ethers.getContractFactory("GnosisSafeProxyFactory");
+    const gnosisSafeProxyFactory = await GnosisSafeProxyFactory.deploy();
+    await gnosisSafeProxyFactory.deployed();
+
+    // Create a multisig that will be the service owner
+    const setupData = gnosisSafe.interface.encodeFunctionData(
+        "setup",
+        [safeSigners, safeThreshold, AddressZero, "0x", AddressZero, AddressZero, 0, AddressZero]
+    );
+    const proxyAddress = await safeContracts.calculateProxyAddress(gnosisSafeProxyFactory, gnosisSafe.address, setupData, 0);
+    await gnosisSafeProxyFactory.createProxyWithNonce(gnosisSafe.address, setupData, 0).then(tx => tx.wait());
+
+    // Get the multisig
+    const multisig = await ethers.getContractAt("GnosisSafe", proxyAddress);
+    const nonce = await multisig.nonce();
+
+    const parsedData = JSON.parse(dataFromJSON);
+
+    const timelockAddress = parsedData.timelockAddress;
+    const guardCMAddress = parsedData.guardCMAddress;
+
+    /*
+    // Manually set gas limit and gas price
+    const gasLimit = 500000;  // Adjust this value based on your needs
+    const gasPrice = ethers.utils.parseUnits("50", "gwei");  // Adjust this value based on current gas prices
+
+    */ 
+    
+    // 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 = [guardCMAddress];
+    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);
+
+    // Send the transaction with manually set gas limit and gas price
+    const tx = await multisig.submitTransaction(targets, values, callDatas, 0, description, { gasLimit, gasPrice });
+    await tx.wait();
+
+    console.log("Transaction successful");
+}
+
+main()
+    .then(() => process.exit(0))
+    .catch((error) => {
+        console.error(error);
+        process.exit(1);
+    });

From 40395161b96f504bc80661231502a590d533db40 Mon Sep 17 00:00:00 2001
From: mariapiamo <mariapia.moscatiello@valory.xyz>
Date: Fri, 19 Jan 2024 16:09:19 +0100
Subject: [PATCH 02/11] fix

---
 scripts/proposals/proposal_05_CM_guard.js | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/scripts/proposals/proposal_05_CM_guard.js b/scripts/proposals/proposal_05_CM_guard.js
index 72c5d19..1819f35 100644
--- a/scripts/proposals/proposal_05_CM_guard.js
+++ b/scripts/proposals/proposal_05_CM_guard.js
@@ -38,13 +38,12 @@ async function main() {
     const timelockAddress = parsedData.timelockAddress;
     const guardCMAddress = parsedData.guardCMAddress;
 
-    /*
+    
     // Manually set gas limit and gas price
     const gasLimit = 500000;  // Adjust this value based on your needs
     const gasPrice = ethers.utils.parseUnits("50", "gwei");  // Adjust this value based on current gas prices
 
-    */ 
-    
+
     // Construct the payload for the multisig to swap the guard by the Timelock
     const txHashData = await safeContracts.buildContractCall(multisig, "setGuard", [guardCMAddress], nonce, 0, 0);
 

From ea8a2480cb44ead9d0d18e420cb36c86f822c84e Mon Sep 17 00:00:00 2001
From: mariapiamo <mariapia.moscatiello@valory.xyz>
Date: Fri, 19 Jan 2024 16:13:02 +0100
Subject: [PATCH 03/11] fix

---
 scripts/proposals/proposal_05_CM_guard.js | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/proposals/proposal_05_CM_guard.js b/scripts/proposals/proposal_05_CM_guard.js
index 1819f35..371be1e 100644
--- a/scripts/proposals/proposal_05_CM_guard.js
+++ b/scripts/proposals/proposal_05_CM_guard.js
@@ -46,7 +46,7 @@ async function main() {
 
     // Construct the payload for the multisig to swap the guard by the Timelock
     const txHashData = await safeContracts.buildContractCall(multisig, "setGuard", [guardCMAddress], nonce, 0, 0);
-
+    parsedData.CM
     console.log("Set new guard via Timelock Module");
 
     const targets = [guardCMAddress];

From d9e918cfa91285e3403b0bd9264852c10afe7a6f Mon Sep 17 00:00:00 2001
From: Aleksandr Kuperman <aleksandr.kuperman@valory.xyz>
Date: Fri, 19 Jan 2024 15:23:38 +0000
Subject: [PATCH 04/11] chore: governance script

---
 scripts/proposals/proposal_05_CM_guard.js | 43 ++---------------------
 1 file changed, 3 insertions(+), 40 deletions(-)

diff --git a/scripts/proposals/proposal_05_CM_guard.js b/scripts/proposals/proposal_05_CM_guard.js
index 371be1e..9e56a03 100644
--- a/scripts/proposals/proposal_05_CM_guard.js
+++ b/scripts/proposals/proposal_05_CM_guard.js
@@ -5,50 +5,19 @@ async function main() {
     const fs = require("fs");
     const globalsFile = "globals.json";
     const dataFromJSON = fs.readFileSync(globalsFile, "utf8");
-
-    const signers = await ethers.getSigners();
-    const safeThreshold = 7;
-    const AddressZero = "0x" + "0".repeat(40);
-
-    // Deploy Safe multisig
-    const safeSigners = signers.slice(1, 10).map(currentElement => currentElement.address);
-
-    const GnosisSafe = await ethers.getContractFactory("GnosisSafe");
-    const gnosisSafe = await GnosisSafe.deploy();
-    await gnosisSafe.deployed();
-
-    const GnosisSafeProxyFactory = await ethers.getContractFactory("GnosisSafeProxyFactory");
-    const gnosisSafeProxyFactory = await GnosisSafeProxyFactory.deploy();
-    await gnosisSafeProxyFactory.deployed();
-
-    // Create a multisig that will be the service owner
-    const setupData = gnosisSafe.interface.encodeFunctionData(
-        "setup",
-        [safeSigners, safeThreshold, AddressZero, "0x", AddressZero, AddressZero, 0, AddressZero]
-    );
-    const proxyAddress = await safeContracts.calculateProxyAddress(gnosisSafeProxyFactory, gnosisSafe.address, setupData, 0);
-    await gnosisSafeProxyFactory.createProxyWithNonce(gnosisSafe.address, setupData, 0).then(tx => tx.wait());
+    const parsedData = JSON.parse(dataFromJSON);
 
     // Get the multisig
-    const multisig = await ethers.getContractAt("GnosisSafe", proxyAddress);
+    const multisig = await ethers.getContractAt("GnosisSafe", parsedData.CM);
     const nonce = await multisig.nonce();
 
-    const parsedData = JSON.parse(dataFromJSON);
-
     const timelockAddress = parsedData.timelockAddress;
     const guardCMAddress = parsedData.guardCMAddress;
 
-    
-    // Manually set gas limit and gas price
-    const gasLimit = 500000;  // Adjust this value based on your needs
-    const gasPrice = ethers.utils.parseUnits("50", "gwei");  // Adjust this value based on current gas prices
-
-
     // Construct the payload for the multisig to swap the guard by the Timelock
     const txHashData = await safeContracts.buildContractCall(multisig, "setGuard", [guardCMAddress], nonce, 0, 0);
-    parsedData.CM
-    console.log("Set new guard via Timelock Module");
 
+    console.log("Set new guard via Timelock Module");
     const targets = [guardCMAddress];
     const values = new Array(1).fill(0);
     const callDatas = [
@@ -61,12 +30,6 @@ async function main() {
     console.log("values:", values);
     console.log("call datas:", callDatas);
     console.log("description:", description);
-
-    // Send the transaction with manually set gas limit and gas price
-    const tx = await multisig.submitTransaction(targets, values, callDatas, 0, description, { gasLimit, gasPrice });
-    await tx.wait();
-
-    console.log("Transaction successful");
 }
 
 main()

From 315db969e64f91be368626b58bce68147d1d64ff Mon Sep 17 00:00:00 2001
From: Aleksandr Kuperman <aleksandr.kuperman@valory.xyz>
Date: Fri, 19 Jan 2024 15:28:56 +0000
Subject: [PATCH 05/11] chore: adding new mainnet guard CM address

---
 docs/configuration.json                 | 2 +-
 scripts/deployment/globals_mainnet.json | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

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..46a87f1 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","serviceRegistryTokenUtilityAddress":"0x3Fb926116D454b95c669B6Bf2E7c3bad8d19affA","bridgedERC20Address":"0x06512E620A8317da51a73690A596Aca97287b31D","fxRootAddress":"0xfe5e5D361b2ad62c541bAb87C45a0B9B018389a2","childTokenAddress":"0x62309056c759c36879Cde93693E7903bF415E4Bc","checkpointManagerAddress":"0x86E4Dc95c7FBdBf52e33D563BbDB00823894C287","fxERC20RootTunnelAddress":"0x1737408def992AF04b29C8Ba4BBcD7397B08c930", "fxERC20ChildTunnelAddress": "0x1fe74A08ac89300B102AdCd474C721AE8764E850"}
\ No newline at end of file

From 8162d94eb663bf1c10573cff3bf53404eb9b4ac7 Mon Sep 17 00:00:00 2001
From: Aleksandr Kuperman <aleksandr.kuperman@valory.xyz>
Date: Fri, 19 Jan 2024 15:32:57 +0000
Subject: [PATCH 06/11] chore: proposal script

---
 scripts/proposals/proposal_05_CM_guard.js | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/scripts/proposals/proposal_05_CM_guard.js b/scripts/proposals/proposal_05_CM_guard.js
index 9e56a03..a816bee 100644
--- a/scripts/proposals/proposal_05_CM_guard.js
+++ b/scripts/proposals/proposal_05_CM_guard.js
@@ -1,3 +1,5 @@
+/*global process*/
+
 const { ethers } = require("hardhat");
 const safeContracts = require("@gnosis.pm/safe-contracts");
 
@@ -18,7 +20,7 @@ async function main() {
     const txHashData = await safeContracts.buildContractCall(multisig, "setGuard", [guardCMAddress], nonce, 0, 0);
 
     console.log("Set new guard via Timelock Module");
-    const targets = [guardCMAddress];
+    const targets = [multisig.address];
     const values = new Array(1).fill(0);
     const callDatas = [
         multisig.interface.encodeFunctionData("execTransactionFromModule", [txHashData.to, 0, txHashData.data, txHashData.operation])

From 08d16c9a651b41479a82904eb20bcbd1fc755792 Mon Sep 17 00:00:00 2001
From: Aleksandr Kuperman <aleksandr.kuperman@valory.xyz>
Date: Fri, 19 Jan 2024 15:33:48 +0000
Subject: [PATCH 07/11] chore: gitleaksignore

---
 .gitleaksignore | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/.gitleaksignore b/.gitleaksignore
index cfa9849..b45add4 100644
--- a/.gitleaksignore
+++ b/.gitleaksignore
@@ -36,3 +36,5 @@ 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

From 9130483988064a1bf0c11ec0293c486d80dac5a3 Mon Sep 17 00:00:00 2001
From: Aleksandr Kuperman <aleksandr.kuperman@valory.xyz>
Date: Fri, 19 Jan 2024 15:34:49 +0000
Subject: [PATCH 08/11] chore: gitleaksignore

---
 .gitleaksignore | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/.gitleaksignore b/.gitleaksignore
index b45add4..c4e1be2 100644
--- a/.gitleaksignore
+++ b/.gitleaksignore
@@ -38,3 +38,5 @@ ad016dbb808b6fa8c8a6a689a7140d68e868414d:scripts/deployment/globals_goerli.json:
 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

From c91f775ec4afeb1737af25b8325201c090d48c23 Mon Sep 17 00:00:00 2001
From: Aleksandr Kuperman <aleksandr.kuperman@valory.xyz>
Date: Fri, 19 Jan 2024 18:06:47 +0000
Subject: [PATCH 09/11] chore: adding guard CM related proposals

---
 scripts/deployment/globals_mainnet.json   |  2 +-
 scripts/proposals/proposal_04_CM_guard.js | 32 ++++++++++++++++-------
 2 files changed, 23 insertions(+), 11 deletions(-)

diff --git a/scripts/deployment/globals_mainnet.json b/scripts/deployment/globals_mainnet.json
index 46a87f1..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":"0x7bB7998b210cFfE10ca1e41f16341Abe53f76f3a","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..e3df38e 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);

From 94e15412c565a69e020dcbb9d814c21b4a30b8e5 Mon Sep 17 00:00:00 2001
From: Aleksandr Kuperman <aleksandr.kuperman@valory.xyz>
Date: Fri, 19 Jan 2024 18:08:41 +0000
Subject: [PATCH 10/11] chore: gitleaksignore

---
 .gitleaksignore | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/.gitleaksignore b/.gitleaksignore
index c4e1be2..851757c 100644
--- a/.gitleaksignore
+++ b/.gitleaksignore
@@ -40,3 +40,7 @@ ad016dbb808b6fa8c8a6a689a7140d68e868414d:scripts/deployment/globals_goerli.json:
 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

From 6bf002a0d025a426515fbb68da549c4e6a1b6e8f Mon Sep 17 00:00:00 2001
From: Aleksandr Kuperman <aleksandr.kuperman@valory.xyz>
Date: Fri, 19 Jan 2024 18:10:41 +0000
Subject: [PATCH 11/11] chore: gitleaksignore

---
 .gitleaksignore                           | 3 +++
 scripts/proposals/proposal_04_CM_guard.js | 6 +++---
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/.gitleaksignore b/.gitleaksignore
index 851757c..ebb0bb6 100644
--- a/.gitleaksignore
+++ b/.gitleaksignore
@@ -44,3 +44,6 @@ ad016dbb808b6fa8c8a6a689a7140d68e868414d:scripts/deployment/globals_goerli.json:
 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/scripts/proposals/proposal_04_CM_guard.js b/scripts/proposals/proposal_04_CM_guard.js
index e3df38e..b96bae2 100644
--- a/scripts/proposals/proposal_04_CM_guard.js
+++ b/scripts/proposals/proposal_04_CM_guard.js
@@ -35,9 +35,9 @@ async function main() {
         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]])
+        ["0x8456cb59", "0x8f202bf9", "0x58d3ec6a", "0xece53132", "0x9890220b", "0x9890220b", "0xece53132"],
+        [1, 1, 1, 1, 137, 100, 100],
+        [true, true, true, true, true, true, true]])
     ];
     const description = "Guard CM setup";