Skip to content

Commit

Permalink
test flag
Browse files Browse the repository at this point in the history
  • Loading branch information
invocamanman committed Jan 30, 2024
1 parent 540ad31 commit dcad2b6
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 7 deletions.
2 changes: 1 addition & 1 deletion deployment/v2/1_createGenesis.ts
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,7 @@ async function main() {
address: finalDeployer,
});

if (argv.test) {
if (deployParameters.test) {
// Add tester account with ether
genesis[genesis.length - 1].balance = "100000000000000000000000";
}
Expand Down
20 changes: 14 additions & 6 deletions deployment/v2/3_deployContracts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,8 @@ async function main() {
expect(precalculateRollupManager).to.be.equal(await polygonZkEVMGlobalExitRoot.rollupManager());
}

const timelockAddressRollupManager = deployParameters.test ? deployer.address : timelockContract.target;

// deploy Rollup Manager
console.log("\n#######################");
console.log("##### Deployment Rollup Manager #####");
Expand All @@ -403,7 +405,7 @@ async function main() {
console.log("pendingStateTimeout:", pendingStateTimeout);
console.log("trustedAggregatorTimeout:", trustedAggregatorTimeout);
console.log("admin:", admin);
console.log("timelockContract:", timelockContract.target);
console.log("timelockContract:", timelockAddressRollupManager);
console.log("emergencyCouncilAddress:", emergencyCouncilAddress);

const PolygonRollupManagerFactory = await ethers.getContractFactory("PolygonRollupManagerNotUpgraded", deployer);
Expand All @@ -420,7 +422,7 @@ async function main() {
pendingStateTimeout,
trustedAggregatorTimeout,
admin,
timelockContract.target,
timelockAddressRollupManager,
emergencyCouncilAddress,
ethers.ZeroAddress, // unused parameter
ethers.ZeroAddress, // unused parameter
Expand Down Expand Up @@ -493,12 +495,18 @@ async function main() {
console.log("trustedAggregatorTimeout:", await polygonRollupManagerContract.trustedAggregatorTimeout());

// Check roles
expect(await polygonRollupManagerContract.hasRole(DEFAULT_ADMIN_ROLE, timelockContract.target)).to.be.equal(true);
expect(await polygonRollupManagerContract.hasRole(ADD_ROLLUP_TYPE_ROLE, timelockContract.target)).to.be.equal(true);
expect(await polygonRollupManagerContract.hasRole(UPDATE_ROLLUP_ROLE, timelockContract.target)).to.be.equal(true);
expect(await polygonRollupManagerContract.hasRole(ADD_EXISTING_ROLLUP_ROLE, timelockContract.target)).to.be.equal(
expect(await polygonRollupManagerContract.hasRole(DEFAULT_ADMIN_ROLE, timelockAddressRollupManager)).to.be.equal(
true
);
expect(await polygonRollupManagerContract.hasRole(ADD_ROLLUP_TYPE_ROLE, timelockAddressRollupManager)).to.be.equal(
true
);
expect(await polygonRollupManagerContract.hasRole(UPDATE_ROLLUP_ROLE, timelockAddressRollupManager)).to.be.equal(
true
);
expect(
await polygonRollupManagerContract.hasRole(ADD_EXISTING_ROLLUP_ROLE, timelockAddressRollupManager)
).to.be.equal(true);
expect(await polygonRollupManagerContract.hasRole(TRUSTED_AGGREGATOR_ROLE, trustedAggregator)).to.be.equal(true);

expect(await polygonRollupManagerContract.hasRole(OBSOLETE_ROLLUP_TYPE_ROLE, admin)).to.be.equal(true);
Expand Down
1 change: 1 addition & 0 deletions deployment/v2/deploy_parameters.json.example
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"test": false,
"timelockAdminAddress": "0x617b3a3528F9cDd6630fd3301B9c8911F7Bf063D",
"minDelayTimelock": 3600,
"salt": "0x0000000000000000000000000000000000000000000000000000000000000000",
Expand Down

0 comments on commit dcad2b6

Please sign in to comment.