mirror of
https://github.com/semaphore-protocol/semaphore.git
synced 2026-01-10 07:08:17 -05:00
refactor: update scripts and tasks to deploy contracts
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@@ -63,8 +63,6 @@ node_modules/
|
||||
# Production
|
||||
build
|
||||
dist
|
||||
deployed-contracts/undefined.json
|
||||
deployed-contracts/localhost.json
|
||||
docs/*
|
||||
!docs/CNAME
|
||||
!docs/index.html
|
||||
|
||||
@@ -1,74 +1,24 @@
|
||||
[
|
||||
{
|
||||
"name": "Verifier16",
|
||||
"address": "0x6143ECd9Fd1A00EDe1046d456f8aab53a7D71609"
|
||||
{
|
||||
"verifiers": {
|
||||
"Verifier16": "0x6143ECd9Fd1A00EDe1046d456f8aab53a7D71609",
|
||||
"Verifier17": "0xAc12fFFE354D6446eb50dd33E683B78FED73Fb02",
|
||||
"Verifier18": "0x610aeF0F2da3CD1C8bDefe4BDB434Ee146E0C701",
|
||||
"Verifier19": "0x5477725177035bbC9d70443eb921D29749D6FCb4",
|
||||
"Verifier20": "0x3fB2C0988a37b76e760c44e6516aF720935f3136",
|
||||
"Verifier21": "0xDc8f6B8A42836d4566256f4c6C53131DFD127DF8",
|
||||
"Verifier22": "0x6962b5e706be5278eeCb01c286b50A48484632f2",
|
||||
"Verifier23": "0x41e4796Bd89B4BF04013b559c93fC32E9a2BdF6B",
|
||||
"Verifier24": "0xD528B1D1408ab3583af4694F92b0aFEbE33d5b60",
|
||||
"Verifier25": "0x1683a27EF9c10c5286dB56412E1272cD0Ca733e7",
|
||||
"Verifier26": "0x78194bB665d1E33b97eE45B1A755c15717E94C00",
|
||||
"Verifier27": "0x997Dac00E6701Ef7F3518280E5a9922801126E42",
|
||||
"Verifier28": "0xDd3C7f4cBA2467aE41c0F614A3c3E24bC80268c6",
|
||||
"Verifier29": "0xe53eF12093933D5df5691EAbA3821bD1c1EB60Cd",
|
||||
"Verifier30": "0x7FeA07c536ABBB0E7FB3c833376EE4EaDc21340e",
|
||||
"Verifier31": "0xe4539a592df18936202480FBe77E47DE012F2178",
|
||||
"Verifier32": "0x98c90845A7870e215cBd7265DDC653E6c07032F4"
|
||||
},
|
||||
{
|
||||
"name": "Verifier17",
|
||||
"address": "0xAc12fFFE354D6446eb50dd33E683B78FED73Fb02"
|
||||
},
|
||||
{
|
||||
"name": "Verifier18",
|
||||
"address": "0x610aeF0F2da3CD1C8bDefe4BDB434Ee146E0C701"
|
||||
},
|
||||
{
|
||||
"name": "Verifier19",
|
||||
"address": "0x5477725177035bbC9d70443eb921D29749D6FCb4"
|
||||
},
|
||||
{
|
||||
"name": "Verifier20",
|
||||
"address": "0x3fB2C0988a37b76e760c44e6516aF720935f3136"
|
||||
},
|
||||
{
|
||||
"name": "Verifier21",
|
||||
"address": "0xDc8f6B8A42836d4566256f4c6C53131DFD127DF8"
|
||||
},
|
||||
{
|
||||
"name": "Verifier22",
|
||||
"address": "0x6962b5e706be5278eeCb01c286b50A48484632f2"
|
||||
},
|
||||
{
|
||||
"name": "Verifier23",
|
||||
"address": "0x41e4796Bd89B4BF04013b559c93fC32E9a2BdF6B"
|
||||
},
|
||||
{
|
||||
"name": "Verifier24",
|
||||
"address": "0xD528B1D1408ab3583af4694F92b0aFEbE33d5b60"
|
||||
},
|
||||
{
|
||||
"name": "Verifier25",
|
||||
"address": "0x1683a27EF9c10c5286dB56412E1272cD0Ca733e7"
|
||||
},
|
||||
{
|
||||
"name": "Verifier26",
|
||||
"address": "0x78194bB665d1E33b97eE45B1A755c15717E94C00"
|
||||
},
|
||||
{
|
||||
"name": "Verifier27",
|
||||
"address": "0x997Dac00E6701Ef7F3518280E5a9922801126E42"
|
||||
},
|
||||
{
|
||||
"name": "Verifier28",
|
||||
"address": "0xDd3C7f4cBA2467aE41c0F614A3c3E24bC80268c6"
|
||||
},
|
||||
{
|
||||
"name": "Verifier29",
|
||||
"address": "0xe53eF12093933D5df5691EAbA3821bD1c1EB60Cd"
|
||||
},
|
||||
{
|
||||
"name": "Verifier30",
|
||||
"address": "0x7FeA07c536ABBB0E7FB3c833376EE4EaDc21340e"
|
||||
},
|
||||
{
|
||||
"name": "Verifier31",
|
||||
"address": "0xe4539a592df18936202480FBe77E47DE012F2178"
|
||||
},
|
||||
{
|
||||
"name": "Verifier32",
|
||||
"address": "0x98c90845A7870e215cBd7265DDC653E6c07032F4"
|
||||
},
|
||||
{
|
||||
"name": "Semaphore",
|
||||
"address": "0x49281E30F17A30808a6ce538f979d539747e6707"
|
||||
}
|
||||
]
|
||||
"Semaphore": "0x49281E30F17A30808a6ce538f979d539747e6707",
|
||||
"PoseidonT3": "0xe0c8d1e53D9Bfc9071F6564755FCFf6cC0dB61d0",
|
||||
"IncrementalBinaryTree": "0x9fCea5E9aF68D5B0c55A1003b49284d70BffC1A9"
|
||||
}
|
||||
|
||||
@@ -1,74 +1,22 @@
|
||||
[
|
||||
{
|
||||
"name": "Verifier16",
|
||||
"address": "0xA5253ba39381Aa99c4C2C5A4D5C2deC036d06629"
|
||||
{
|
||||
"verifiers": {
|
||||
"Verifier16": "0xA5253ba39381Aa99c4C2C5A4D5C2deC036d06629",
|
||||
"Verifier17": "0xe0418A5f8fBF051D6cbc41Ff29855Dd2a02201Ab",
|
||||
"Verifier18": "0x7CdB3336d7d7c55Bce0FB1508594C54521656797",
|
||||
"Verifier19": "0xbd870921d8A5398a3314C950d1fc63b8C3AB190B",
|
||||
"Verifier20": "0x2a96c5696F85e3d2aa918496806B5c5a4D93E099",
|
||||
"Verifier21": "0x5Ec7d851a52A2a25CEc528F42a7ACA8EcF4667Cd",
|
||||
"Verifier22": "0x919d3d9c05FA7411e334deA5a763354fC7B6aA5b",
|
||||
"Verifier23": "0x63917b00a6dA7865bEfdd107AfC83CC2e6BDE552",
|
||||
"Verifier24": "0xd05CAd7d940114c1419098EE3cEA0776ab510E7D",
|
||||
"Verifier25": "0x6D9862e6140D94E932d94c8BcE74a0BDD0ea5ACb",
|
||||
"Verifier26": "0x8c29e0b77e32f704F03eeCE01c041192A5EB6c77",
|
||||
"Verifier27": "0x066cC22f8CA2A8D90D7Ff77D8a10A27e629c9c4C",
|
||||
"Verifier28": "0x698F9507f504E2BD238be7da56E8D9fee60C6D15",
|
||||
"Verifier29": "0xbBfC2E201C3c3c6F50063c3Edb4746c6Fcb36346",
|
||||
"Verifier30": "0x06bcD633988c1CE7Bd134DbE2C12119b6f3E4bD1",
|
||||
"Verifier31": "0x133b69Ce47BF20C49368354914DF47519Ca6cCFE",
|
||||
"Verifier32": "0xe2978F79cb4AF62e5C990EE5c7E12fb22ee22e2D"
|
||||
},
|
||||
{
|
||||
"name": "Verifier17",
|
||||
"address": "0xe0418A5f8fBF051D6cbc41Ff29855Dd2a02201Ab"
|
||||
},
|
||||
{
|
||||
"name": "Verifier18",
|
||||
"address": "0x7CdB3336d7d7c55Bce0FB1508594C54521656797"
|
||||
},
|
||||
{
|
||||
"name": "Verifier19",
|
||||
"address": "0xbd870921d8A5398a3314C950d1fc63b8C3AB190B"
|
||||
},
|
||||
{
|
||||
"name": "Verifier20",
|
||||
"address": "0x2a96c5696F85e3d2aa918496806B5c5a4D93E099"
|
||||
},
|
||||
{
|
||||
"name": "Verifier21",
|
||||
"address": "0x5Ec7d851a52A2a25CEc528F42a7ACA8EcF4667Cd"
|
||||
},
|
||||
{
|
||||
"name": "Verifier22",
|
||||
"address": "0x919d3d9c05FA7411e334deA5a763354fC7B6aA5b"
|
||||
},
|
||||
{
|
||||
"name": "Verifier23",
|
||||
"address": "0x63917b00a6dA7865bEfdd107AfC83CC2e6BDE552"
|
||||
},
|
||||
{
|
||||
"name": "Verifier24",
|
||||
"address": "0xd05CAd7d940114c1419098EE3cEA0776ab510E7D"
|
||||
},
|
||||
{
|
||||
"name": "Verifier25",
|
||||
"address": "0x6D9862e6140D94E932d94c8BcE74a0BDD0ea5ACb"
|
||||
},
|
||||
{
|
||||
"name": "Verifier26",
|
||||
"address": "0x8c29e0b77e32f704F03eeCE01c041192A5EB6c77"
|
||||
},
|
||||
{
|
||||
"name": "Verifier27",
|
||||
"address": "0x066cC22f8CA2A8D90D7Ff77D8a10A27e629c9c4C"
|
||||
},
|
||||
{
|
||||
"name": "Verifier28",
|
||||
"address": "0x698F9507f504E2BD238be7da56E8D9fee60C6D15"
|
||||
},
|
||||
{
|
||||
"name": "Verifier29",
|
||||
"address": "0xbBfC2E201C3c3c6F50063c3Edb4746c6Fcb36346"
|
||||
},
|
||||
{
|
||||
"name": "Verifier30",
|
||||
"address": "0x06bcD633988c1CE7Bd134DbE2C12119b6f3E4bD1"
|
||||
},
|
||||
{
|
||||
"name": "Verifier31",
|
||||
"address": "0x133b69Ce47BF20C49368354914DF47519Ca6cCFE"
|
||||
},
|
||||
{
|
||||
"name": "Verifier32",
|
||||
"address": "0xe2978F79cb4AF62e5C990EE5c7E12fb22ee22e2D"
|
||||
},
|
||||
{
|
||||
"name": "Semaphore",
|
||||
"address": "0x590CB053A5F429719E6858CeeC56e6bedD4e9cfA"
|
||||
}
|
||||
]
|
||||
"Semaphore": "0x590CB053A5F429719E6858CeeC56e6bedD4e9cfA"
|
||||
}
|
||||
|
||||
@@ -1,74 +0,0 @@
|
||||
[
|
||||
{
|
||||
"name": "Verifier16",
|
||||
"address": "0x5FbDB2315678afecb367f032d93F642f64180aa3"
|
||||
},
|
||||
{
|
||||
"name": "Verifier17",
|
||||
"address": "0xe7f1725E7734CE288F8367e1Bb143E90bb3F0512"
|
||||
},
|
||||
{
|
||||
"name": "Verifier18",
|
||||
"address": "0x9fE46736679d2D9a65F0992F2272dE9f3c7fa6e0"
|
||||
},
|
||||
{
|
||||
"name": "Verifier19",
|
||||
"address": "0xCf7Ed3AccA5a467e9e704C703E8D87F634fB0Fc9"
|
||||
},
|
||||
{
|
||||
"name": "Verifier20",
|
||||
"address": "0xDc64a140Aa3E981100a9becA4E685f962f0cF6C9"
|
||||
},
|
||||
{
|
||||
"name": "Verifier21",
|
||||
"address": "0x5FC8d32690cc91D4c39d9d3abcBD16989F875707"
|
||||
},
|
||||
{
|
||||
"name": "Verifier22",
|
||||
"address": "0x0165878A594ca255338adfa4d48449f69242Eb8F"
|
||||
},
|
||||
{
|
||||
"name": "Verifier23",
|
||||
"address": "0xa513E6E4b8f2a923D98304ec87F64353C4D5C853"
|
||||
},
|
||||
{
|
||||
"name": "Verifier24",
|
||||
"address": "0x2279B7A0a67DB372996a5FaB50D91eAA73d2eBe6"
|
||||
},
|
||||
{
|
||||
"name": "Verifier25",
|
||||
"address": "0x8A791620dd6260079BF849Dc5567aDC3F2FdC318"
|
||||
},
|
||||
{
|
||||
"name": "Verifier26",
|
||||
"address": "0x610178dA211FEF7D417bC0e6FeD39F05609AD788"
|
||||
},
|
||||
{
|
||||
"name": "Verifier27",
|
||||
"address": "0xB7f8BC63BbcaD18155201308C8f3540b07f84F5e"
|
||||
},
|
||||
{
|
||||
"name": "Verifier28",
|
||||
"address": "0xA51c1fc2f0D1a1b8494Ed1FE312d7C3a78Ed91C0"
|
||||
},
|
||||
{
|
||||
"name": "Verifier29",
|
||||
"address": "0x0DCd1Bf9A1b36cE34237eEaFef220932846BCD82"
|
||||
},
|
||||
{
|
||||
"name": "Verifier30",
|
||||
"address": "0x9A676e781A523b5d0C0e43731313A708CB607508"
|
||||
},
|
||||
{
|
||||
"name": "Verifier31",
|
||||
"address": "0x0B306BF915C4d645ff596e518fAf3F9669b97016"
|
||||
},
|
||||
{
|
||||
"name": "Verifier32",
|
||||
"address": "0x959922bE3CAee4b8Cd9a407cc3ac1C251C2007B1"
|
||||
},
|
||||
{
|
||||
"name": "Semaphore",
|
||||
"address": "0x3Aa5ebB10DC797CAC828524e59A333d0A371443c"
|
||||
}
|
||||
]
|
||||
@@ -1,74 +0,0 @@
|
||||
[
|
||||
{
|
||||
"name": "Verifier16",
|
||||
"address": "0x5FbDB2315678afecb367f032d93F642f64180aa3"
|
||||
},
|
||||
{
|
||||
"name": "Verifier17",
|
||||
"address": "0xe7f1725E7734CE288F8367e1Bb143E90bb3F0512"
|
||||
},
|
||||
{
|
||||
"name": "Verifier18",
|
||||
"address": "0x9fE46736679d2D9a65F0992F2272dE9f3c7fa6e0"
|
||||
},
|
||||
{
|
||||
"name": "Verifier19",
|
||||
"address": "0xCf7Ed3AccA5a467e9e704C703E8D87F634fB0Fc9"
|
||||
},
|
||||
{
|
||||
"name": "Verifier20",
|
||||
"address": "0xDc64a140Aa3E981100a9becA4E685f962f0cF6C9"
|
||||
},
|
||||
{
|
||||
"name": "Verifier21",
|
||||
"address": "0x5FC8d32690cc91D4c39d9d3abcBD16989F875707"
|
||||
},
|
||||
{
|
||||
"name": "Verifier22",
|
||||
"address": "0x0165878A594ca255338adfa4d48449f69242Eb8F"
|
||||
},
|
||||
{
|
||||
"name": "Verifier23",
|
||||
"address": "0xa513E6E4b8f2a923D98304ec87F64353C4D5C853"
|
||||
},
|
||||
{
|
||||
"name": "Verifier24",
|
||||
"address": "0x2279B7A0a67DB372996a5FaB50D91eAA73d2eBe6"
|
||||
},
|
||||
{
|
||||
"name": "Verifier25",
|
||||
"address": "0x8A791620dd6260079BF849Dc5567aDC3F2FdC318"
|
||||
},
|
||||
{
|
||||
"name": "Verifier26",
|
||||
"address": "0x610178dA211FEF7D417bC0e6FeD39F05609AD788"
|
||||
},
|
||||
{
|
||||
"name": "Verifier27",
|
||||
"address": "0xB7f8BC63BbcaD18155201308C8f3540b07f84F5e"
|
||||
},
|
||||
{
|
||||
"name": "Verifier28",
|
||||
"address": "0xA51c1fc2f0D1a1b8494Ed1FE312d7C3a78Ed91C0"
|
||||
},
|
||||
{
|
||||
"name": "Verifier29",
|
||||
"address": "0x0DCd1Bf9A1b36cE34237eEaFef220932846BCD82"
|
||||
},
|
||||
{
|
||||
"name": "Verifier30",
|
||||
"address": "0x9A676e781A523b5d0C0e43731313A708CB607508"
|
||||
},
|
||||
{
|
||||
"name": "Verifier31",
|
||||
"address": "0x0B306BF915C4d645ff596e518fAf3F9669b97016"
|
||||
},
|
||||
{
|
||||
"name": "Verifier32",
|
||||
"address": "0x959922bE3CAee4b8Cd9a407cc3ac1C251C2007B1"
|
||||
},
|
||||
{
|
||||
"name": "Semaphore",
|
||||
"address": "0x3Aa5ebB10DC797CAC828524e59A333d0A371443c"
|
||||
}
|
||||
]
|
||||
@@ -4,11 +4,12 @@
|
||||
"scripts": {
|
||||
"start": "hardhat node",
|
||||
"compile": "hardhat compile",
|
||||
"deploy:all": "hardhat run scripts/deploy-all.ts",
|
||||
"deploy:verifier": "hardhat deploy:verifier",
|
||||
"deploy:verifiers": "hardhat run scripts/deploy-verifiers.ts",
|
||||
"deploy:semaphore": "hardhat deploy:semaphore",
|
||||
"deploy:semaphore-voting": "hardhat deploy:semaphore-voting",
|
||||
"deploy:semaphore-whistleblowing": "hardhat deploy:semaphore-whistleblowing",
|
||||
"verify:contracts": "hardhat run scripts/verify-contracts.ts",
|
||||
"test": "hardhat test",
|
||||
"test:report-gas": "REPORT_GAS=true hardhat test",
|
||||
"test:coverage": "hardhat coverage",
|
||||
|
||||
@@ -1,61 +0,0 @@
|
||||
import fs from "fs"
|
||||
import { run, hardhatArguments } from "hardhat"
|
||||
|
||||
async function main() {
|
||||
const deployedContracts: { name: string; address: string }[] = []
|
||||
|
||||
// Deploy verifiers.
|
||||
for (let treeDepth = 16; treeDepth <= 32; treeDepth = +1) {
|
||||
const { address } = await run("deploy:verifier", { depth: treeDepth })
|
||||
|
||||
deployedContracts.push({
|
||||
name: `Verifier${treeDepth}`,
|
||||
address
|
||||
})
|
||||
|
||||
if (
|
||||
hardhatArguments.network &&
|
||||
hardhatArguments.network !== "hardhat" &&
|
||||
hardhatArguments.network !== "localhost"
|
||||
) {
|
||||
// Verify verifier.
|
||||
await run("verify:verify", { address })
|
||||
}
|
||||
}
|
||||
|
||||
// Deploy Semaphore.
|
||||
const { address } = await run("deploy:semaphore", {
|
||||
verifiers: deployedContracts.map((c) => ({ merkleTreeDepth: c.name.substring(8), contractAddress: c.address }))
|
||||
})
|
||||
|
||||
if (
|
||||
hardhatArguments.network &&
|
||||
hardhatArguments.network !== "hardhat" &&
|
||||
hardhatArguments.network !== "localhost"
|
||||
) {
|
||||
// Verify Semaphore.
|
||||
await run("verify:verify", {
|
||||
address,
|
||||
constructorArguments: [
|
||||
deployedContracts.map((c) => ({ merkleTreeDepth: c.name.substring(8), contractAddress: c.address }))
|
||||
]
|
||||
})
|
||||
|
||||
deployedContracts.push({
|
||||
name: `Semaphore`,
|
||||
address
|
||||
})
|
||||
|
||||
fs.writeFileSync(
|
||||
`./deployed-contracts/${hardhatArguments.network}.json`,
|
||||
JSON.stringify(deployedContracts, null, 4)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
main()
|
||||
.then(() => process.exit(0))
|
||||
.catch((error) => {
|
||||
console.error(error)
|
||||
process.exit(1)
|
||||
})
|
||||
22
packages/contracts/scripts/deploy-verifiers.ts
Normal file
22
packages/contracts/scripts/deploy-verifiers.ts
Normal file
@@ -0,0 +1,22 @@
|
||||
import { hardhatArguments, run } from "hardhat"
|
||||
import { saveDeployedContracts } from "./utils"
|
||||
|
||||
async function main() {
|
||||
const verifiers: Record<string, string> = {}
|
||||
|
||||
// Deploy verifiers.
|
||||
for (let treeDepth = 16; treeDepth <= 32; treeDepth += 1) {
|
||||
const { address } = await run("deploy:verifier", { depth: treeDepth })
|
||||
|
||||
verifiers[`Verifier${treeDepth}`] = address
|
||||
}
|
||||
|
||||
saveDeployedContracts(hardhatArguments.network, { verifiers })
|
||||
}
|
||||
|
||||
main()
|
||||
.then(() => process.exit(0))
|
||||
.catch((error) => {
|
||||
console.error(error)
|
||||
process.exit(1)
|
||||
})
|
||||
34
packages/contracts/scripts/utils.ts
Normal file
34
packages/contracts/scripts/utils.ts
Normal file
@@ -0,0 +1,34 @@
|
||||
import { readFileSync, writeFileSync } from "fs"
|
||||
|
||||
export function saveDeployedContracts(network: string | undefined, deployedContracts: any) {
|
||||
if (network !== "goerli" && network !== "arbitrum") {
|
||||
return
|
||||
}
|
||||
|
||||
writeFileSync(`./deployed-contracts/${network}.json`, JSON.stringify(deployedContracts, null, 4))
|
||||
}
|
||||
|
||||
export function getDeployedContracts(network: string | undefined): any {
|
||||
if (network !== "goerli" && network !== "arbitrum") {
|
||||
return null
|
||||
}
|
||||
|
||||
return JSON.parse(readFileSync(`./deployed-contracts/${network}.json`, "utf8"))
|
||||
}
|
||||
|
||||
export function verifiersToSolidityArgument(deployedContracts: any): any {
|
||||
const verifiers = []
|
||||
|
||||
if (deployedContracts && deployedContracts.verifiers) {
|
||||
for (const verifier in deployedContracts.verifiers) {
|
||||
if (Object.prototype.hasOwnProperty.call(deployedContracts.verifiers, verifier)) {
|
||||
verifiers.push({
|
||||
merkleTreeDepth: verifier.substring(8),
|
||||
contractAddress: deployedContracts.verifiers[verifier]
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return verifiers
|
||||
}
|
||||
24
packages/contracts/scripts/verify-contracts.ts
Normal file
24
packages/contracts/scripts/verify-contracts.ts
Normal file
@@ -0,0 +1,24 @@
|
||||
import { hardhatArguments, run } from "hardhat"
|
||||
import { getDeployedContracts, verifiersToSolidityArgument } from "./utils"
|
||||
|
||||
async function main() {
|
||||
const deployedContracts = getDeployedContracts(hardhatArguments.network)
|
||||
|
||||
if (deployedContracts) {
|
||||
await run("verify:verify", {
|
||||
address: deployedContracts["Semaphore.sol"],
|
||||
constructorArguments: [verifiersToSolidityArgument(deployedContracts)]
|
||||
})
|
||||
|
||||
await run("verify:verify", {
|
||||
address: deployedContracts["IncrementalBinaryTree.sol"]
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
main()
|
||||
.then(() => process.exit(0))
|
||||
.catch((error) => {
|
||||
console.error(error)
|
||||
process.exit(1)
|
||||
})
|
||||
@@ -1,11 +1,19 @@
|
||||
import { poseidon_gencontract as poseidonContract } from "circomlibjs"
|
||||
import { Contract } from "ethers"
|
||||
import { task, types } from "hardhat/config"
|
||||
import { getDeployedContracts, saveDeployedContracts, verifiersToSolidityArgument } from "../scripts/utils"
|
||||
|
||||
task("deploy:semaphore", "Deploy a Semaphore contract")
|
||||
.addOptionalParam<boolean>("logs", "Print the logs", true, types.boolean)
|
||||
.addParam("verifiers", "Tree depths and verifier addresses", undefined, types.json)
|
||||
.setAction(async ({ logs, verifiers }, { ethers }): Promise<Contract> => {
|
||||
.addOptionalParam("verifiers", "Tree depths and verifier addresses", [], types.json)
|
||||
.setAction(async ({ logs, verifiers }, { ethers, hardhatArguments }): Promise<Contract> => {
|
||||
let deployedContracts: any
|
||||
|
||||
if (verifiers.length === 0) {
|
||||
deployedContracts = getDeployedContracts(hardhatArguments.network)
|
||||
verifiers = verifiersToSolidityArgument(deployedContracts)
|
||||
}
|
||||
|
||||
const poseidonABI = poseidonContract.generateABI(2)
|
||||
const poseidonBytecode = poseidonContract.createCode(2)
|
||||
|
||||
@@ -47,5 +55,13 @@ task("deploy:semaphore", "Deploy a Semaphore contract")
|
||||
console.info(`Semaphore contract has been deployed to: ${contract.address}`)
|
||||
}
|
||||
|
||||
if (deployedContracts) {
|
||||
deployedContracts.PoseidonT3 = poseidonLib.address
|
||||
deployedContracts.IncrementalBinaryTree = incrementalBinaryTreeLib.address
|
||||
deployedContracts.Semaphore = contract.address
|
||||
|
||||
saveDeployedContracts(hardhatArguments.network, deployedContracts)
|
||||
}
|
||||
|
||||
return contract
|
||||
})
|
||||
|
||||
@@ -8834,7 +8834,7 @@ __metadata:
|
||||
dependencies:
|
||||
bn.js: ^4.11.8
|
||||
ethereumjs-util: ^6.0.0
|
||||
checksum: ae074be0bb012857ab5d3ae644d1163b908a48dd724b7d2567cfde309dc72222d460438f2411936a70dc949dc604ce1ef7118f7273bd525815579143c907e336
|
||||
checksum: 03127d09960e5f8a44167463faf25b2894db2f746376dbb8195b789ed11762f93db9c574eaa7c498c400063508e9dfc1c80de2edf5f0e1406b25c87d860ff2f1
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
|
||||
Reference in New Issue
Block a user