Assessment reports>Orderly Network>Threat Model>finishFrozenBalance

Function: finishFrozenBalance(byte[32] _tokenHash, uint256 _chainId, uint128 _deltaBalance)

The function is triggered only from the accountWithDrawFinish function of the Ledger contrast when the cross-chain process of withdrawal will be finished successfully.

Inputs

  • _tokenHash

    • Control: Actually controlled by operator, because the Vault contract in chainId just sends back cross-chain messages with received data.

    • Constraints: If tokenFrozenBalanceOnchain[_tokenHash][_chainId] is less than _deltaBalance, the call will revert.

    • Impact: The frozen balance for _tokenHash in _chainId will be decreased by _deltaBalance amount.

  • _chainId

    • Control: Actually controlled by operator, because the Vault contract in chainId just sends back cross-chain messages with received data.

    • Constraints: If tokenFrozenBalanceOnchain[_tokenHash][_chainId] is less than _deltaBalance, the call will revert.

    • Impact: The frozen balance for _tokenHash in _chainId will be decreased by _deltaBalance amount.

  • _deltaBalance

    • Control: Actually controlled by operator, because the Vault contract in chainId just sends back cross-chain messages with received data.

    • Constraints: If tokenFrozenBalanceOnchain[_tokenHash][_chainId] is less than _deltaBalance, the call will revert.

    • Impact: The frozen balance for _tokenHash in _chainId will be decreased by _deltaBalance amount.

Branches and code coverage

Intended branches

  • The frozen balance was decreased properly.

Negative behavior

  • tokenFrozenBalanceOnchain[_tokenHash][_chainId] is less than _deltaBalance.

  • The caller is not a trusted Ledger contract.

Zellic © 2024Back to top ↑