2024-01-25 09:49:53 +00:00
|
|
|
const { loadVerificationKey } = require("../verifier/verifier.js")
|
2024-01-05 11:27:53 +00:00
|
|
|
|
2024-01-25 09:49:53 +00:00
|
|
|
async function deployVerifier({ deployments, getNamedAccounts }) {
|
2024-01-05 11:27:53 +00:00
|
|
|
const { deployer } = await getNamedAccounts()
|
2024-01-23 12:56:52 +00:00
|
|
|
const verificationKey = loadVerificationKey(network.name)
|
2024-01-25 09:49:53 +00:00
|
|
|
await deployments.deploy("Groth16Verifier", {
|
|
|
|
args: [verificationKey],
|
|
|
|
from: deployer,
|
|
|
|
})
|
2024-01-05 11:27:53 +00:00
|
|
|
}
|
|
|
|
|
2024-01-25 09:49:53 +00:00
|
|
|
async function deployTestVerifier({ network, deployments, getNamedAccounts }) {
|
|
|
|
if (network.tags.local) {
|
|
|
|
const { deployer } = await getNamedAccounts()
|
|
|
|
await deployments.deploy("TestVerifier", { from: deployer })
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
module.exports = async (environment) => {
|
|
|
|
await deployVerifier(environment)
|
|
|
|
await deployTestVerifier(environment)
|
|
|
|
}
|
|
|
|
|
|
|
|
module.exports.tags = ["Verifier"]
|