Closed 0xDmtri closed 3 months ago
"We should really add some unit tests on this function after these changes. Maybe we could separate all peripheral functions into a deployable inherited contract that we can then easily unit test in foundry"
Just for this contract? Should we do it in this pull request or make a new one? U wanna make an abstract contract right?
Another edge case was found:
It will still produce a div 0 error if sqrtPriceX96 == 0
. I dont think we can fix that except of doing:
require(sqrtPriceX96 != 0)
@0xOsiris thoughts?
Change log:
sqrtPriceX96 == 0
.decimals()
."We should really add some unit tests on this function after these changes. Maybe we could separate all peripheral functions into a deployable inherited contract that we can then easily unit test in foundry"
Just for this contract? Should we do it in this pull request or make a new one? U wanna make an abstract contract right?
Yeah, we can isolate this into a different PR though
ah shit, theres a conflict with .gitignore, will resolve now
done!
Motivation
Fix annoying bug related to not enough bits that results in div zero due to very small price number.
Solution
PR Checklist