From c3bfb381b7ab7b5ca6acb4f28ab05dc97612180b Mon Sep 17 00:00:00 2001 From: Theo Date: Mon, 28 Aug 2023 09:01:19 -0700 Subject: [PATCH] Fix bump function: round to lower when BigNumber stores float value before converting to ethers BigNumber --- package.json | 2 +- src/utils.ts | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 5472b92..930f3c0 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@tornado/tornado-oracles", - "version": "1.4.0", + "version": "1.4.1", "description": "Gas oracle for Tornado-specific transactions", "main": "./lib/index.js", "types": "./lib/index.d.ts", diff --git a/src/utils.ts b/src/utils.ts index 05b42d9..60cc307 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -25,6 +25,7 @@ export function bump(value: BigNumberish, percent: number): BigNumber { BigNumberFloat(BigNumber.from(value).toHexString()) .times(hundredPercents.plus(BigNumberFloat(percent))) .div(hundredPercents) + .decimalPlaces(0, 1) .toString(), ); }