From 64668066a8ddab657ef195893e4dcaa4757d3b92 Mon Sep 17 00:00:00 2001 From: invocamanman Date: Tue, 30 Jan 2024 10:40:56 +0100 Subject: [PATCH] small scirpts fixes --- deployment/v2/4_createRollup.ts | 8 ++++++++ deployment/v2/deploy_parameters.json.example | 2 +- docker/scripts/v2/deploy_parameters_docker.json | 1 + 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/deployment/v2/4_createRollup.ts b/deployment/v2/4_createRollup.ts index 0e16b57ee..393c52934 100644 --- a/deployment/v2/4_createRollup.ts +++ b/deployment/v2/4_createRollup.ts @@ -137,6 +137,13 @@ async function main() { deployOutput.polygonRollupManager ) as PolygonRollupManager; + const DEFAULT_ADMIN_ROLE = ethers.ZeroHash; + if ((await rollupManagerContract.hasRole(DEFAULT_ADMIN_ROLE, deployer.address)) == false) { + throw new Error( + `Deployer does not have admin role. Use the test flag on deploy_parameters if this is a test deployment` + ); + } + let verifierContract; if (realVerifier === true) { const VerifierRollup = await ethers.getContractFactory("FflonkVerifier", deployer); @@ -155,6 +162,7 @@ async function main() { const CREATE_ROLLUP_ROLE = ethers.id("CREATE_ROLLUP_ROLE"); // Check role: + if ((await rollupManagerContract.hasRole(ADD_ROLLUP_TYPE_ROLE, deployer.address)) == false) await rollupManagerContract.grantRole(ADD_ROLLUP_TYPE_ROLE, deployer.address); diff --git a/deployment/v2/deploy_parameters.json.example b/deployment/v2/deploy_parameters.json.example index db9962e4f..d57ad7c80 100644 --- a/deployment/v2/deploy_parameters.json.example +++ b/deployment/v2/deploy_parameters.json.example @@ -1,5 +1,5 @@ { - "test": false, + "test": true, "timelockAdminAddress": "0x617b3a3528F9cDd6630fd3301B9c8911F7Bf063D", "minDelayTimelock": 3600, "salt": "0x0000000000000000000000000000000000000000000000000000000000000000", diff --git a/docker/scripts/v2/deploy_parameters_docker.json b/docker/scripts/v2/deploy_parameters_docker.json index 982a581da..b58f28476 100644 --- a/docker/scripts/v2/deploy_parameters_docker.json +++ b/docker/scripts/v2/deploy_parameters_docker.json @@ -1,4 +1,5 @@ { + "test": true, "timelockAdminAddress": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266", "minDelayTimelock": 3600, "salt": "0x0000000000000000000000000000000000000000000000000000000000000000",