Skip to main content
Version: 1.0.1

1. deploy

Spin up the testing chain with

npx hardhat node

Use the hardhat testing chain as an example config.

const PROVIDER = 'http://127.0.0.1:8545/'
const PRIVATE_KEY= '0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80'
deploy.ts
import { ethers } from 'ethers'
import { deployUnirep } from '@unirep/contracts/deploy'

async function main(){
const provider = await ethers.getDefaultProvider(PROVIDER)
const signer = new ethers.Wallet(
PRIVATE_KEY,
provider
)
const contract = await deployUnirep(
signer
)
console.log("Unirep address: ", contract.address)
}

main();