tornado-core/migrations/4_deploy_eth_mixer.js

18 lines
692 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 () => {
2019-08-27 22:42:24 +02:00
const { MERKLE_TREE_HEIGHT, ETH_AMOUNT, EMPTY_ELEMENT } = process.env
2019-07-12 17:04:45 +02:00
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)
2019-08-27 22:42:24 +02:00
const mixer = await deployer.deploy(ETHMixer, verifier.address, ETH_AMOUNT, MERKLE_TREE_HEIGHT, EMPTY_ELEMENT, accounts[0])
2019-08-20 22:39:21 +02:00
console.log('ETHMixer\'s address ', mixer.address)
2019-07-12 17:04:45 +02:00
})
2019-07-16 19:27:20 +02:00
}