49868 sc insight raffle sol does not enforce prize endtimestamp allowing user and admin interactions with expired prizes
Description
The severity and impact mismatch is intentional. While the stated impact is Contract fails to deliver promised returns, but doesn't lose value, I believe the overall severity is High/Medium in relation to failed functionality causing disparity between the protocols expectation and the actual contract execution.
Summary
Details
function addPrize( string calldata name, string calldata description, uint256 value,uint256 quantity) external onlyRole(ADMIN_ROLE) {
uint256 prizeId = nextPrizeId++;
prizeIds.push(prizeId);
require(bytes(prizes[prizeId].name).length == 0, "Prize ID already in use");
require(quantity > 0, "Quantity must be greater than 0");
prizes[prizeId] = Prize({
name: name,
description: description,
value: value,
endTimestamp: 0, /@audit: by default, prizes have no expiration date.
isActive: true,
winner: address(0), // deprecated
winnerIndex: 0, // deprecated
claimed: false, // deprecated
quantity: quantity
});
emit PrizeAdded(prizeId, name);
}Impact
Mitigation
Proof of Concept
Link to Proof of Concept
Previous50428 sc medium reverting on callback increases chances of winningNext50425 sc high active non slashed validators cannot claim rewards when a reward token is disabled
Was this helpful?