diff --git a/.env.example b/.env.example index 633c888..096d574 100644 --- a/.env.example +++ b/.env.example @@ -3,7 +3,7 @@ RPC_URL=https://kovan.infura.io/v3/a3f4d001c1fc4a359ea70dd27fd9cb51 PRIVATE_KEY= ETH_MIXER_ADDRESS=0x1Cea940cA15a303A0E01B7F8589F39fF34308DB2 DAI_MIXER_ADDRESS=0x7ed3fC8042e18db889A0466F49c438bB1410b3c7 -# 25 means 2.5% -RELAYER_FEE=25 +# 2.5 means 2.5% +RELAYER_FEE=2.5 APP_PORT=8000 \ No newline at end of file diff --git a/src/index.js b/src/index.js index f830478..6a41d79 100644 --- a/src/index.js +++ b/src/index.js @@ -44,4 +44,4 @@ console.log(`mixers: ${JSON.stringify(mixers)}`) console.log(`gasPrices: ${JSON.stringify(fetcher.gasPrices)}`) console.log(`netId: ${netId}`) console.log(`ethPrices: ${JSON.stringify(fetcher.ethPrices)}`) -console.log(`Service fee: ${relayerServiceFee / 10}%`) \ No newline at end of file +console.log(`Service fee: ${relayerServiceFee}%`) \ No newline at end of file diff --git a/src/utils.js b/src/utils.js index a54e9ad..f903f37 100644 --- a/src/utils.js +++ b/src/utils.js @@ -58,7 +58,7 @@ function sleep(ms) { function isEnoughFee({ gas, gasPrices, currency, amount, refund, ethPrices, fee }) { // TODO tokens can have less then 18 decimals - const feePercent = toBN(toWei(amount)).mul(toBN(relayerServiceFee)).div(toBN('1000')) + const feePercent = toBN(toWei(amount)).mul(toBN(Number(relayerServiceFee) * 10)).div(toBN('1000')) const expense = toBN(toWei(gasPrices.fast.toString(), 'gwei')).mul(toBN(gas)) let desiredFee switch (currency) {