Round up protocol fee to 1 if its 0 #331
Labels
effort: medium
Default level of effort.
priority: 0
Do this first before everything else. This is critical and nothing works without this.
type: bug
Something isn't working.
work: clear
Sense-categorize-respond. The relationship between cause and effect is clear.
Reported in Codehawk audit, a user can bypass paying the protocol fee by withdrawing in smaller amounts such that 10% of it becomes 0. For example,
Thus, as a fix, round up the protocol fee to
1
token if the following conditions are met:withdraw amount > 0
ANDprotocol fee (10% of withdraw amount ) == 0
Note: Double check that the function reverts when withdraw amount is 0 so that users do not pay a fee of 1 token when there are no tokens to withdraw.
The text was updated successfully, but these errors were encountered: