missing zero check
"missing zero check" is found in the unstake
function of the contract. This function burns a certain amount of rETH tokens and then sends the equivalent ETH value to a specified address. However, there is no check to ensure that the amount
parameter is greater than zero. This means that a user could potentially call this function with an amount
of zero, causing the function to burn zero rETH tokens and send zero ETH. This would not only waste gas but could also potentially cause unexpected behavior in other parts of the contract or system. It is recommended to add a requirement at the beginning of the function to ensure that amount
is greater than zero.
Vs code
##Recommendation
To resolve this issue, you should add a check at the beginning of the unstake
function to ensure that the amount
parameter is greater than zero. This can be done using the require
function in Solidity, which will revert the transaction if the condition is not met. Here is how you can implement this:
This will ensure that the function cannot be called with an amount
of zero, preventing the potential waste of gas and any unexpected behavior that could arise from this.
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.