Assessment reports>Orderly Network>Threat Model>unfrozenBalance

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

This allows the unfreezing of a given amount 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 unfrozen.

  • withdrawNonce

    • Control: Fully controllable by calling function.

    • Constraints: None.

    • Impact: The nonce of the withdrawal.

  • tokenHash

    • Control: Fully controllable by calling function.

    • Constraints: None.

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

  • amount

    • Control: Fully controllable by calling function.

    • Constraints: None.

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

Branches and code coverage

Intended branches

  • Account frozen balance for the given withdrawNonce should be decreased by the amount. Currently not performed, as it is reset to zero instead.

  • Should be called somewhere. Currently, it is not called anywhere.

  • Account balance is increased by the amount.

  • Account total frozen balance is decreased by the amount.

  • Total frozen balance should be decreased by the amount.

Negative behavior

  • Should not allow unfreezing balance if there is no frozen balance for the given withdraw nonce. Currently, this is not checked at this level.

  • Should not allow unfreezing balance if the withdraw nonce is not greater than the last withdraw nonce. Currently, this is not checked at this level.

Zellic © 2024Back to top ↑