Lack of Zero-Amount Check in increaseCollateral and decreaseCollateral Functions"
The contract fails to verify whether the values in increaseCollateral and decreaseCollateral are non-zero. This oversight could potentially result in unnecessary gas expenditures for null operations.
The impact of this issue is primarily on efficiency and user experience. If a user accidentally calls the increaseCollateral or decreaseCollateral functions with a zero amount, the transaction will still be processed and gas will be consumed, even though the state of the contract doesn't change. This could lead to unnecessary gas costs for the user.
Manual
To resolve this issue, you should add a require statement at the beginning of the increaseCollateral and decreaseCollateral functions to check if the amount is greater than zero. This will prevent unnecessary gas expenditures for null operations. Here is how you can do it:
This will ensure that the functions will only execute if the amount is greater than zero, thus saving unnecessary gas costs.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.