By default the following mnemonic will be used to deploy the smart contracts MNEMONIC="test test test test test test test test test test test junk".
Also the first 20 accounts of this mnemonic will be funded with ether.
The first account of the mnemonic will be the deployer of the smart contracts and therefore the holder of all the MATIC test tokens, which are necessary to pay the sendBatch transactions.
You can change the deployment mnemonic creating a .env file in the project root with the following variable:
MNEMONIC=<YOUR_MENMONIC>
- node version: 14.x
- npm version: 7.x
- docker
- docker-compose
- Complete config
/docker/scripts/v2/create_rollup_parameters_docker.json
test: Flag to point if is a testing environment, in such case, an account with balance will be created at the rollup and no timelock addresses will be usedtimelockAdminAddress: address, Timelock owner address, able to send start an upgradeability process via timelockminDelayTimelock: number, Minimum timelock delay,salt: bytes32, Salt used inPolygonZkEVMDeployerto deploy deterministic contracts, such as the PolygonZkEVMBridgeinitialZkEVMDeployerOwner: address, Initial owner of thePolygonZkEVMDeployeradmin: address, Admin address, can adjust RollupManager parameters or stop the emergency statetrustedAggregator: address, Trusted aggregator addresstrustedAggregatorTimeout: uint64, If a sequence is not verified in this timeout everyone can verify itpendingStateTimeout: uint64, Once a pending state exceeds this timeout it can be consolidated by everyoneemergencyCouncilAddress: address, Emergency council addresspolTokenAddress: address, POL token address, only if deploy on testnet can be left blank and will fulfilled by the scripts.zkEVMDeployerAddress: address, Address of thePolygonZkEVMDeployer. Can be left blank, will be fulfilled automatically with thedeploy:v2:sepoliascriptppVKey: pessimistic program verification key (AgglayerGateway)ppVKeySelector: The 4 bytes selector to add to the pessimistic verification keys (AgglayerGateway)multisigRoleAddress: address, The address that can manage multisig signers and threshold (AgglayerGateway)signersToAdd: array, Array of signer objects with addr and url properties (AgglayerGateway) - optional, defaults to []newThreshold: uint256, Threshold for multisig operations (AgglayerGateway) - optional, defaults to 0deployerPvtKey: string, pvtKey of the deployer, overrides the address inMNEMONICof.envif existmaxFeePerGas: string, SetmaxFeePerGas, must define as wellmaxPriorityFeePerGasto use itmaxPriorityFeePerGas: string, SetmaxPriorityFeePerGas, must define as wellmaxFeePerGasto use itmultiplierGas: number, Gas multiplier with 3 decimals. IfmaxFeePerGasandmaxPriorityFeePerGasare set, this will not take effect
realVerifier: bool, Indicates whether deploy a real verifier or not for the new createdtrustedSequencerURL: string, trustedSequencer URLnetworkName: string, networkNamedescription: string, Description of the new rollup typetrustedSequencer: address, trusted sequencer addresschainID: uint64, chainID of the new rollupadminZkEVM: address, Admin address, can adjust Rollup parametersforkID: uint64, Fork ID of the new rollup, indicates the prover (zkROM/executor) versionconsensusContract: select between consensus contract. Supported:["PolygonZkEVMEtrog", "PolygonValidiumEtrog", "PolygonPessimisticConsensus", "AggchainECDSA", "AggchainFEP"]. This is the name of the consensus of the rollupType of the rollup to be createdgasTokenAddress: Address of the native gas token of the rollup, zero if etherdeployerPvtKey: Not mandatory, used to deploy from specific walletmaxFeePerGas(optional): string, SetmaxFeePerGas, must define as wellmaxPriorityFeePerGasto use itmaxPriorityFeePerGas(optional): string, SetmaxPriorityFeePerGas, must define as wellmaxFeePerGasto use itmultiplierGas(optional): number, Gas multiplier with 3 decimals. IfmaxFeePerGasandmaxPriorityFeePerGasare set, this will not take effectprogramVKey: program key for pessimistic consensusisVanillaClient: Flag for vanilla/sovereign clients handlingaggchainParams: Only mandatory if consensusContract is AggchainECDSA or AggchainFEPinitParams: Only mandatory if consensusContract is AggchainFEPl2BlockTime: The time between L2 blocks in secondsrollupConfigHash: The hash of the chain's rollup configurationstartingOutputRoot: Init output rootstartingBlockNumber: The number of the first L2 blockstartingTimestamp: The timestamp of the first L2 blocksubmissionInterval: The minimum interval in L2 blocks at which checkpoints must be submittedaggchainManager: Address that manages all the functionalities related to the aggchainoptimisticModeManager: Address that can trigger the optimistic modeaggregationVkey: The verification key of the aggregation SP1 program.rangeVkeyCommitment: The 32 byte commitment to the BabyBear representation of the verification key of the range SP1 program.
useDefaultVkeys: bool, flag to use default verification keys from AgglayerGatewayuseDefaultSigners: bool, flag to use default signers from AgglayerGatewayownedAggchainVKey: bytes32, Initial owned aggchain verification keyaggchainVKeySelector: bytes2, Initial aggchain selectorvKeyManager: address, Initial vKeyManager
In project root execute:
npm i
npm run docker:contracts
or
npm i
npm run dockerv2:contracts
A new docker geth-zkevm-contracts:latest will be created
This docker will contain a geth node with the deployed contracts
The deployment output can be found in:
docker/deploymentOutput/create_rollup_output.jsondocker/deploymentOutput/deploy_output.jsondocker/deploymentOutput/genesis.jsondocker/deploymentOutput/genesis_sovereign.json
To run the docker you can use: docker run -p 8545:8545 geth-zkevm-contracts:latest
or
npm i
npm run dockerv2:contracts:all
It's the same docker as before but deploying AggchainECDSA & PolygonPessimisticConsensus.
To create other rollup:
- copy template from
./docker/scripts/v2/create_rollup_parameters_docker-xxxx.jsontodeployment/v2/create_rollup_parameters.json - copy
genesis.json,genesis_sovereign.jsonanddeploy_ouput.json(fromdocker/deploymentOutput) todeployment/v2/ - run
npx hardhat run ./deployment/v2/4_createRollup.ts --network localhost - If you want, you can copy the file that has been generated here (
deployment/v2/create_rollup_output_*.json) to deployment output folder (docker/deploymentOutput)