The trickOrTreat
function in the SpookySwap
contract uses msg.sender.call
to refund excess ETH sent by users when the payment exceeds the required cost. This mechanism can fail if the recipient does not support ETH transfers, potentially leaving users without refunds.
The function checks if the msg.value
is greater than the requiredCost
and attempts to refund the excess amount using: https://github.com/Cyfrin/2024-10-trick-or-treat/blob/main/src/TrickOrTreat.sol#L100-L103
If the recipient is a contract without a receive function, the call will fail, and the user will not receive their refund. This can lead to poor user experience and potential loss of funds.
This vulnerability could result in users losing ETH if they are not able to receive refunds, especially if they are interacting with contracts that do not have proper fallback functions implemented. It undermines the reliability of the contract and could lead to user dissatisfaction.
Manual Review
Allow users to manually withdraw their pending refunds.
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.