Skip to content

Commit

Permalink
further checks
Browse files Browse the repository at this point in the history
  • Loading branch information
invocamanman committed Feb 12, 2024
1 parent 9958fb8 commit 11468f1
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 4 deletions.
8 changes: 4 additions & 4 deletions hardhat.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ const config: HardhatUserConfig = {
},
},
polygonZKEVMTestnet: {
url: "https://rpc.public.zkevm-test.net",
url: "https://rpc.cardona.zkevm-rpc.com",
accounts: {
mnemonic: process.env.MNEMONIC || DEFAULT_MNEMONIC,
path: "m/44'/60'/0'/0",
Expand Down Expand Up @@ -268,10 +268,10 @@ const config: HardhatUserConfig = {
},
{
network: "polygonZKEVMTestnet",
chainId: 1442,
chainId: 2442,
urls: {
apiURL: "https://api-testnet-zkevm.polygonscan.com/api",
browserURL: "https://testnet-zkevm.polygonscan.com/",
apiURL: "https://explorer-ui.cardona.zkevm-rpc.com/api",
browserURL: "https://explorer-ui.cardona.zkevm-rpc.com",
},
},
{
Expand Down
56 changes: 56 additions & 0 deletions upgrade/upgradeToV2/mainnet_1706364989/testFork.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ async function main() {
)) as PolygonZkEVM;

const lastBatchSequenced = await polygonZkEVMContract.lastBatchSequenced();
const emergencyCouncilAddress = await polygonZkEVMContract.owner();
const trustedAggregator = await polygonZkEVMContract.trustedAggregator();

await setStorageAt(polygonZkEVMContract.target, 116, lastBatchSequenced);

Expand Down Expand Up @@ -158,6 +160,60 @@ async function main() {
expect(rollupDataFinal.rollupCompatibilityID).to.be.equal(0);

console.log("Updated zkevm Succedd");

//roles
const DEFAULT_ADMIN_ROLE = ethers.ZeroHash;
const ADD_ROLLUP_TYPE_ROLE = ethers.id("ADD_ROLLUP_TYPE_ROLE");
const OBSOLETE_ROLLUP_TYPE_ROLE = ethers.id("OBSOLETE_ROLLUP_TYPE_ROLE");
const CREATE_ROLLUP_ROLE = ethers.id("CREATE_ROLLUP_ROLE");
const ADD_EXISTING_ROLLUP_ROLE = ethers.id("ADD_EXISTING_ROLLUP_ROLE");
const UPDATE_ROLLUP_ROLE = ethers.id("UPDATE_ROLLUP_ROLE");
const TRUSTED_AGGREGATOR_ROLE = ethers.id("TRUSTED_AGGREGATOR_ROLE");
const TRUSTED_AGGREGATOR_ROLE_ADMIN = ethers.id("TRUSTED_AGGREGATOR_ROLE_ADMIN");
const TWEAK_PARAMETERS_ROLE = ethers.id("TWEAK_PARAMETERS_ROLE");
const SET_FEE_ROLE = ethers.id("SET_FEE_ROLE");
const STOP_EMERGENCY_ROLE = ethers.id("STOP_EMERGENCY_ROLE");
const EMERGENCY_COUNCIL_ROLE = ethers.id("EMERGENCY_COUNCIL_ROLE");
const EMERGENCY_COUNCIL_ADMIN = ethers.id("EMERGENCY_COUNCIL_ADMIN");

expect(await rollupManager.globalExitRootManager()).to.be.equal(
deployOutputParameters.polygonZkEVMGlobalExitRootAddress
);
expect(await rollupManager.pol()).to.be.equal(polTokenAddress);
expect(await rollupManager.bridgeAddress()).to.be.equal(deployOutputParameters.polygonZkEVMBridgeAddress);

expect(await rollupManager.pendingStateTimeout()).to.be.equal(deployParameters.pendingStateTimeout);
expect(await rollupManager.trustedAggregatorTimeout()).to.be.equal(deployParameters.trustedAggregatorTimeout);

expect(await rollupManager.getBatchFee()).to.be.equal(ethers.parseEther("0.1"));
expect(await rollupManager.getForcedBatchFee()).to.be.equal(ethers.parseEther("10"));
expect(await rollupManager.calculateRewardPerBatch()).to.be.equal(0);

// Check roles
expect(await rollupManager.hasRole(DEFAULT_ADMIN_ROLE, deployOutputParameters.timelockContractAddress)).to.be.equal(
true
);
expect(
await rollupManager.hasRole(ADD_ROLLUP_TYPE_ROLE, deployOutputParameters.timelockContractAddress)
).to.be.equal(true);
expect(await rollupManager.hasRole(UPDATE_ROLLUP_ROLE, deployOutputParameters.timelockContractAddress)).to.be.equal(
true
);
expect(
await rollupManager.hasRole(ADD_EXISTING_ROLLUP_ROLE, deployOutputParameters.timelockContractAddress)
).to.be.equal(true);

expect(await rollupManager.hasRole(TRUSTED_AGGREGATOR_ROLE, trustedAggregator)).to.be.equal(true);

expect(await rollupManager.hasRole(OBSOLETE_ROLLUP_TYPE_ROLE, deployParameters.admin)).to.be.equal(true);
expect(await rollupManager.hasRole(CREATE_ROLLUP_ROLE, deployParameters.admin)).to.be.equal(true);
expect(await rollupManager.hasRole(TRUSTED_AGGREGATOR_ROLE_ADMIN, deployParameters.admin)).to.be.equal(true);
expect(await rollupManager.hasRole(TWEAK_PARAMETERS_ROLE, deployParameters.admin)).to.be.equal(true);
expect(await rollupManager.hasRole(SET_FEE_ROLE, deployParameters.admin)).to.be.equal(true);
expect(await rollupManager.hasRole(STOP_EMERGENCY_ROLE, deployParameters.admin)).to.be.equal(true);

expect(await rollupManager.hasRole(EMERGENCY_COUNCIL_ROLE, emergencyCouncilAddress)).to.be.equal(true);
expect(await rollupManager.hasRole(EMERGENCY_COUNCIL_ADMIN, emergencyCouncilAddress)).to.be.equal(true);
}

main().catch((e) => {
Expand Down

0 comments on commit 11468f1

Please sign in to comment.