Skip to content
This repository has been archived by the owner on Nov 27, 2024. It is now read-only.

Commit

Permalink
Deploy fake verifier, hardhat config tweaks, inline documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Stefan-Ethernal committed Mar 19, 2024
1 parent ab04405 commit d378a7b
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ contract CDKValidiumUpgraded is CDKValidium {
* @param _dataCommitteeAddress Data committee address
* @param _chainID L2 chainID
* @param _forkID Fork Id
* @param versionBeforeUpgrade Initial version
*/
constructor(
IPolygonZkEVMGlobalExitRoot _globalExitRootManager,
Expand Down
3 changes: 3 additions & 0 deletions deploy_verifier_parameters.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"realVerifier": false
}
17 changes: 15 additions & 2 deletions hardhat.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ module.exports = {
{
version: "0.8.20",
settings: {
evmVersion: 'paris',
evmVersion: "paris",
optimizer: {
enabled: true,
runs: 999999
Expand Down Expand Up @@ -64,7 +64,19 @@ module.exports = {
}
}
}
]
],
overrides: {
"contracts/upgraded/CDKValidiumUpgraded.sol": {
version: "0.8.20",
settings: {
optimizer: {
enabled: true,
runs: 9999,
},
evmVersion: "paris",
},
},
},
},
networks: {
mainnet: {
Expand Down Expand Up @@ -114,6 +126,7 @@ module.exports = {
},
localhost: {
url: 'http://127.0.0.1:8545',
chainId: parseInt(process.env.L1_CHAIN_ID),
accounts: {
mnemonic: process.env.MNEMONIC || DEFAULT_MNEMONIC,
path: "m/44'/60'/0'/0",
Expand Down
16 changes: 13 additions & 3 deletions upgrade/deployVerifier.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
const { ethers } = require('hardhat');
const path = require('path');
require('dotenv').config({ path: path.resolve(__dirname, '../.env') });
const deployParameters = require("./deploy_verifier_parameters.json");

async function main() {
let currentProvider = ethers.provider;
let deployer;
Expand All @@ -17,9 +19,17 @@ async function main() {
/*
* Deploy verifier
*/
const VerifierRollup = await ethers.getContractFactory('FflonkVerifier', deployer);
const verifierContract = await VerifierRollup.deploy();
await verifierContract.deployed();

let verifierContract;
if (deployParameters.realVerifier === true) {
const VerifierRollup = await ethers.getContractFactory("FflonkVerifier", deployer);
verifierContract = await VerifierRollup.deploy();
await verifierContract.deployed();
} else {
const VerifierRollupHelperFactory = await ethers.getContractFactory("VerifierRollupHelperMock", deployer);
verifierContract = await VerifierRollupHelperFactory.deploy();
await verifierContract.deployed();
}

console.log('#######################\n');
console.log('Verifier deployed to:', verifierContract.address);
Expand Down
3 changes: 3 additions & 0 deletions upgrade/deploy_verifier_parameters.json.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"realVerifier": true,
}

0 comments on commit d378a7b

Please sign in to comment.