Skip to content

Commit

Permalink
first deployment done
Browse files Browse the repository at this point in the history
  • Loading branch information
invocamanman committed Jan 25, 2024
1 parent 7907eb9 commit 95a7b0c
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 8 deletions.
1 change: 1 addition & 0 deletions deployment/v2/4_createRollup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ async function main() {

deployOutput.genesis = genesis.root;
deployOutput.newZKEVMAddress = newZKEVMAddress;
deployOutput.verifierAddress = verifierContract.target;

fs.writeFileSync(pathOutputJson, JSON.stringify(deployOutput, null, 1));
}
Expand Down
49 changes: 42 additions & 7 deletions deployment/v2/verifyContracts.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,12 @@ async function main() {
const polTokenSymbol = "POL";
const polTokenInitialBalance = ethers.parseEther("20000000");

const polTokenFactory = await ethers.getContractFactory("ERC20PermitMock", deployer);

try {
// verify governance
await hre.run(
'verify:verify',
{
address: deployOutputParameters.maticTokenAddress,
address: deployOutputParameters.polTokenAddress,
constructorArguments: [
polTokenName,
polTokenSymbol,
Expand Down Expand Up @@ -122,18 +120,55 @@ async function main() {
await hre.run(
'verify:verify',
{
contract: "@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol:TransparentUpgradeableProxy",
address: deployOutputParameters.polygonZkEVMBridgeAddress,
constructorArguments: [
await upgrades.erc1967.getImplementationAddress(deployOutputParameters.polygonZkEVMBridgeAddress),
await upgrades.erc1967.getAdminAddress(deployOutputParameters.polygonZkEVMBridgeAddress),
"0x"
]
},
);
} catch (error) {
expect(error.message.toLowerCase().includes('proxyadmin')).to.be.equal(true);
//expect(error.message.toLowerCase().includes('proxyadmin')).to.be.equal(true);
}

// verify zkEVM address
try {

try {
await hre.run(
'verify:verify',
{
address: deployOutputParameters.polygonZkEVMBridgeAddress,
},
);
} catch (error) {
//expect(error.message.toLowerCase().includes('proxyadmin')).to.be.equal(true);
}

try {
await hre.run(
'verify:verify',
{
contract: "contracts/v2/lib/PolygonTransparentProxy.sol:PolygonTransparentProxy",
address: deployOutputParameters.newZKEVMAddress,
constructorArguments: [
await upgrades.erc1967.getImplementationAddress(deployOutputParameters.newZKEVMAddress),
await upgrades.erc1967.getAdminAddress(deployOutputParameters.newZKEVMAddress),
"0x"
]
},
);
} catch (error) {
//expect(error.message.toLowerCase().includes('proxyadmin')).to.be.equal(true);
}


// verify zkEVM address
try {
await hre.run(
'verify:verify',
{
contract: "contracts/v2/consensus/zkEVM/PolygonZkEVMV2.sol:PolygonZkEVMV2",
address: deployOutputParameters.newZKEVMAddress,
constructorArguments: [
deployOutputParameters.polygonZkEVMGlobalExitRootAddress,
Expand All @@ -144,7 +179,7 @@ async function main() {
},
);
} catch (error) {
expect(error.message.toLowerCase().includes('proxyadmin')).to.be.equal(true);
//expect(error.message.toLowerCase().includes('proxyadmin')).to.be.equal(true);
}
}

Expand Down
11 changes: 11 additions & 0 deletions hardhat.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,17 @@ const config: HardhatUserConfig = {
evmVersion: "shanghai",
}, // try yul optimizer
},
// Should have the same optimizations than the RollupManager to verify
"contracts/v2/lib/PolygonTransparentProxy.sol": {
version: "0.8.20",
settings: {
optimizer: {
enabled: true,
runs: 10,
},
evmVersion: "shanghai",
}, // try yul optimizer
},
},
},
networks: {
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@
"deploy:v2:localhost": "rm -f .openzeppelin/unknown-31337.json && npx ts-node deployment/v2/1_createGenesis.ts --test && npx hardhat run deployment/v2/2_deployPolygonZKEVMDeployer.ts --network localhost && npx hardhat run deployment/v2/3_deployContracts.ts --network localhost && npx hardhat run deployment/v2/4_createRollup.ts --network localhost",
"deploy:testnet:v2:localhost": "rm -f deployment/v2/deploy_ongoing.json && npm run prepare:testnet:ZkEVM:localhost && npm run deploy:v2:localhost",
"deploy:v2:goerli": "npx ts-node deployment/v2/1_createGenesis.ts && npx hardhat run deployment/v2/2_deployPolygonZKEVMDeployer.ts --network goerli && npx hardhat run deployment/v2/3_deployContracts.ts --network goerli && npx hardhat run deployment/v2/4_createRollup.ts --network goerli",
"deploy:testnet:v2:goerli": "rm -f deployment/v2/deploy_ongoing.json && npm run prepare:testnet:ZkEVM:goerli && npm run deploy:v2:goerli"
"deploy:testnet:v2:goerli": "rm -f deployment/v2/deploy_ongoing.json && npm run prepare:testnet:ZkEVM:goerli && npm run deploy:v2:goerli",
"verify:v2:goerli": "npx hardhat run deployment/v2/verifyContracts.js --network goerli"
}
}

0 comments on commit 95a7b0c

Please sign in to comment.