This contract lacks a mechanism to properly update the participant status after a user refunds their ETH or ERC20 tokens before deadline. This can lead to users still being considered participants, even after they have refunded their tokens. The issue is present in both the ETH and ERC20 refund functions, which allow users to refund their tokens but fail to update the participant status accordingly.
The participation status is managed separately through the changeParticipationStatus() function, but this state update is not called in the refund() function after a participant is refunded.
ETH Refund Function:
When a participant refunds their ETH before deadline, their ETH balance is refunded via the _refundETH internal function.
However, there is no state update that modifies the participant mapping to reflect the change in participation status.
As a result, a user could still be considered a participant even after their ETH is refunded and they are no longer part of the event.
This creates a potential issue of users being wrongly treated as participants after they have effectively opted out.
ERC20 Refund Function:
Similarly, the _refundERC20 function allows users to refund their ERC20 tokens (e.g., WETH, WBTC, USDC) before deadline but does not update the participant status in that function. Users can refund all their tokens, but they remain in the system as participants, leading to unintended consequences such as accessing functions restricted to participants.
Users who request a refund before deadline will still be considered participants, which could lead to confusion or potential abuse, as they are still treated as participants.
The absence of state update in the refund function allows a user who has opted out to still appear as a participant.
Manually source code review.
Modify the refund() function to ensure that after a participant is refunded, their participation status is updated accordingly in the participant mapping.For example:
Ensure that the status is properly set to false when a user decides to refund their ETH / ERC-20 Tokens and opt out of the event.
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.