Assessment reports>STFX>Threat Models>addTokenCapacity

Function: addTokenCapacity(address baseToken, address depositToken, uint96 capacity)

Sets the capacity for a given token trading pair during fundraising. This limit is per STF. Can only be set by the owner.

Care must be taken to avoid setting capacity for a non-whitelisted or invalid address, as it is not allowed to reset the capacity back to 0.

Inputs

  • baseToken

    • Control: Full, even non-whitelisted.

    • Constraints: Nonzero.

    • Impact: Decides the address of the base token to add a trading capacity to.

  • depositToken

    • Control: Full, even non-whitelisted.

    • Constraints: Nonzero.

    • Impact: Decides the address of the deposit token to add trading capacity to.

  • capacity

    • Control: Full.

    • Constraints: Nonzero.

    • Impact: Sets the actual capacity value. Cannot be reset to less than 1.

Branches and code coverage (including function calls)

Intended branches

  • Add capacity to multiple base/deposit pairs.

  • Change the capacity once set.

Negative behavior

  • Zero addresses.

  • Zero amount capacity.

Zellic © 2024Back to top ↑