20,000 USDC
View results
Submission Details
Severity: low
Valid

Amount != 0 checks are missing

Summary

No check for parameter _amount zero is done at some places.

Vulnerability Details

In Beedle.sols functions mint, _burn, _mint, the check for _amount zero is not done. That means users will be able to run the functions passing _amount as zero.

In Staking.sols functions deposit and withdraw the check for _amount zero is not done as well.

There are five instances of this in the contract:
[1]
[2]
[3]
[4]
[5]

example: [example]

Impact

Users will be able to run the functions successfully and no there would be unnecessary gas cost. And also state update will cost gas.

Tools Used

Manual Inspection, Foundry tests

Recommendations

Consider checking if _amount is zero or not in the beginning of the function.

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.