mirror of
https://github.com/tornadocash/tornado-relayer.git
synced 2024-12-24 23:29:30 -05:00
fix torn rate
This commit is contained in:
parent
273603e981
commit
c9ecd0a9e8
@ -15,7 +15,6 @@ PRIVATE_KEY=
|
|||||||
# 0.05 means 0.05%
|
# 0.05 means 0.05%
|
||||||
REGULAR_TORNADO_WITHDRAW_FEE=0.05
|
REGULAR_TORNADO_WITHDRAW_FEE=0.05
|
||||||
MINING_SERVICE_FEE=0.05
|
MINING_SERVICE_FEE=0.05
|
||||||
TORN_ETH_PRICE=7000000000000000
|
|
||||||
REWARD_ACCOUNT=
|
REWARD_ACCOUNT=
|
||||||
CONFIRMATIONS=4
|
CONFIRMATIONS=4
|
||||||
|
|
||||||
|
@ -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 `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 `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 `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 `MINING_SERVICE_FEE` - fee in % that is used for mining AP withdrawals
|
||||||
- set `REWARD_ACCOUNT` - eth address that is used to collect fees
|
- set `REWARD_ACCOUNT` - eth address that is used to collect fees
|
||||||
- update `AGGREGATOR` if needed - Contract address of aggregator instance.
|
- update `AGGREGATOR` if needed - Contract address of aggregator instance.
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "relay",
|
"name": "relay",
|
||||||
"version": "4.0.2",
|
"version": "4.0.3",
|
||||||
"description": "Relayer for Tornado.cash privacy solution. https://tornado.cash",
|
"description": "Relayer for Tornado.cash privacy solution. https://tornado.cash",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"server": "node src/server.js",
|
"server": "node src/server.js",
|
||||||
|
@ -17,7 +17,6 @@ module.exports = {
|
|||||||
port: process.env.APP_PORT || 8000,
|
port: process.env.APP_PORT || 8000,
|
||||||
tornadoServiceFee: Number(process.env.REGULAR_TORNADO_WITHDRAW_FEE),
|
tornadoServiceFee: Number(process.env.REGULAR_TORNADO_WITHDRAW_FEE),
|
||||||
miningServiceFee: Number(process.env.MINING_SERVICE_FEE),
|
miningServiceFee: Number(process.env.MINING_SERVICE_FEE),
|
||||||
tornEthPrice: process.env.TORN_ETH_PRICE || '7000000000000000',
|
|
||||||
rewardAccount: process.env.REWARD_ACCOUNT,
|
rewardAccount: process.env.REWARD_ACCOUNT,
|
||||||
gasLimits: {
|
gasLimits: {
|
||||||
[jobType.TORNADO_WITHDRAW]: 350000,
|
[jobType.TORNADO_WITHDRAW]: 350000,
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
const Redis = require('ioredis')
|
const Redis = require('ioredis')
|
||||||
const { redisUrl, oracleAddress, oracleRpcUrl, tornEthPrice } = require('./config')
|
const { redisUrl, oracleAddress, oracleRpcUrl } = require('./config')
|
||||||
const { getArgsForOracle, setSafeInterval } = require('./utils')
|
const { getArgsForOracle, setSafeInterval } = require('./utils')
|
||||||
const redis = new Redis(redisUrl)
|
const redis = new Redis(redisUrl)
|
||||||
const Web3 = require('web3')
|
const Web3 = require('web3')
|
||||||
@ -15,7 +15,6 @@ async function main() {
|
|||||||
acc[currencyLookup[tokenAddresses[i]]] = price
|
acc[currencyLookup[tokenAddresses[i]]] = price
|
||||||
return acc
|
return acc
|
||||||
}, {})
|
}, {})
|
||||||
ethPrices.torn = tornEthPrice
|
|
||||||
await redis.hmset('prices', ethPrices)
|
await redis.hmset('prices', ethPrices)
|
||||||
console.log('Wrote following prices to redis', ethPrices)
|
console.log('Wrote following prices to redis', ethPrices)
|
||||||
}
|
}
|
||||||
|
11
src/utils.js
11
src/utils.js
@ -2,6 +2,12 @@ const { instances, netId } = require('./config')
|
|||||||
const { poseidon } = require('circomlib')
|
const { poseidon } = require('circomlib')
|
||||||
const { toBN, toChecksumAddress, BN } = require('web3-utils')
|
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))
|
const sleep = ms => new Promise(res => setTimeout(res, ms))
|
||||||
|
|
||||||
function getInstance(address) {
|
function getInstance(address) {
|
||||||
@ -44,7 +50,10 @@ function when(source, event) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function getArgsForOracle() {
|
function getArgsForOracle() {
|
||||||
const tokens = instances.netId1
|
const tokens = {
|
||||||
|
...instances.netId1,
|
||||||
|
torn: TORN_TOKEN,
|
||||||
|
}
|
||||||
const tokenAddresses = []
|
const tokenAddresses = []
|
||||||
const oneUintAmount = []
|
const oneUintAmount = []
|
||||||
const currencyLookup = {}
|
const currencyLookup = {}
|
||||||
|
Loading…
Reference in New Issue
Block a user