mirror of
https://github.com/tornadocash/tornado-relayer.git
synced 2024-12-29 01:26:10 -05:00
relayerServiceFee as a number
This commit is contained in:
parent
7ca4715855
commit
fd458d4b19
@ -19,5 +19,5 @@ module.exports = {
|
|||||||
port: process.env.APP_PORT,
|
port: process.env.APP_PORT,
|
||||||
//dai
|
//dai
|
||||||
tokens: ['0x6b175474e89094c44da98b954eedeac495271d0f'],
|
tokens: ['0x6b175474e89094c44da98b954eedeac495271d0f'],
|
||||||
relayerServiceFee: process.env.RELAYER_FEE
|
relayerServiceFee: Number(process.env.RELAYER_FEE)
|
||||||
}
|
}
|
@ -58,7 +58,7 @@ function sleep(ms) {
|
|||||||
|
|
||||||
function isEnoughFee({ gas, gasPrices, currency, amount, refund, ethPrices, fee }) {
|
function isEnoughFee({ gas, gasPrices, currency, amount, refund, ethPrices, fee }) {
|
||||||
// TODO tokens can have less then 18 decimals
|
// TODO tokens can have less then 18 decimals
|
||||||
const feePercent = toBN(toWei(amount)).mul(toBN(Number(relayerServiceFee) * 10)).div(toBN('1000'))
|
const feePercent = toBN(toWei(amount)).mul(toBN(relayerServiceFee * 10)).div(toBN('1000'))
|
||||||
const expense = toBN(toWei(gasPrices.fast.toString(), 'gwei')).mul(toBN(gas))
|
const expense = toBN(toWei(gasPrices.fast.toString(), 'gwei')).mul(toBN(gas))
|
||||||
let desiredFee
|
let desiredFee
|
||||||
switch (currency) {
|
switch (currency) {
|
||||||
|
Loading…
Reference in New Issue
Block a user