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
_brokerHashControl: Full control by owner.
Constraints:
allowedBrokerSetshould not contain the_brokerHashif_allowedis true and vice versa.Impact: Hash of the broker that the user will be allowed to use for deposit.
_allowedControl: Full control by owner.
Constraints: N/A.
Impact: If
_allowedis true, the_brokerHashwill be added; if_allowedis false, the_brokerHashwill be removed.
Branches and code coverage
Intended branches
New hash was added successfully if
_allowedis true.New hash was removed successfully if
_allowedis false.
Negative behavior
Zero hash.
The same hash was already added if
_allowedis true.allowedBrokerSetdoes not contain the hash if_allowedis false.Caller is not an owner.