codex-contracts-eth/deploy/verifier.js

25 lines
734 B
JavaScript
Raw Normal View History

const { loadVerificationKey } = require("../verifier/verifier.js")
2024-01-05 11:27:53 +00:00
async function deployVerifier({ deployments, getNamedAccounts }) {
2024-01-05 11:27:53 +00:00
const { deployer } = await getNamedAccounts()
const verificationKey = loadVerificationKey(network.name)
await deployments.deploy("Groth16Verifier", {
args: [verificationKey],
from: deployer,
})
2024-01-05 11:27: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"]