- node version: 14.x
- npm version: 7.x
In project root execute:
npm i
cp .env.example .env
Fill .env
with your MNEMONIC
and INFURA_PROJECT_ID
If you want to verify the contracts also fill the ETHERSCAN_API_KEY
cd deployment
cp deploy_parameters.json.example deploy_parameters.json
Fill created deploy_parameters.json
with appropiate parameters.
See below for more information about the deploy_parameters.json
The first step is deploying and verifying the PolygonZkEVMDeployer
, this will be the factory for deterministic contracts, the address of the contracts will depend on the salt
and the initialZkEVMDeployerOwner
This contrat is deployed using a keyless deployment, therefore the gasPrice is hardcoded.
The value is on 100 gweis
, if it's necessary to update it go to helpers/deployment-helpers.js
and update the gasPriceKeylessDeployment
constant.
Note that this operation will change all the deterministic address deployed.
npm run deploy:deployer:ZkEVM:goerli
npm run verify:deployer:ZkEVM:goerli
To deploy on testnet is necessary a token MATIC contract, therefore, there's another script that previously to the actual deployment, deploys a matic contracts and adds it automatically to the deploy_parameters.json
To deploy on testnet use:deploy:testnet:ZkEVM:${network}
In other cases use fullfill maticTokenAddress
in the deploy_parameters.json
and run deploy:ZkEVM:${network}
npm run deploy:testnet:ZkEVM:goerli
To verify contracts use npm run verify:ZkEVM:${network}
npm run verify:ZkEVM:goerli
A new folder will be created witth the following name deployments/${network}_$(date +%s)
with all the output information and the OZ proxy information.
realVerifier
: bool, Indicates whether deploy a real verifier or nottrustedSequencerURL
: string, trustedSequencer URLnetworkName
: string, networkNameversion
:string, will just be emitted at initialization of the contract, usefull just for synchronizertrustedSequencer
: address, trusted sequencer addressschainID
: uint64, chainID of the zkEVMtrustedAggregator
: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 consolidatedforkID
: uint64, Fork ID of the zkEVM, indicates the prover (zkROM/executor) versionadmin
:address, Admin address, can adjust PolygonZkEVM parameters or stop the emergency statezkEVMOwner
: address, Able to put the PolygonZkEVM into emergency state (kill switch)timelockAddress
: address, Timelock owner address, able to send start an upgradability process via timelockminDelayTimelock
: number, Minimum timelock delay,salt
: bytes32, Salt used inPolygonZkEVMDeployer
to deploy deterministic contracts, such as the PolygonZkEVMBridgeinitialZkEVMDeployerOwner
: address, Initial owner of thePolygonZkEVMDeployer
maticTokenAddress
: address, Matic token address, only if deploy on testnet can be left blank and will fullfilled by the scripts.zkEVMDeployerAddress
: address, Address of thePolygonZkEVMDeployer
. Can be left blank, will be fullfilled automatically with thedeploy:deployer:ZkEVM:goerli
script.
deployerPvtKey
: string, pvtKey of the deployer, overrides the address inMNEMONIC
of.env
if existmaxFeePerGas
:string, SetmaxFeePerGas
, must define aswellmaxPriorityFeePerGas
to use itmaxPriorityFeePerGas
:string, SetmaxPriorityFeePerGas
, must define aswellmaxFeePerGas
to use itmultiplierGas
: number, Gas multiplier with 3 decimals. IfmaxFeePerGas
andmaxPriorityFeePerGas
are set, this will not take effect
- Since there are deterministic address you cannot deploy twice on the same network using the same
salt
andinitialZkEVMDeployerOwner
. Changing one of them is enough to make a new deployment. - It's mandatory to delete the
.openzeppelin
upgradebility information in order to make a new deployment genesis.json
has been generated using the tool:1_createGenesis
, this script depends on thedeploy_parameters
aswell.