mirror of
https://github.com/tornadocash/tornado-core.git
synced 2025-08-06 13:54:13 -04:00
erc20 mixer support WIP
This commit is contained in:
parent
51b06ed661
commit
b8142d03bb
11 changed files with 282 additions and 17 deletions
|
@ -1,6 +1,6 @@
|
|||
/* global artifacts */
|
||||
require('dotenv').config({ path: '../.env' })
|
||||
const Mixer = artifacts.require('Mixer')
|
||||
const ETHMixer = artifacts.require('ETHMixer')
|
||||
const Verifier = artifacts.require('Verifier')
|
||||
const MiMC = artifacts.require('MiMC')
|
||||
|
||||
|
@ -10,8 +10,8 @@ module.exports = function(deployer, network, accounts) {
|
|||
const { MERKLE_TREE_HEIGHT, AMOUNT, EMPTY_ELEMENT } = process.env
|
||||
const verifier = await Verifier.deployed()
|
||||
const miMC = await MiMC.deployed()
|
||||
await Mixer.link(MiMC, miMC.address)
|
||||
const mixer = await deployer.deploy(Mixer, verifier.address, AMOUNT, MERKLE_TREE_HEIGHT, EMPTY_ELEMENT, accounts[0])
|
||||
console.log('Mixer\'s address ', mixer.address)
|
||||
await ETHMixer.link(MiMC, miMC.address)
|
||||
const mixer = await deployer.deploy(ETHMixer, verifier.address, AMOUNT, MERKLE_TREE_HEIGHT, EMPTY_ELEMENT, accounts[0])
|
||||
console.log('ETHMixer\'s address ', mixer.address)
|
||||
})
|
||||
}
|
31
migrations/5_deploy_erc20_mixer.js
Normal file
31
migrations/5_deploy_erc20_mixer.js
Normal file
|
@ -0,0 +1,31 @@
|
|||
/* global artifacts */
|
||||
require('dotenv').config({ path: '../.env' })
|
||||
const ERC20Mixer = artifacts.require('ERC20Mixer')
|
||||
const Verifier = artifacts.require('Verifier')
|
||||
const MiMC = artifacts.require('MiMC')
|
||||
const ERC20Mock = artifacts.require('ERC20Mock')
|
||||
|
||||
|
||||
module.exports = function(deployer, network, accounts) {
|
||||
return deployer.then(async () => {
|
||||
const { MERKLE_TREE_HEIGHT, AMOUNT, EMPTY_ELEMENT, ERC20_TOKEN } = process.env
|
||||
const verifier = await Verifier.deployed()
|
||||
const miMC = await MiMC.deployed()
|
||||
await ERC20Mixer.link(MiMC, miMC.address)
|
||||
let token = ERC20_TOKEN
|
||||
if(deployer.network !== 'mainnet') {
|
||||
const tokenInstance = await deployer.deploy(ERC20Mock)
|
||||
token = tokenInstance.address
|
||||
}
|
||||
const mixer = await deployer.deploy(
|
||||
ERC20Mixer,
|
||||
verifier.address,
|
||||
AMOUNT,
|
||||
MERKLE_TREE_HEIGHT,
|
||||
EMPTY_ELEMENT,
|
||||
accounts[0],
|
||||
token
|
||||
)
|
||||
console.log('ERC20Mixer\'s address ', mixer.address)
|
||||
})
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue