tornado-core/migrations/4_deploy_eth_mixer.js

19 lines
792 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-12-16 23:11:57 +01:00
// const ETHTornado = artifacts.require('ETHTornado')
const ETHTornado = artifacts.require('MigratableETHTornado')
2019-07-16 19:27:20 +02:00
const Verifier = artifacts.require('Verifier')
2019-10-04 18:17:28 +02:00
const hasherContract = artifacts.require('Hasher')
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-11-02 13:35:22 +01:00
const { MERKLE_TREE_HEIGHT, ETH_AMOUNT } = process.env
2019-07-12 17:04:45 +02:00
const verifier = await Verifier.deployed()
const hasherInstance = await hasherContract.deployed()
2019-12-13 14:49:19 +01:00
await ETHTornado.link(hasherContract, hasherInstance.address)
const tornado = await deployer.deploy(ETHTornado, verifier.address, ETH_AMOUNT, MERKLE_TREE_HEIGHT, accounts[0])
console.log('ETHTornado\'s address ', tornado.address)
2019-07-12 17:04:45 +02:00
})
2019-07-16 19:27:20 +02:00
}