The claimPoints
function allows users to claim their accumulated points, but it mints new tokens to the user's address (_mint(msg.sender, pointsToClaim)
) before updating the user's pendingPoints
balance (userInfo.pendingPoints = 0
).
Risk: A malicious user could reenter the claimPoints
function before their balance is updated, potentially claiming more points than they are entitled to.
Solution: To prevent reentrancy, the contract should update the user's pendingPoints
balance to zero before minting the tokens, or alternatively, use the ReentrancyGuard
modifier from OpenZeppelin.
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.