work in progress for gsn

This commit is contained in:
poma 2019-10-25 19:15:54 +03:00
parent 7c1b20b693
commit e3d77b4e1d
13 changed files with 4673 additions and 7 deletions

View 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)
})
}

View 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)
})
}