-
Notifications
You must be signed in to change notification settings - Fork 4
Description
balancer-maths replicates SC implementation without using unsigned ints as mostly of the SC code does. This can cause issues, where SC would fail/revert implicitly with negative numbers, where balancer-maths would not.
An example where this was an issue was when calculating exactOut transactions with exactAmountOut greater than pool balance. This reverts on SC because balances get negative at some point, but it doesn't fail on TS, eventually becoming positive again and making it non-trivial to find the issue.
This issue aims to investigate other possible areas of balancer-maths that would require an explicit guard against negative amounts to make sure we don't face the same issue again.
Ps: make sure python and other languages also implement any extra explicit guards required.