Unchecked Return Values in returnUnpurchasedNative()
Function
The returnUnpurchasedNative()
function in the smart contract uses the low-level .call()
function.
The .call()
function is used to send Ether from the contract to the manager. The return value of this function is a boolean indicating whether the call was successful. However, this return value is not checked, which means that if the call fails for any reason (for example, if the manager's balance is not enough), the function will proceed as if nothing went wrong. This could lead to unexpected behavior and potential loss of funds.
Always check the return value of .call()
. If the call fails, the function should revert or handle the error in some other way.
In this modified function, if the .call()
function fails, the require
statement will cause the transaction to revert, and an error message will be included in the transaction receipt.
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.