Christmas Dinner

First Flight #31
Beginner FriendlyFoundrySolidity
100 EXP
View results
Submission Details
Severity: medium
Invalid

function refund()

Summary

Function refund(), refund the amount back if user doesn't want to attend to the event any more, however it doesn't check for refundable balance. Also the function doesn't check if participant exists.

Vulnerability Details

function refund() external nonReentrant beforeDeadline {
address payable _to = payable(msg.sender);
_refundERC20(_to);
_refundETH(_to);
emit Refunded(msg.sender);
}

Users who ddn’t deposit could get a refund: The function allows users to request refunds without verifying if they made an actual deposit.

Impact

Financial Loss

Tools Used

Manual review

Recommendations

Check whether a user has a refundable balance and whether the participant exists.

require(participant[msg.sender], "Not a participant");
require(
balances[msg.sender][address(i_WBTC)] > 0 ||
balances[msg.sender][address(i_WETH)] > 0 ||
balances[msg.sender][address(i_USDC)] > 0 ||
etherBalance[msg.sender] > 0,
"No refundable balance"
);
Updates

Lead Judging Commences

0xtimefliez Lead Judge about 1 year ago
Submission Judgement Published
Invalidated
Reason: Incorrect statement

Support

FAQs

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

Give us feedback!