50949 sc insight no check if raffle actually has enough funds
Description
Brief/Intro
Vulnerability 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,
isActive: true,
winner: address(0), // deprecated
winnerIndex: 0, // deprecated
claimed: false, // deprecated
quantity: quantity
});
emit PrizeAdded(prizeId, name);
}Impact Details
References
Proof of Concept
Previous49705 sc medium two vectors for unbounded gas consumption due to the normal raffle operationsNext51455 sc low inflated earned ui rewards when validator stake is zero due to missing totalstaked guard in view logic
Was this helpful?