feat: add optimism
This commit is contained in:
parent
3d952f1906
commit
4a28d4646e
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "relay",
|
"name": "relay",
|
||||||
"version": "5.0.0-beta.7",
|
"version": "5.0.0-beta.8",
|
||||||
"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",
|
||||||
@ -22,6 +22,7 @@
|
|||||||
"express": "^4.17.1",
|
"express": "^4.17.1",
|
||||||
"gas-price-oracle": "^0.4.4",
|
"gas-price-oracle": "^0.4.4",
|
||||||
"ioredis": "^4.14.1",
|
"ioredis": "^4.14.1",
|
||||||
|
"torn-token": "^1.0.5",
|
||||||
"tx-manager": "^0.4.5",
|
"tx-manager": "^0.4.5",
|
||||||
"uuid": "^8.3.0",
|
"uuid": "^8.3.0",
|
||||||
"web3": "^1.3.0",
|
"web3": "^1.3.0",
|
||||||
|
@ -1,9 +1,13 @@
|
|||||||
require('dotenv').config()
|
require('dotenv').config()
|
||||||
|
|
||||||
|
const tornConfig = require('torn-token')
|
||||||
|
|
||||||
const { jobType, networkConfig } = require('./constants')
|
const { jobType, networkConfig } = require('./constants')
|
||||||
|
|
||||||
const netId = Number(process.env.NET_ID) || 56
|
const netId = Number(process.env.NET_ID) || 56
|
||||||
const { instances, gasPrices, nativeCurrency, proxyLight } = networkConfig[`netId${netId}`]
|
const instances = tornConfig.instances[`netId${netId}`]
|
||||||
|
const proxyLight = tornConfig.tornadoProxyLight.address
|
||||||
|
const { gasPrices, nativeCurrency } = networkConfig[`netId${netId}`]
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
netId,
|
netId,
|
||||||
|
@ -22,19 +22,15 @@ const networkConfig = {
|
|||||||
low: 5,
|
low: 5,
|
||||||
},
|
},
|
||||||
nativeCurrency: 'bnb',
|
nativeCurrency: 'bnb',
|
||||||
instances: {
|
|
||||||
bnb: {
|
|
||||||
instanceAddress: {
|
|
||||||
0.1: '0x84443CFd09A48AF6eF360C6976C5392aC5023a1F',
|
|
||||||
1: '0xd47438C816c9E7f2E2888E060936a499Af9582b3',
|
|
||||||
10: '0x330bdFADE01eE9bF63C209Ee33102DD334618e0a',
|
|
||||||
100: '0x1E34A77868E19A6647b1f2F47B51ed72dEDE95DD',
|
|
||||||
},
|
},
|
||||||
symbol: 'BNB',
|
netId10: {
|
||||||
decimals: 18,
|
gasPrices: {
|
||||||
|
instant: 0.001,
|
||||||
|
fast: 0.001,
|
||||||
|
standard: 0.001,
|
||||||
|
low: 0.001,
|
||||||
},
|
},
|
||||||
},
|
nativeCurrency: 'eth',
|
||||||
proxyLight: '0x0D5550d52428E7e3175bfc9550207e4ad3859b17',
|
|
||||||
},
|
},
|
||||||
netId100: {
|
netId100: {
|
||||||
gasPrices: {
|
gasPrices: {
|
||||||
@ -44,19 +40,6 @@ const networkConfig = {
|
|||||||
low: 1,
|
low: 1,
|
||||||
},
|
},
|
||||||
nativeCurrency: 'xdai',
|
nativeCurrency: 'xdai',
|
||||||
instances: {
|
|
||||||
xdai: {
|
|
||||||
instanceAddress: {
|
|
||||||
100: '0x1E34A77868E19A6647b1f2F47B51ed72dEDE95DD',
|
|
||||||
1000: '0xdf231d99Ff8b6c6CBF4E9B9a945CBAcEF9339178',
|
|
||||||
10000: '0xaf4c0B70B2Ea9FB7487C7CbB37aDa259579fe040',
|
|
||||||
100000: '0xa5C2254e4253490C54cef0a4347fddb8f75A4998',
|
|
||||||
},
|
|
||||||
symbol: 'xDAI',
|
|
||||||
decimals: 18,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
proxyLight: '0x0D5550d52428E7e3175bfc9550207e4ad3859b17',
|
|
||||||
},
|
},
|
||||||
netId137: {
|
netId137: {
|
||||||
gasPrices: {
|
gasPrices: {
|
||||||
@ -66,19 +49,6 @@ const networkConfig = {
|
|||||||
low: 30,
|
low: 30,
|
||||||
},
|
},
|
||||||
nativeCurrency: 'matic',
|
nativeCurrency: 'matic',
|
||||||
instances: {
|
|
||||||
matic: {
|
|
||||||
instanceAddress: {
|
|
||||||
100: '0x1E34A77868E19A6647b1f2F47B51ed72dEDE95DD',
|
|
||||||
1000: '0xdf231d99Ff8b6c6CBF4E9B9a945CBAcEF9339178',
|
|
||||||
10000: '0xaf4c0B70B2Ea9FB7487C7CbB37aDa259579fe040',
|
|
||||||
100000: '0xa5C2254e4253490C54cef0a4347fddb8f75A4998',
|
|
||||||
},
|
|
||||||
symbol: 'MATIC',
|
|
||||||
decimals: 18,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
proxyLight: '0x0D5550d52428E7e3175bfc9550207e4ad3859b17',
|
|
||||||
},
|
},
|
||||||
netId42161: {
|
netId42161: {
|
||||||
gasPrices: {
|
gasPrices: {
|
||||||
@ -88,19 +58,6 @@ const networkConfig = {
|
|||||||
low: 2.29,
|
low: 2.29,
|
||||||
},
|
},
|
||||||
nativeCurrency: 'eth',
|
nativeCurrency: 'eth',
|
||||||
instances: {
|
|
||||||
eth: {
|
|
||||||
instanceAddress: {
|
|
||||||
0.1: '0x84443CFd09A48AF6eF360C6976C5392aC5023a1F',
|
|
||||||
1: '0xd47438C816c9E7f2E2888E060936a499Af9582b3',
|
|
||||||
10: '0x330bdFADE01eE9bF63C209Ee33102DD334618e0a',
|
|
||||||
100: '0x1E34A77868E19A6647b1f2F47B51ed72dEDE95DD',
|
|
||||||
},
|
|
||||||
symbol: 'ETH',
|
|
||||||
decimals: 18,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
proxyLight: '0x0D5550d52428E7e3175bfc9550207e4ad3859b17',
|
|
||||||
},
|
},
|
||||||
netId43114: {
|
netId43114: {
|
||||||
gasPrices: {
|
gasPrices: {
|
||||||
@ -110,18 +67,6 @@ const networkConfig = {
|
|||||||
low: 25,
|
low: 25,
|
||||||
},
|
},
|
||||||
nativeCurrency: 'avax',
|
nativeCurrency: 'avax',
|
||||||
instances: {
|
|
||||||
avax: {
|
|
||||||
instanceAddress: {
|
|
||||||
10: '0x330bdFADE01eE9bF63C209Ee33102DD334618e0a',
|
|
||||||
100: '0x1E34A77868E19A6647b1f2F47B51ed72dEDE95DD',
|
|
||||||
500: '0xaf8d1839c3c67cf571aa74B5c12398d4901147B3',
|
|
||||||
},
|
|
||||||
symbol: 'AVAX',
|
|
||||||
decimals: 18,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
proxyLight: '0x0D5550d52428E7e3175bfc9550207e4ad3859b17',
|
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -30,6 +30,7 @@ function start() {
|
|||||||
const { CONFIRMATIONS, MAX_GAS_PRICE } = process.env
|
const { CONFIRMATIONS, MAX_GAS_PRICE } = process.env
|
||||||
const gasPriceOracleConfig = {
|
const gasPriceOracleConfig = {
|
||||||
chainId: netId,
|
chainId: netId,
|
||||||
|
defaultRpc: httpRpcUrl,
|
||||||
defaultFallbackGasPrices: gasPrices,
|
defaultFallbackGasPrices: gasPrices,
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -49,13 +50,8 @@ function start() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async function getGasPrices() {
|
function getGasPrices() {
|
||||||
const networksWithOracle = [56, 100, 137, 43114, 42161]
|
return gasPriceOracle.gasPrices()
|
||||||
if (networksWithOracle.includes(netId)) {
|
|
||||||
return await gasPriceOracle.gasPrices()
|
|
||||||
}
|
|
||||||
|
|
||||||
return gasPrices
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function getGasLimit() {
|
function getGasLimit() {
|
||||||
|
Loading…
Reference in New Issue
Block a user