mirror of
https://github.com/tornadocash/tornado-core.git
synced 2025-11-30 03:16:32 -05:00
work in progress for gsn
This commit is contained in:
parent
7c1b20b693
commit
e3d77b4e1d
13 changed files with 4673 additions and 7 deletions
16
migrations/5_deploy_eth_mixer_proxy.js
Normal file
16
migrations/5_deploy_eth_mixer_proxy.js
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
/* global artifacts */
|
||||
require('dotenv').config({ path: '../.env' })
|
||||
const ETHMixer = artifacts.require('ETHMixer')
|
||||
const gsnProxy = artifacts.require('GSNProxy')
|
||||
|
||||
module.exports = function(deployer) {
|
||||
return deployer.then(async () => {
|
||||
let mixer = await ETHMixer.deployed()
|
||||
const proxy = await deployer.deploy(
|
||||
gsnProxy,
|
||||
mixer.address,
|
||||
'0x0000000000000000000000000000000000000000',
|
||||
)
|
||||
console.log('Mixer\'s proxy address ', proxy.address)
|
||||
})
|
||||
}
|
||||
32
migrations/7_deploy_erc20_mixer_proxy.js
Normal file
32
migrations/7_deploy_erc20_mixer_proxy.js
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
/* global artifacts */
|
||||
require('dotenv').config({ path: '../.env' })
|
||||
const ERC20Mixer = artifacts.require('ERC20Mixer')
|
||||
const gsnProxy = artifacts.require('GSNProxy')
|
||||
const ERC20Mock = artifacts.require('ERC20Mock')
|
||||
const UniswapMock = artifacts.require('UniswapMock')
|
||||
const { toBN, toWei } = require('web3-utils')
|
||||
const eth2daiPrice = toBN('174552286079977583324') // cause 1 ETH == 174.55 DAI
|
||||
|
||||
|
||||
module.exports = function(deployer, network) {
|
||||
return deployer.then(async () => {
|
||||
const { ERC20_TOKEN } = process.env
|
||||
let token = ERC20_TOKEN
|
||||
let uniswapAddress
|
||||
if (network === 'development') { // means we want to test with mock
|
||||
if (token === '') {
|
||||
const tokenInstance = await ERC20Mock.deployed()
|
||||
token = tokenInstance.address
|
||||
}
|
||||
const uniswap = await deployer.deploy(UniswapMock, token, eth2daiPrice, { value: toWei('0.5') })
|
||||
uniswapAddress = uniswap.address
|
||||
}
|
||||
let mixer = await ERC20Mixer.deployed()
|
||||
const proxy = await deployer.deploy(
|
||||
gsnProxy,
|
||||
mixer.address,
|
||||
uniswapAddress,
|
||||
)
|
||||
console.log('ERC20Mixer\'s proxy address ', proxy.address)
|
||||
})
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue