dagger-contracts/deploy/verifier.js
Mark Spanbroek c7b18af7cd Deploy 2 versions of the marketplace on local network
One with the real Groth16 verifier,
and one with a dummy verifier used for testing.
2024-01-31 15:45:01 +01:00

25 lines
734 B
JavaScript

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