You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The current implementation uses i128 as the base for fixed number calculations. In certain cases, this leads to overflow during intermediate calculations, causing inaccuracies or failures in the computation.
To resolve this issue, we should replace i128 with 256-bit numbers (e.g., U256 or similar) for intermediate calculations. After the calculations are complete, results can be safely converted back to u128 for storage as balances
Definition of Done
Create fixed number type with 256 bit number as base
Replace fixed number type in critical parts of XYK pool calculations
Requirements
External interfaces should remain the same
Try to avoid of using types with dynamic allocation
The text was updated successfully, but these errors were encountered:
Problem statement
Prevent overflow in fixed number calculations
Description
The current implementation uses
i128
as the base for fixed number calculations. In certain cases, this leads to overflow during intermediate calculations, causing inaccuracies or failures in the computation.To resolve this issue, we should replace i128 with 256-bit numbers (e.g., U256 or similar) for intermediate calculations. After the calculations are complete, results can be safely converted back to u128 for storage as balances
Definition of Done
Requirements
The text was updated successfully, but these errors were encountered: