4_deploy_eth_mixer.js 744 B

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