Skip to content

Commit

Permalink
update scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
invocamanman committed Feb 8, 2024
1 parent 6a9951c commit c379383
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 5 deletions.
20 changes: 19 additions & 1 deletion tools/addRollupType/addRollupType.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ async function main() {
* Check that every necessary parameter is fullfilled
*/
const mandatoryDeploymentParameters = [
"description",
"forkID",
"consensusContract",
"polygonRollupManagerAddress",
Expand All @@ -41,6 +42,7 @@ async function main() {
}

const {
description,
rollupCompatibilityID,
forkID,
consensusContract,
Expand Down Expand Up @@ -103,6 +105,8 @@ async function main() {
[deployer] = await ethers.getSigners();
}

console.log("Using with: ", deployer.address);

// Load Rollup manager
const PolgonRollupManagerFactory = await ethers.getContractFactory("PolygonRollupManager", deployer);
const rollupManagerContract = PolgonRollupManagerFactory.attach(
Expand Down Expand Up @@ -135,6 +139,20 @@ async function main() {
);
await PolygonconsensusContract.waitForDeployment();

console.log("#######################\n");
console.log(`new PolygonconsensusContract impl: ${PolygonconsensusContract.target}`);

console.log("you can verify the new impl address with:");
console.log(
`npx hardhat verify --constructor-args upgrade/arguments.js ${PolygonconsensusContract.target} --network ${process.env.HARDHAT_NETWORK}\n`
);
console.log("Copy the following constructor arguments on: upgrade/arguments.js \n", [
polygonZkEVMGlobalExitRootAddress,
polTokenAddress,
polygonZkEVMBridgeAddress,
polygonRollupManagerAddress,
]);

// Add a new rollup type with timelock
console.log(
await (
Expand All @@ -144,7 +162,7 @@ async function main() {
forkID,
rollupCompatibilityID,
genesis.root,
JSON.stringify(genesis)
description
)
).wait()
);
Expand Down
20 changes: 19 additions & 1 deletion tools/addRollupType/addRollupTypeTimelock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ async function main() {
* Check that every necessary parameter is fullfilled
*/
const mandatoryDeploymentParameters = [
"description",
"forkID",
"consensusContract",
"polygonRollupManagerAddress",
Expand All @@ -40,6 +41,7 @@ async function main() {
}

const {
description,
rollupCompatibilityID,
forkID,
consensusContract,
Expand Down Expand Up @@ -105,6 +107,8 @@ async function main() {
[deployer] = await ethers.getSigners();
}

console.log("Using with: ", deployer.address);

// Load Rollup manager
const PolgonRollupManagerFactory = await ethers.getContractFactory("PolygonRollupManager", deployer);

Expand All @@ -120,6 +124,20 @@ async function main() {
);
await PolygonconsensusContract.waitForDeployment();

console.log("#######################\n");
console.log(`new PolygonconsensusContract impl: ${PolygonconsensusContract.target}`);

console.log("you can verify the new impl address with:");
console.log(
`npx hardhat verify --constructor-args upgrade/arguments.js ${PolygonconsensusContract.target} --network ${process.env.HARDHAT_NETWORK}\n`
);
console.log("Copy the following constructor arguments on: upgrade/arguments.js \n", [
polygonZkEVMGlobalExitRootAddress,
polTokenAddress,
polygonZkEVMBridgeAddress,
polygonRollupManagerAddress,
]);

// load timelock
const timelockContractFactory = await ethers.getContractFactory("PolygonZkEVMTimelock", deployer);

Expand All @@ -132,7 +150,7 @@ async function main() {
forkID,
rollupCompatibilityID,
genesis.root,
JSON.stringify(genesis),
description,
]),
ethers.ZeroHash, // predecesoor
salt // salt
Expand Down
4 changes: 2 additions & 2 deletions tools/addRollupType/add_rollup_type.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
"polygonZkEVMGlobalExitRootAddress": "0x580bda1e7A0CFAe92Fa7F6c20A3794F169CE3CFb",
"polTokenAddress": "0x455e53CBB86018Ac2B8092FdCd39d8444aFFC3F6",
"verifierAddress": "0x1C3A3da552b8662CD69538356b1E7c2E9CC1EBD8",
"description": "0.0.1",
"description": "Type: Validium, Version: etrog, genesis: /ipfs/QmUXnRoPbUmZuEZCGyiHjEsoNcFVu3hLtSvhpnfBS2mAYU",
"forkID": 7,
"rollupCompatibilityID": 0,
"timelockDelay": 0,
"timelockDelay": 864000,
"timelockSalt": "",
"gasTokenAddress":"",
"deployerPvtKey": "",
Expand Down
2 changes: 1 addition & 1 deletion tools/addRollupType/add_rollup_type.json.example
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"polygonZkEVMGlobalExitRootAddress": "0x580bda1e7A0CFAe92Fa7F6c20A3794F169CE3CFb",
"polTokenAddress": "0x455e53CBB86018Ac2B8092FdCd39d8444aFFC3F6",
"verifierAddress": "0x1C3A3da552b8662CD69538356b1E7c2E9CC1EBD8",
"description": "Type: zkEVM, Version: etrog",
"description": "Type: zkEVM, Version: etrog, genesis: /ipfs/QmUXnRoPbUmZuEZCGyiHjEsoNcFVu3hLtSvhpnfBS2mAYU",
"forkID": 7,
"rollupCompatibilityID": 0,
"timelockDelay": 0,
Expand Down

0 comments on commit c379383

Please sign in to comment.