penumbra-zone / web

Apache License 2.0
12 stars 14 forks source link

Sub-auction scaled input/output amount math fails #1223

Open turbocrime opened 1 month ago

turbocrime commented 1 month ago

it seems like the bignumber division logic in get-sub-auctions does not always successfully create round numbers, throwing the BigInt conversion calls

https://github.com/penumbra-zone/web/blob/4f8c150f0f4471567dc9418758d495d8bc9313bf/apps/minifront/src/state/swap/dutch-auction/get-sub-auctions.ts#L68-L90

It looks pretty straightforward, but by breaking down the steps and logging to console i was able to see that the decimalPlaces 0 call really does return a BigNumber that still contains decimal places.

===

TODO:

jessepinho commented 1 month ago

do you have steps to reproduce this? exact values to enter, etc.?

jessepinho commented 1 month ago

Moving to blocked until we have steps to reproduce