diff --git a/.env.example b/.env.example index 98f9dc1..6d8191e 100644 --- a/.env.example +++ b/.env.example @@ -15,7 +15,6 @@ PRIVATE_KEY= # 0.05 means 0.05% REGULAR_TORNADO_WITHDRAW_FEE=0.05 MINING_SERVICE_FEE=0.05 -TORN_ETH_PRICE=7000000000000000 REWARD_ACCOUNT= CONFIRMATIONS=4 diff --git a/README.md b/README.md index e2c61fd..8460da9 100644 --- a/README.md +++ b/README.md @@ -41,7 +41,6 @@ wget https://raw.githubusercontent.com/tornadocash/tornado-relayer/master/.env.e - set `PRIVATE_KEY` for your relayer address (without 0x prefix) - set `VIRTUAL_HOST` and `LETSENCRYPT_HOST` to your domain and add DNS record pointing to your relayer ip address - set `REGULAR_TORNADO_WITHDRAW_FEE` - fee in % that is used for tornado pool withdrawals - - set `TORN_ETH_PRICE` - TORN/ETH rate that relayer will use to calculate fee for mining claim and swap - set `MINING_SERVICE_FEE` - fee in % that is used for mining AP withdrawals - set `REWARD_ACCOUNT` - eth address that is used to collect fees - update `AGGREGATOR` if needed - Contract address of aggregator instance. diff --git a/package.json b/package.json index 2b9e857..ffb76eb 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "relay", - "version": "4.0.2", + "version": "4.0.3", "description": "Relayer for Tornado.cash privacy solution. https://tornado.cash", "scripts": { "server": "node src/server.js", diff --git a/src/config.js b/src/config.js index 8906371..852c45e 100644 --- a/src/config.js +++ b/src/config.js @@ -17,7 +17,6 @@ module.exports = { port: process.env.APP_PORT || 8000, tornadoServiceFee: Number(process.env.REGULAR_TORNADO_WITHDRAW_FEE), miningServiceFee: Number(process.env.MINING_SERVICE_FEE), - tornEthPrice: process.env.TORN_ETH_PRICE || '7000000000000000', rewardAccount: process.env.REWARD_ACCOUNT, gasLimits: { [jobType.TORNADO_WITHDRAW]: 350000, diff --git a/src/priceWatcher.js b/src/priceWatcher.js index d229155..a0c1630 100644 --- a/src/priceWatcher.js +++ b/src/priceWatcher.js @@ -1,5 +1,5 @@ const Redis = require('ioredis') -const { redisUrl, oracleAddress, oracleRpcUrl, tornEthPrice } = require('./config') +const { redisUrl, oracleAddress, oracleRpcUrl } = require('./config') const { getArgsForOracle, setSafeInterval } = require('./utils') const redis = new Redis(redisUrl) const Web3 = require('web3') @@ -15,7 +15,6 @@ async function main() { acc[currencyLookup[tokenAddresses[i]]] = price return acc }, {}) - ethPrices.torn = tornEthPrice await redis.hmset('prices', ethPrices) console.log('Wrote following prices to redis', ethPrices) } diff --git a/src/utils.js b/src/utils.js index 32297ec..925a35f 100644 --- a/src/utils.js +++ b/src/utils.js @@ -2,6 +2,12 @@ const { instances, netId } = require('./config') const { poseidon } = require('circomlib') const { toBN, toChecksumAddress, BN } = require('web3-utils') +const TORN_TOKEN = { + tokenAddress: '0x77777feddddffc19ff86db637967013e6c6a116c', + symbol: 'TORN', + decimals: 18, +} + const sleep = ms => new Promise(res => setTimeout(res, ms)) function getInstance(address) { @@ -44,7 +50,10 @@ function when(source, event) { } function getArgsForOracle() { - const tokens = instances.netId1 + const tokens = { + ...instances.netId1, + torn: TORN_TOKEN, + } const tokenAddresses = [] const oneUintAmount = [] const currencyLookup = {}