Assessment reports>Orderly Network>Threat Model>setAllowedBroker

Function: setAllowedBroker(byte[32] _brokerHash, bool _allowed)

This allows the owner of the contract to add the hash of allowed broker and also remove it from the list of trusted brokers.

Inputs

  • _brokerHash

    • Control: Full control by owner.

    • Constraints: allowedBrokerSet should not contain the _brokerHash if _allowed is true and vice versa.

    • Impact: Hash of the broker that the user will be allowed to use for deposit.

  • _allowed

    • Control: Full control by owner.

    • Constraints: N/A.

    • Impact: If _allowed is true, the _brokerHash will be added; if _allowed is false, the _brokerHash will be removed.

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 was already added if _allowed is true.

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

  • Caller is not an owner.

Zellic © 2024Back to top ↑