Skip to content

Commit

Permalink
update docs + fox zeroAddress
Browse files Browse the repository at this point in the history
  • Loading branch information
krlosMata committed Jul 23, 2024
1 parent 3065484 commit f2bd774
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 39 deletions.
5 changes: 0 additions & 5 deletions compiled-contracts/PolygonRollupManager.json
Original file line number Diff line number Diff line change
Expand Up @@ -239,11 +239,6 @@
"name": "OnlyNotEmergencyState",
"type": "error"
},
{
"inputs": [],
"name": "OnlyPessimisticChains",
"type": "error"
},
{
"inputs": [],
"name": "OnlyRollupAdmin",
Expand Down
6 changes: 0 additions & 6 deletions compiled-contracts/PolygonRollupManagerMock.json

Large diffs are not rendered by default.

5 changes: 0 additions & 5 deletions compiled-contracts/PolygonRollupManagerMockInternalTest.json
Original file line number Diff line number Diff line change
Expand Up @@ -239,11 +239,6 @@
"name": "OnlyNotEmergencyState",
"type": "error"
},
{
"inputs": [],
"name": "OnlyPessimisticChains",
"type": "error"
},
{
"inputs": [],
"name": "OnlyRollupAdmin",
Expand Down
6 changes: 0 additions & 6 deletions compiled-contracts/PolygonZkEVMGlobalExitRootV2.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,6 @@
"internalType": "bytes32",
"name": "rollupExitRoot",
"type": "bytes32"
},
{
"indexed": false,
"internalType": "bytes32",
"name": "currentL1InfoRoot",
"type": "bytes32"
}
],
"name": "UpdateL1InfoTree",
Expand Down
19 changes: 10 additions & 9 deletions tools/addRollupType/addRollupType.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ async function main() {
"polygonRollupManagerAddress",
"verifierAddress",
"rollupCompatibilityID",
"genesisRoot"
"genesisRoot",
];

for (const parameterName of mandatoryDeploymentParameters) {
Expand All @@ -47,7 +47,7 @@ async function main() {
consensusContract,
polygonRollupManagerAddress,
verifierAddress,
genesisRoot
genesisRoot,
} = addRollupParameters;

const supportedConensus = ["PolygonZkEVMEtrog", "PolygonValidiumEtrog"];
Expand Down Expand Up @@ -117,21 +117,19 @@ async function main() {

// Sanity checks genesisRoot
if (genesisRoot !== genesis.root) {
throw new Error(
`Genesis root in the 'add_rollup_type.json' does not match the root in the 'genesis.json'`
);
throw new Error(`Genesis root in the 'add_rollup_type.json' does not match the root in the 'genesis.json'`);
}

// get bridge address in genesis file
let genesisBridgeAddress = ethers.constants.AddresZero;
let genesisBridgeAddress = ethers.ZeroAddress;
for (let i = 0; i < genesis.genesis.lenght; i++) {
if (genesis.genesis[i].contractName === 'PolygonZkEVMBridge proxy') {
if (genesis.genesis[i].contractName === "PolygonZkEVMBridge proxy") {
genesisBridgeAddress = genesis.genesis[i].address;
break;
}
}

if (polygonZkEVMBridgeAddress.toLowerCase() !== genesisBridgeAddress ) {
if (polygonZkEVMBridgeAddress.toLowerCase() !== genesisBridgeAddress) {
throw new Error(
`'PolygonZkEVMBridge proxy' root in the 'genesis.json' does not match 'bridgeAddress' in the 'PolygonRollupManager'`
);
Expand All @@ -155,7 +153,10 @@ async function main() {
// Create consensus implementation if needed
let polygonConsensusContractAddress;

if (typeof addRollupParameters.polygonconsensusContract !== 'undefined' && ethers.isAddress(addRollupParameters.polygonconsensusContract)) {
if (
typeof addRollupParameters.polygonconsensusContract !== "undefined" &&
ethers.isAddress(addRollupParameters.polygonconsensusContract)
) {
polygonConsensusContractAddress = addRollupParameters.polygonconsensusContract;
} else {
const PolygonconsensusFactory = (await ethers.getContractFactory(consensusContract, deployer)) as any;
Expand Down
14 changes: 6 additions & 8 deletions tools/addRollupType/addRollupTypeTimelock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ async function main() {
"verifierAddress",
"rollupCompatibilityID",
"timelockDelay",
"genesisRoot"
"genesisRoot",
];

for (const parameterName of mandatoryDeploymentParameters) {
Expand All @@ -48,7 +48,7 @@ async function main() {
polygonRollupManagerAddress,
verifierAddress,
timelockDelay,
genesisRoot
genesisRoot,
} = addRollupParameters;

const salt = addRollupParameters.timelockSalt || ethers.ZeroHash;
Expand Down Expand Up @@ -121,21 +121,19 @@ async function main() {

// Sanity checks genesisRoot
if (genesisRoot !== genesis.root) {
throw new Error(
`Genesis root in the 'add_rollup_type.json' does not match the root in the 'genesis.json'`
);
throw new Error(`Genesis root in the 'add_rollup_type.json' does not match the root in the 'genesis.json'`);
}

// get bridge address in genesis file
let genesisBridgeAddress = ethers.constants.AddresZero;
let genesisBridgeAddress = ethers.ZeroAddress;
for (let i = 0; i < genesis.genesis.lenght; i++) {
if (genesis.genesis[i].contractName === 'PolygonZkEVMBridge proxy') {
if (genesis.genesis[i].contractName === "PolygonZkEVMBridge proxy") {
genesisBridgeAddress = genesis.genesis[i].address;
break;
}
}

if (polygonZkEVMBridgeAddress.toLowerCase() !== genesisBridgeAddress ) {
if (polygonZkEVMBridgeAddress.toLowerCase() !== genesisBridgeAddress) {
throw new Error(
`'PolygonZkEVMBridge proxy' root in the 'genesis.json' does not match 'bridgeAddress' in the 'PolygonRollupManager'`
);
Expand Down

0 comments on commit f2bd774

Please sign in to comment.