Skip to main content
Version: 2.0.0-beta-3

UniRep contract deployment

deployUnirep

Deploy Unirep.sol and its verifiers and connect libraries.

export const deployUnirep = async (
deployer: ethers.Signer,
_settings: CircuitConfig = CircuitConfig.default,
prover?: Prover
): Promise<Unirep>

For example:

import { ethers } from 'ethers'
import { Unirep } from '@unirep/contracts'
import { deployUnirep } from '@unirep/contracts/deploy'
const privateKey = 'YOUR/PRIVATE/KEY'
const provider = 'YOUR/ETH/PROVIDER'
const deployer = new ethers.Wallet(privateKey, provider);
const unirepContract: Unirep = await deployUnirep(deployer)
caution

The default circuit configuration is set in CircuitConfig.ts.
Please make sure the CircuitConfig matches your prover.

If you don't compile circuits on your own, please don't change the _settings and prover.
See the current prover and settings of deployed contracts: 🤝 Testnet Deployment.