tornado-core/migrations/4_deploy_eth_mixer.js

18 lines
684 B
JavaScript
Raw Normal View History

2019-07-16 22:49:45 +02:00
/* global artifacts */
2019-07-12 17:04:45 +02:00
require('dotenv').config({ path: '../.env' })
2019-08-20 22:39:21 +02:00
const ETHMixer = artifacts.require('ETHMixer')
2019-07-16 19:27:20 +02:00
const Verifier = artifacts.require('Verifier')
const MiMC = artifacts.require('MiMC')
2019-07-12 17:04:45 +02:00
2019-08-01 10:41:22 +02:00
module.exports = function(deployer, network, accounts) {
2019-07-12 17:04:45 +02:00
return deployer.then(async () => {
const { MERKLE_TREE_HEIGHT, AMOUNT, EMPTY_ELEMENT } = process.env
const verifier = await Verifier.deployed()
2019-07-13 00:26:27 +02:00
const miMC = await MiMC.deployed()
2019-08-20 22:39:21 +02:00
await ETHMixer.link(MiMC, miMC.address)
const mixer = await deployer.deploy(ETHMixer, verifier.address, AMOUNT, MERKLE_TREE_HEIGHT, EMPTY_ELEMENT, accounts[0])
console.log('ETHMixer\'s address ', mixer.address)
2019-07-12 17:04:45 +02:00
})
2019-07-16 19:27:20 +02:00
}