diff --git a/deployment/v2/4_createRollup.ts b/deployment/v2/4_createRollup.ts index d2edb5b33..0e16b57ee 100644 --- a/deployment/v2/4_createRollup.ts +++ b/deployment/v2/4_createRollup.ts @@ -319,6 +319,7 @@ async function main() { outputJson.createRollupBlock = blockDeploymentRollup.number; outputJson.rollupAddress = newZKEVMAddress; outputJson.verifierAddress = verifierContract.target; + outputJson.consensusContract = consensusContract; fs.writeFileSync(pathOutputJson, JSON.stringify(outputJson, null, 1)); } diff --git a/deployment/v2/verifyContracts.js b/deployment/v2/verifyContracts.js index 32724e331..8c5390ae3 100644 --- a/deployment/v2/verifyContracts.js +++ b/deployment/v2/verifyContracts.js @@ -166,24 +166,48 @@ async function main() { expect(error.message.toLowerCase().includes('already verified')).to.be.equal(true); } - // verify zkEVM address - try { - await hre.run( - 'verify:verify', - { - contract: 'contracts/v2/consensus/zkEVM/PolygonZkEVMEtrog.sol:PolygonZkEVMEtrog', - address: createRollupOutputParameters.rollupAddress, - constructorArguments: [ - deployOutputParameters.polygonZkEVMGlobalExitRootAddress, - deployOutputParameters.polTokenAddress, - deployOutputParameters.polygonZkEVMBridgeAddress, - deployOutputParameters.polygonRollupManager, - ], - }, - ); - } catch (error) { - // expect(error.message.toLowerCase().includes('proxyadmin')).to.be.equal(true); + // verify zkEVM address or validium + + if (createRollupOutputParameters.consensusContract == "PolygonZkEVMEtrog") { + try { + await hre.run( + 'verify:verify', + { + contract: 'contracts/v2/consensus/zkEVM/PolygonZkEVMEtrog.sol:PolygonZkEVMEtrog', + address: createRollupOutputParameters.rollupAddress, + constructorArguments: [ + deployOutputParameters.polygonZkEVMGlobalExitRootAddress, + deployOutputParameters.polTokenAddress, + deployOutputParameters.polygonZkEVMBridgeAddress, + deployOutputParameters.polygonRollupManager, + ], + }, + ); + } catch (error) { + // expect(error.message.toLowerCase().includes('proxyadmin')).to.be.equal(true); + } + } else { + if(createRollupOutputParameters.consensusContract == "PolygonValidiumEtrog") { + try { + await hre.run( + 'verify:verify', + { + contract: 'contracts/v2/consensus/validium/PolygonValidiumEtrog.sol:PolygonValidiumEtrog', + address: createRollupOutputParameters.rollupAddress, + constructorArguments: [ + deployOutputParameters.polygonZkEVMGlobalExitRootAddress, + deployOutputParameters.polTokenAddress, + deployOutputParameters.polygonZkEVMBridgeAddress, + deployOutputParameters.polygonRollupManager, + ], + }, + ); + } catch (error) { + // expect(error.message.toLowerCase().includes('proxyadmin')).to.be.equal(true); + } + } } + } main()