mirror of
https://github.com/tornadocash/tornado-core.git
synced 2025-07-29 09:58:54 -04:00
Add feeToSetter
This commit is contained in:
parent
66a8fe5712
commit
603dcdc426
19 changed files with 29460 additions and 20562 deletions
|
@ -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)
|
||||
})
|
||||
}
|
6
migrations/4_deploy_fee_manager.js
Normal file
6
migrations/4_deploy_fee_manager.js
Normal file
|
@ -0,0 +1,6 @@
|
|||
/* global artifacts */
|
||||
const FeeManager = artifacts.require('FeeManager')
|
||||
|
||||
module.exports = function (deployer, network, accounts) {
|
||||
deployer.deploy(FeeManager, accounts[0])
|
||||
}
|
|
@ -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],
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue