From 5be9b8ad72060ebdd2c5c67127d0ce3b902ddfca Mon Sep 17 00:00:00 2001 From: Alexey Date: Fri, 25 Feb 2022 20:15:56 +0100 Subject: [PATCH] calculate fee percent --- package.json | 2 +- src/modules/queue/transaction.processor.ts | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 60c3584..418dffb 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "pool-relayer", - "version": "0.0.2", + "version": "0.0.3", "description": "Relayer for Tornado.cash Nova privacy solution. https://tornado.cash", "author": "tornado.cash", "license": "MIT", diff --git a/src/modules/queue/transaction.processor.ts b/src/modules/queue/transaction.processor.ts index b18f4ef..efa3ad8 100644 --- a/src/modules/queue/transaction.processor.ts +++ b/src/modules/queue/transaction.processor.ts @@ -124,7 +124,8 @@ export class TransactionProcessor extends BaseProcessor { if (amount.isNegative()) { const oneEther = getToIntegerMultiplier(); - return amount.mul(toWei(serviceFee.withdrawal)).div(oneEther); + const share = Number(serviceFee.withdrawal) / 100; + return amount.mul(toWei(share.toString())).div(oneEther); } return serviceFee.transfer;