Assessment reports>Orderly Network>Threat Model>subBalance

Function: subBalance(AccountTypes.Account account, byte[32] tokenHash, uint128 amount)

This facilitates decreasing the balance of a given token for a given account.

Inputs

  • account

    • Control: Fully controllable by calling function.

    • Constraints: None.

    • Impact: The account whose balance is to be decreased.

  • tokenHash

    • Control: Fully controllable by calling function.

    • Constraints: None.

    • Impact: The token whose balance is to be decreased.

  • amount

    • Control: Fully controllable by calling function.

    • Constraints: None.

    • Impact: The amount by which the balance is to be decreased.

Branches and code coverage

Intended branches

  • Account balance is decreased by the amount.

Negative behavior

  • Should not allow decreasing balance for an invalid token. This is presumably checked at other functions' levels.

Zellic © 2024Back to top ↑