tornado-core/migrations/4_deploy_mixer.js

17 lines
617 B
JavaScript
Raw Normal View History

2019-07-12 15:04:45 +00:00
require('dotenv').config({ path: '../.env' })
const Mixer = artifacts.require("Mixer");
const Verifier = artifacts.require("Verifier");
const MiMC = artifacts.require("MiMC");
module.exports = function(deployer) {
return deployer.then(async () => {
const { MERKLE_TREE_HEIGHT, AMOUNT, EMPTY_ELEMENT } = process.env
const verifier = await Verifier.deployed()
2019-07-12 22:26:27 +00:00
const miMC = await MiMC.deployed()
2019-07-12 15:04:45 +00:00
await Mixer.link(MiMC, miMC.address)
2019-07-15 21:34:54 +00:00
const mixer = await deployer.deploy(Mixer, verifier.address, AMOUNT, MERKLE_TREE_HEIGHT, EMPTY_ELEMENT)
console.log("Mixer's address ", mixer.address)
2019-07-12 15:04:45 +00:00
})
};