4_deploy_eth_mixer.js 792 B

12345678910111213141516171819
  1. /* global artifacts */
  2. require('dotenv').config({ path: '../.env' })
  3. // const ETHTornado = artifacts.require('ETHTornado')
  4. const ETHTornado = artifacts.require('MigratableETHTornado')
  5. const Verifier = artifacts.require('Verifier')
  6. const hasherContract = artifacts.require('Hasher')
  7. module.exports = function(deployer, network, accounts) {
  8. return deployer.then(async () => {
  9. const { MERKLE_TREE_HEIGHT, ETH_AMOUNT } = process.env
  10. const verifier = await Verifier.deployed()
  11. const hasherInstance = await hasherContract.deployed()
  12. await ETHTornado.link(hasherContract, hasherInstance.address)
  13. const tornado = await deployer.deploy(ETHTornado, verifier.address, ETH_AMOUNT, MERKLE_TREE_HEIGHT, accounts[0])
  14. console.log('ETHTornado\'s address ', tornado.address)
  15. })
  16. }