Function setProtocolFee(uint48 fee_) external requiresAuth
Intended behavior.
This function allow authorized user or owner of contract to change protocolFee value.
There are no restrictions on the max amount of the fee
Negative behavior.
in case of a call by an unauthorized user or not the owner function should be rejected.
the contract owner can set 100% fee. even if this does not happen with the legitimate owner, in case of compromising the owner's key, the attacker can take all the funds sent to the contract by users since users also cannot reject transactions if they don't agree with the amount of the fee.
Preconditions.
if caller isn’t owner of contract they must be approved for the call.
Postconditions.
protocolFee = fee_ changing the value to a new one.
Inputs.
uint48 fee_: controlled
Examine all function calls the function makes.
a.
auth.canCall(msg.sender, address(this), msg.sig)
What is controllable? (callee, params, return value):
auth
- the address of the contract specified in the constructor.If return value controllable, how is it used and how can it go wrong?: if this function returns
true
, then the user is authorized to call this function.What happens if it reverts or tries to reenter? will revert in case caller is unauthorized.