deploy.js 1011 B

1234567891011121314151617181920212223242526
  1. const eth = true
  2. const poolSize = '1000000000000000000'
  3. const hasherAddress = '0x83584f83f26aF4eDDA9CBe8C730bc87C364b28fe'
  4. const verifierAddress = '0xce172ce1F20EC0B3728c9965470eaf994A03557A'
  5. const deployerAddress = '0xCEe71753C9820f063b38FDbE4cFDAf1d3D928A80'
  6. const deploySalt = '0x0000000000000000000000000000000000000000000000000000000047941987'
  7. const rpcUrl = 'https://mainnet.infura.io'
  8. const Web3 = require('web3')
  9. const web3 = new Web3(rpcUrl)
  10. const contractData = require('./build/contracts/' + (eth ? 'ETHTornado.json' : 'ERC20Tornado.json'))
  11. const contract = new web3.eth.Contract(contractData.abi)
  12. const bytes = contract
  13. .deploy({
  14. data: contractData.bytecode,
  15. arguments: [verifierAddress, hasherAddress, poolSize, 20],
  16. })
  17. .encodeABI()
  18. console.log('Deploy bytecode', bytes)
  19. const deployer = new web3.eth.Contract(require('./build/contracts/IDeployer.json').abi, deployerAddress)
  20. const receipt = deployer.methods.deploy(bytes, deploySalt)
  21. receipt.then(console.log).catch(console.log)