tornado-core/migrations/4_deploy_eth_tornado.js

23 lines
762 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-13 14:49:19 +01:00
const ETHTornado = artifacts.require('ETHTornado')
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
2021-02-11 07:23:18 +01: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)
2021-02-11 07:23:18 +01:00
const tornado = await deployer.deploy(
ETHTornado,
verifier.address,
ETH_AMOUNT,
MERKLE_TREE_HEIGHT,
accounts[0],
)
console.log('ETHTornado address ', tornado.address)
2019-07-12 17:04:45 +02:00
})
2019-07-16 19:27:20 +02:00
}