Skip to content

Commit

Permalink
feat: use v2 zkevm verifier during initial deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
Thegaram committed Aug 30, 2024
1 parent 4ad655b commit 04de613
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
3 changes: 3 additions & 0 deletions scripts/deterministic/Constants.sol
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,6 @@ string constant BRIDGE_HISTORY_CONFIG_PATH = "./volume/bridge-history-config.jso
string constant BALANCE_CHECKER_CONFIG_PATH = "./volume/balance-checker-config.json";
string constant FRONTEND_ENV_PATH = "./volume/frontend-config";
string constant ROLLUP_EXPLORER_BACKEND_CONFIG_PATH = "./volume/rollup-explorer-backend-config.json";

// plonk verifier configs
bytes32 constant V4_VERIFIER_DIGEST = 0x0a1904dbfff4614fb090b4b3864af4874f12680c32f07889e9ede8665097e5ec;
18 changes: 10 additions & 8 deletions scripts/deterministic/DeployScroll.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import {L1WETHGateway} from "../../src/L1/gateways/L1WETHGateway.sol";
import {L2GasPriceOracle} from "../../src/L1/rollup/L2GasPriceOracle.sol";
import {MultipleVersionRollupVerifier} from "../../src/L1/rollup/MultipleVersionRollupVerifier.sol";
import {ScrollChain} from "../../src/L1/rollup/ScrollChain.sol";
import {ZkEvmVerifierV1} from "../../src/libraries/verifier/ZkEvmVerifierV1.sol";
import {ZkEvmVerifierV2} from "../../src/libraries/verifier/ZkEvmVerifierV2.sol";
import {GasTokenExample} from "../../src/alternative-gas-token/GasTokenExample.sol";
import {L1ScrollMessengerNonETH} from "../../src/alternative-gas-token/L1ScrollMessengerNonETH.sol";
import {L1GasTokenGateway} from "../../src/alternative-gas-token/L1GasTokenGateway.sol";
Expand Down Expand Up @@ -132,7 +132,7 @@ contract DeployScroll is DeterminsticDeployment {
address internal L1_WETH_GATEWAY_IMPLEMENTATION_ADDR;
address internal L1_WETH_GATEWAY_PROXY_ADDR;
address internal L1_WHITELIST_ADDR;
address internal L1_ZKEVM_VERIFIER_V1_ADDR;
address internal L1_ZKEVM_VERIFIER_V2_ADDR;
address internal L2_GAS_PRICE_ORACLE_IMPLEMENTATION_ADDR;
address internal L2_GAS_PRICE_ORACLE_PROXY_ADDR;
address internal L1_GAS_TOKEN_ADDR;
Expand Down Expand Up @@ -349,7 +349,7 @@ contract DeployScroll is DeterminsticDeployment {
deployL1ScrollChainProxy();
deployL1ScrollMessengerProxy();
deployL1EnforcedTxGateway();
deployL1ZkEvmVerifierV1();
deployL1ZkEvmVerifier();
deployL1MultipleVersionRollupVerifier();
deployL1MessageQueue();
deployL1ScrollChain();
Expand Down Expand Up @@ -550,16 +550,18 @@ contract DeployScroll is DeterminsticDeployment {
);
}

function deployL1ZkEvmVerifierV1() private {
bytes memory args = abi.encode(notnull(L1_PLONK_VERIFIER_ADDR));
L1_ZKEVM_VERIFIER_V1_ADDR = deploy("L1_ZKEVM_VERIFIER_V1", type(ZkEvmVerifierV1).creationCode, args);
function deployL1ZkEvmVerifier() private {
bytes memory args = abi.encode(notnull(L1_PLONK_VERIFIER_ADDR), V4_VERIFIER_DIGEST);
L1_ZKEVM_VERIFIER_V2_ADDR = deploy("L1_ZKEVM_VERIFIER_V2", type(ZkEvmVerifierV2).creationCode, args);
}

function deployL1MultipleVersionRollupVerifier() private {
uint256[] memory _versions = new uint256[](1);
address[] memory _verifiers = new address[](1);
_versions[0] = 1;
_verifiers[0] = notnull(L1_ZKEVM_VERIFIER_V1_ADDR);

// register V4 verifier: DarwinV2 upgrade, plonk verifier v0.13.1
_versions[0] = 4;
_verifiers[0] = notnull(L1_ZKEVM_VERIFIER_V2_ADDR);

bytes memory args = abi.encode(DEPLOYER_ADDR, _versions, _verifiers);

Expand Down

0 comments on commit 04de613

Please sign in to comment.