Skip to content

Investigate possible unsigned int issues #123

@brunoguerios

Description

@brunoguerios

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions