Add feeToSetter

This commit is contained in:
Brian Li 2021-04-02 15:32:58 -07:00
parent 66a8fe5712
commit 603dcdc426
19 changed files with 29460 additions and 20562 deletions

View file

@ -1,17 +0,0 @@
/* global artifacts */
require('dotenv').config({ path: '../.env' })
const ETHTornado = artifacts.require('ETHTornado')
const Verifier = artifacts.require('Verifier')
const hasherContract = artifacts.require('Hasher')
module.exports = function(deployer, network, accounts) {
return deployer.then(async () => {
const { MERKLE_TREE_HEIGHT, ETH_AMOUNT } = process.env
const verifier = await Verifier.deployed()
const hasherInstance = await hasherContract.deployed()
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)
})
}

View file

@ -0,0 +1,6 @@
/* global artifacts */
const FeeManager = artifacts.require('FeeManager')
module.exports = function (deployer, network, accounts) {
deployer.deploy(FeeManager, accounts[0])
}

View file

@ -1,25 +1,28 @@
/* global artifacts */
require('dotenv').config({ path: '../.env' })
require('dotenv').config({path: '../.env'})
const ERC20Tornado = artifacts.require('ERC20Tornado')
const Verifier = artifacts.require('Verifier')
const FeeManager = artifacts.require('FeeManager')
const hasherContract = artifacts.require('Hasher')
const ERC20Mock = artifacts.require('ERC20Mock')
module.exports = function(deployer, network, accounts) {
module.exports = function (deployer, network, accounts) {
return deployer.then(async () => {
const { MERKLE_TREE_HEIGHT, ERC20_TOKEN, TOKEN_AMOUNT } = process.env
const {MERKLE_TREE_HEIGHT, ERC20_TOKEN, TOKEN_AMOUNT} = process.env
const verifier = await Verifier.deployed()
const feeManager = await FeeManager.deployed()
const hasherInstance = await hasherContract.deployed()
await ERC20Tornado.link(hasherContract, hasherInstance.address)
let token = ERC20_TOKEN
if(token === '') {
if (token === '') {
const tokenInstance = await deployer.deploy(ERC20Mock)
token = tokenInstance.address
}
const tornado = await deployer.deploy(
ERC20Tornado,
verifier.address,
feeManager.address,
TOKEN_AMOUNT,
MERKLE_TREE_HEIGHT,
accounts[0],