Skip to content

Pool keeps track of it's reserve #21

Description

@Neylix

Describe the problem you discovered

Currently the implementation means that the number of token in a pool + the number of token in its reserve address is exactly the amount that have been created on Archethic.
However if someone send tokens directly to the pool or the reserve address, then we cannot rely on there balance to ensure the 1:1 ratio of the bridge.

Describe the solution you'd like

To ease the calculation of this ration, the pool can have a new public variable "reserve" that must be update every time a swap is finished. So this variable should always be the exact amount that as been bridged

Epic

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions