41672 sc insight permanent loss risk of user funds due to inflexible function design in claim
#41672 [SC-Insight] Permanent Loss Risk of User Funds Due to Inflexible Function Design in Claim()
Description
Description
Brief/Intro
function claim() external nonReentrant {
if (winnings[msg.sender] == 0) {
revert NoWinningsToClaim(msg.sender);
}
uint256 valueWon = winnings[msg.sender];
winnings[msg.sender] = 0;
(bool success,) = payable(msg.sender).call{value: valueWon}("");
require(success, "Transfer failed.");
emit Claim(msg.sender, block.timestamp, valueWon);
}The vulnerability
Vulnerability Details
Impacts
About the severity assessment
Proof of Concept
Proof of Concept
Previous#41664 [SC-Low] Users may receive fewer rewards due to the change in reward limitsNext#41682 [SC-Insight] Code can be optimized to use save a lot of gas.
Was this helpful?