Hey, I just noticed this file:
|
if (_k(x0, y + 1) > xy) { |
I am pretty sure that is supposed to be '_f' there and not '_k'. Because there will be decimal differences there. It isn't a huge deal, but I am pretty sure it is an unintentional bug.
I am not 100% sure of the consequence of that bug, but my quick guess is that it is sometimes undercutting the value of returned 'y'. So sometimes 'getAmountOut' function returns just tiny bit less than what was possible to get from the swap.
I checked one of the deployed pools too and it seems like bug is in there for all deployed pools.
Example: https://basescan.org/address/0x2647f963fb688b89487d6da49fd1528063a5438b#code
Hey, I just noticed this file:
contracts/contracts/Pool.sol
Line 426 in a5fae2e
I am pretty sure that is supposed to be '_f' there and not '_k'. Because there will be decimal differences there. It isn't a huge deal, but I am pretty sure it is an unintentional bug.
I am not 100% sure of the consequence of that bug, but my quick guess is that it is sometimes undercutting the value of returned 'y'. So sometimes 'getAmountOut' function returns just tiny bit less than what was possible to get from the swap.
I checked one of the deployed pools too and it seems like bug is in there for all deployed pools.
Example: https://basescan.org/address/0x2647f963fb688b89487d6da49fd1528063a5438b#code