Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

create proposa_04_CM_guard_goerli #113

Merged
merged 3 commits into from
Feb 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .gitleaksignore
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,8 @@ 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
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
57 changes: 57 additions & 0 deletions scripts/proposals/proposal_04_CM_guard_goerli.js
Original file line number Diff line number Diff line change
@@ -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;

Check warning on line 11 in scripts/proposals/proposal_04_CM_guard_goerli.js

View workflow job for this annotation

GitHub Actions / build

'timelockAddress' is assigned a value but never used
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;

Check warning on line 24 in scripts/proposals/proposal_04_CM_guard_goerli.js

View workflow job for this annotation

GitHub Actions / build

'CMAddress' is assigned a value but never used



// 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);
});
Loading