Assessment reports>Orderly Network>Threat Model>setAllowedToken

Function: setAllowedToken(byte[32] _tokenHash, bool _allowed)

This allows the owner of the contract to add the allowed token hash and also remove it from allowedTokenSet.

Inputs

  • _tokenHash

    • Control: Full control by owner.

    • Constraints: N/A.

    • Impact: There is no impact since it is not used.

  • _allowed

    • Control: Full control by owner.

    • Constraints: N/A.

    • Impact: If _allowed is true, the _tokenHash will be added to the allowedTokenSet; if _allowed is false, the _tokenHash will be removed from allowedTokenSet.

Branches and code coverage

Intended branches

  • New hash was added successfully if _allowed is true.

  • New hash was removed successfully if _allowed is false.

Negative behavior

  • Zero hash.

  • The same hash already added if _allowed is true.

  • allowedTokenSet does not contain the hash if _allowed is false.

  • Caller is not an owner.

Zellic © 2024Back to top ↑