Raffle::editPrizes lacks logic to make prizes immutable once winner selection starts or users join breaking user trust.
The Raffle contract allows an admin to change a prize's value and quantity after users have joined and even after winner selection has started. This breaks the promised fairness and transparency, leaving users locked into a prize that may be less valuable than advertised.
Plume Network
Originally disclosed on Immunefi
49954 sc insight raffle editprizes lacks logic to make prizes immutable once winner selection starts or users join breaking user trust
Submitted on Jul 20th 2025 at 18:49:15 UTC by @blackgrease for Attackathon | Plume Network
- Report ID: #49954
- Report Type: Smart Contract
- Report severity: Insight
- Target: https://github.com/immunefi-team/attackathon-plume-network/blob/main/plume/src/spin/Raffle.sol
- Impacts: Contract fails to deliver promised returns, but doesn't lose value
Summary
In a Raffle system, prizes should be immutable once winner selection begins or users join a prize pool. The Raffle contract does not prevent prize parameters from being changed while users are joining or while winner selection is in progress, which breaks user trust and the promise of fair, transparent prize distribution.
Description
The Raffle contract allows prizes to be edited in all arguments while:
- users are joining a prize, and
- a winner is being selected.
Critically, while those activities are ongoing, a prize's value and quantity parameters can be changed. This undermines the project's stated transparency (e.g., "Winner selection is an admin-initiated process that can be repeated for each available prize slot. It is designed to be fair and transparent") because announced prizes can be modified after users have committed tickets.
Because there is no redeem/release mechanism for tickets, users are effectively locked into a prize whose parameters may later be reduced or otherwise changed. This breaks trust and can be considered unfair.
Functions associated with the issue
The function Raffle::requestWinner()
//@audit: does not lock editPrize on specific prize allowing prize to change. Once winner selection starts, prizes should be immutable.
function requestWinner(uint256 prizeId) external onlyRole(ADMIN_ROLE) {
if (winnersDrawn[prizeId] >= prizes[prizeId].quantity) {
revert AllWinnersDrawn();
}
if (prizeRanges[prizeId].length == 0) {
revert EmptyTicketPool();
}
require(prizes[prizeId].isActive, "Prize not available");
if (isWinnerRequestPending[prizeId]) {
revert WinnerRequestPending(prizeId);
}
isWinnerRequestPending[prizeId] = true;
string memory callbackSig = "handleWinnerSelection(uint256,uint256[])";
uint256 requestId = supraRouter.generateRequest(callbackSig, 1, 1, uint256(keccak256(abi.encodePacked(prizeId, block.timestamp))), msg.sender );
pendingVRFRequests[requestId] = prizeId;
emit WinnerRequested(prizeId, requestId);
}
The function Raffle::editPrize()
//@audit: the `editPrize` has no logic prevent prizes being edited while winner section is active or users have joined.
function editPrize( uint256 prizeId, string calldata name, string calldata description, uint256 value, uint256 quantity ) external onlyRole(ADMIN_ROLE) prizeIsActive(prizeId) {
// Update prize details without affecting tickets or active status
Prize storage prize = prizes[prizeId];
prize.name = name;
prize.description = description;
prize.value = value;
prize.quantity = quantity;
emit PrizeEdited(prizeId, name, description, value, quantity);
}
Impact
The reported severity label states: "Contract fails to deliver promised returns, but doesn't lose value." The author rates the issue as Medium because the core problem is broken transparency and unfairness to users.
{% stepper %} {% step %}
1. Protocol trust broken
The protocol can change announced prizes while users are participating, breaking transparency and user trust. {% endstep %}
{% step %}
2. Users stuck with altered prizes
Users join pools for a specific reward expectation. If prize value or quantity is later reduced, users cannot redeem their tickets and are locked into a less favorable prize.
{% endstep %}
{% step %}
3. Unfairness
Mutable prizes combined with lack of ticket redemption create unfair outcomes: users might not have entered a pool had they known updated prize parameters. {% endstep %}
{% step %}
4. Reputation damage
This behavior can damage Plume’s reputation due to perceived lack of full transparency and fairness. {% endstep %} {% endstepper %}
Likelihood: High — easily triggered during normal operations by an admin call to editPrize.
Mitigation (recommended)
Enforce immutability for prize economic parameters (value and quantity) once users have joined a prize or once winner selection has started. Suggested changes per function:
- Raffle::spendRaffle()
- When a user joins a prize pool, set a locked state for that prize so
editPrizecannot changevalueorquantityfor that prize.
- When a user joins a prize pool, set a locked state for that prize so
- Raffle::requestWinner()
- As an additional precaution, set the prize as locked when winner selection is initiated.
- Raffle::editPrize()
- Check the prize locked state. If locked, only allow changes to
nameanddescription. Do not allowvalueorquantitychanges when locked.
- Check the prize locked state. If locked, only allow changes to
- updatePrizeEndTimestamp
- Leave unchanged—allow admin to extend a prize's duration.
Once locked, the admin should only be able to update non-economic fields (name, description) and extend expiration times.
Proof of Concept (walk-through)
{% stepper %} {% step %} An admin adds an attractive prize:
- addPrize("Annual Prize","Only the luckiest win big", 50000, 20) {% endstep %}
{% step %} Prize is set to run for one month (assume Report #49868 is fixed). {% endstep %}
{% step %} Multiple users join this prize due to its high reward and many winners. {% endstep %}
{% step %} Admin calls requestWinner(prizeId) and begins winner selection. {% endstep %}
{% step %} Admin then calls editPrize(prizeId, ..., value = 10000, quantity = 5), reducing prize attractiveness. {% endstep %}
{% step %} Because editPrize has no locking logic, the changes succeed even though users have joined and winner selection started. {% endstep %}
{% step %} Users who bought tickets are now stuck: they cannot redeem tickets and the prize they joined is materially different. {% endstep %}
{% step %} Users lost their tickets and associated investment relative to the originally advertised prize parameters. {% endstep %} {% endstepper %}
Notes
- The recommended fixes maintain admin flexibility (name/description/time extension) while protecting users by preventing economic parameter changes once the prize is active or winner selection has begun.
- No external links or code was changed from the original report.
Context
The target is the Raffle contract in the Plume Network attackathon repository, at plume/src/spin/Raffle.sol. A raffle lets users spend tickets to join a prize pool, and an admin later initiates winner selection for each prize slot. The project describes winner selection as an admin-initiated process that can be repeated for each available prize slot and that is designed to be fair and transparent.
The report is a smart contract insight: the contract fails to deliver promised returns but does not lose value. The author rates it Medium because the core problem is broken transparency and unfairness to users.
Setup
The relevant actors are an admin holding ADMIN_ROLE and ordinary users who join prize pools. The admin uses addPrize, editPrize and requestWinner. Users join through spendRaffle. Winner selection is requested through a Supra router call, and the callback signature is handleWinnerSelection(uint256,uint256[]).
The precondition for the issue is simply normal operation: a prize exists, users have joined it, and the admin can still call editPrize.
Finding it
The researcher noticed that Raffle::requestWinner() does not lock the prize it is drawing a winner for. The audit comment in the code reads:
//@audit: does not lock editPrize on specific prize allowing prize to change. Once winner selection starts, prizes should be immutable.
function requestWinner(uint256 prizeId) external onlyRole(ADMIN_ROLE) {
if (winnersDrawn[prizeId] >= prizes[prizeId].quantity) {
revert AllWinnersDrawn();
}
if (prizeRanges[prizeId].length == 0) {
revert EmptyTicketPool();
}
require(prizes[prizeId].isActive, "Prize not available");
if (isWinnerRequestPending[prizeId]) {
revert WinnerRequestPending(prizeId);
}
isWinnerRequestPending[prizeId] = true;
string memory callbackSig = "handleWinnerSelection(uint256,uint256[])";
uint256 requestId = supraRouter.generateRequest(callbackSig, 1, 1, uint256(keccak256(abi.encodePacked(prizeId, block.timestamp))), msg.sender );
pendingVRFRequests[requestId] = prizeId;
emit WinnerRequested(prizeId, requestId);
}
The function checks that not all winners have been drawn, that the ticket pool is not empty, that the prize is active and that no winner request is already pending. It then marks a request as pending and calls the Supra router. Nothing in it prevents the prize parameters from being edited afterwards.
The second function, Raffle::editPrize(), has no guard at all against editing while users have joined or while winner selection is active:
//@audit: the `editPrize` has no logic prevent prizes being edited while winner section is active or users have joined.
function editPrize( uint256 prizeId, string calldata name, string calldata description, uint256 value, uint256 quantity ) external onlyRole(ADMIN_ROLE) prizeIsActive(prizeId) {
// Update prize details without affecting tickets or active status
Prize storage prize = prizes[prizeId];
prize.name = name;
prize.description = description;
prize.value = value;
prize.quantity = quantity;
emit PrizeEdited(prizeId, name, description, value, quantity);
}
The only access control is onlyRole(ADMIN_ROLE) and the only state check is prizeIsActive(prizeId). The function overwrites name, description, value and quantity unconditionally. In particular, value and quantity are economic parameters that users relied on when they committed tickets.
Because there is no redeem or release mechanism for tickets, a user who joined a pool cannot withdraw. If the prize is later made less attractive, the user is locked into the changed prize.
Exploitation
Step 1: an attractive prize is added
The admin adds a prize with a high value and a large number of winners:
addPrize("Annual Prize","Only the luckiest win big", 50000, 20)
Step 2: the prize runs for a month
The prize is set to run for one month, assuming Report #49868 is fixed.
Step 3: users join
Multiple users join the prize because of the high reward and the many winners.
Step 4: winner selection starts
The admin calls requestWinner(prizeId) and begins winner selection. As shown above, this sets isWinnerRequestPending[prizeId] = true and issues the VRF request, but it does not lock the prize.
Step 5: the prize is edited
The admin then calls:
editPrize(prizeId, ..., value = 10000, quantity = 5)
This reduces the prize's attractiveness after users have already committed.
Step 6: the edit succeeds
Because editPrize has no locking logic, the changes succeed even though users have joined and winner selection has started.
Step 7: users are stuck
Users who bought tickets cannot redeem them, and the prize they joined is materially different from the one advertised.
Step 8: loss relative to expectations
Users lost their tickets and the associated investment relative to the originally advertised prize parameters.
Root cause
The mistake is a missing state transition. A prize has an active flag and a pending-winner-request flag, but no locked state that freezes its economic parameters. requestWinner sets isWinnerRequestPending but never marks the prize as locked, and editPrize checks only prizeIsActive, so it will happily overwrite value and quantity at any time. The existing defences, role restriction and the active-prize modifier, do not address the timing problem: the admin is authorised to call the function, and the prize is still active, so both checks pass.
Impact
The impact is broken transparency and unfairness rather than direct loss of funds. The protocol can change announced prizes while users are participating, which breaks transparency and user trust. Users join pools for a specific reward expectation; if value or quantity is later reduced, they cannot redeem their tickets and are locked into a less favourable prize. Users might not have entered a pool had they known the updated prize parameters. The behaviour can also damage Plume's reputation through a perceived lack of full transparency and fairness.
Likelihood is high: the issue is easily triggered during normal operations by an admin call to editPrize. The severity label is "Contract fails to deliver promised returns, but doesn't lose value", and the author rates it Medium.
Fix
The recommendation is to enforce immutability for the prize economic parameters (value and quantity) once users have joined a prize or once winner selection has started. Per function:
Raffle::spendRaffle(): when a user joins a prize pool, set a locked state for that prize soeditPrizecannot changevalueorquantityfor that prize.Raffle::requestWinner(): as an additional precaution, set the prize as locked when winner selection is initiated.Raffle::editPrize(): check the prize locked state. If locked, only allow changes tonameanddescription; do not allowvalueorquantitychanges when locked.updatePrizeEndTimestamp: leave unchanged, so the admin can extend a prize's duration.
Once locked, the admin should only be able to update non-economic fields (name, description) and extend expiration times. This keeps admin flexibility while protecting users.
Variants to test
A positive result is a setter that changes an economic parameter with no locked-state check.
2. Check whether the winner-selection path sets any lock. In requestWinner, look for a write to a locked flag before the VRF request. A positive result is a request that proceeds with no state change that editPrize consults.
3. Check whether the join path sets any lock. In spendRaffle, look for a locked flag being set on first join. A positive result is a join that leaves the prize editable.
4. Check whether tickets can be redeemed or released. A positive result is the absence of any redeem or release function, which turns a mutable prize into a trap for users.
Hunting notes
This kind of bug hides in admin-only setters that overwrite configuration without a lifecycle guard. During recon, look for contracts with a join or commit phase and a separate draw phase, and check whether any state flag distinguishes the phases. Signals that point to it are an isActive modifier used as the only guard on an edit function, a pending-request flag that is set but never consulted by setters, and the absence of a redeem or release path for user commitments.
The researcher showed enough impact by walking through a concrete sequence: an attractive prize, users joining, winner selection starting, and an edit that reduces value and quantity, leaving users locked in. The report ties the behaviour to the project's own stated promise of fair and transparent winner selection, which is what makes the missing lock a contract-level failure rather than a style preference.
What happened, in plain words
A raffle is a lottery-style game. People buy or spend tickets to enter a draw, and later a winner is picked from all the tickets. In the Plume Network project there is a piece of code called a smart contract, named Raffle, that runs this game on a blockchain. A smart contract is a program that lives on a blockchain and runs as written, though its stored data can change when its functions are called.
In this raffle, an administrator (a person with special permission, called the admin) creates prizes. Each prize has a name, a description, a value (how much the prize is worth) and a quantity (how many winners there will be). Users spend tickets to join a prize pool. Later the admin starts the process of picking winners.
The problem the researcher found is simple to state: the admin can still change a prize's value and quantity after users have joined and even after winner selection has started. There is no rule in the code that freezes a prize once people have committed their tickets. So a prize advertised as "50,000, 20 winners" could quietly become "10,000, 5 winners" while people are already in the pool, and those people cannot take their tickets back.
This is not a bug that steals money directly. It is a trust and fairness problem: the contract does not deliver the promise it makes to users. The report calls this an "insight", a finding about design and behaviour rather than a direct theft, and the author rates it Medium.
The target and the setup
The code lives in a public repository used for a security competition (an "attackathon") on Plume Network. The exact file is plume/src/spin/Raffle.sol. The .sol ending means it is written in Solidity, the main programming language for smart contracts on Ethereum-style blockchains.
There are two kinds of people involved:
- The admin, who holds a permission called
ADMIN_ROLE. In Solidity, a "role" is a named permission; only an address holding that role can call certain functions. Think of it like a staff badge that opens a specific door. - Users, ordinary people who join prize pools by spending tickets.
The admin has several tools (functions):
addPrize, to create a prize.editPrize, to change a prize.requestWinner, to start picking a winner.updatePrizeEndTimestamp, to change when a prize ends.
Users join through a function called spendRaffle. When the admin starts winner selection, the contract asks an outside service, a Supra router, to produce a random number. VRF stands for Verifiable Random Function: a way to get a random number that anyone can later check was not tampered with. When that random number comes back, the contract runs a callback function named handleWinnerSelection(uint256,uint256[]). A callback is simply a function the contract agrees to run when the outside service replies.
The only precondition for the problem is normal, everyday use: a prize exists, users have joined it, and the admin can still call editPrize.
Finding it
The researcher read the code and noticed that the function that starts winner selection, requestWinner(), never puts a lock on the prize. Here is that function as it appears in the report:
//@audit: does not lock editPrize on specific prize allowing prize to change. Once winner selection starts, prizes should be immutable.
function requestWinner(uint256 prizeId) external onlyRole(ADMIN_ROLE) {
if (winnersDrawn[prizeId] >= prizes[prizeId].quantity) {
revert AllWinnersDrawn();
}
if (prizeRanges[prizeId].length == 0) {
revert EmptyTicketPool();
}
require(prizes[prizeId].isActive, "Prize not available");
if (isWinnerRequestPending[prizeId]) {
revert WinnerRequestPending(prizeId);
}
isWinnerRequestPending[prizeId] = true;
string memory callbackSig = "handleWinnerSelection(uint256,uint256[])";
uint256 requestId = supraRouter.generateRequest(callbackSig, 1, 1, uint256(keccak256(abi.encodePacked(prizeId, block.timestamp))), msg.sender );
pendingVRFRequests[requestId] = prizeId;
emit WinnerRequested(prizeId, requestId);
}
Line by line, in plain words:
- The first line is a comment left by the auditor. It says the function does not lock
editPrizefor this particular prize, so the prize can still change, and that once winner selection starts prizes should be immutable (unchangeable). function requestWinner(uint256 prizeId) external onlyRole(ADMIN_ROLE)declares the function. It takes a prize number (prizeId) and can only be called by someone with the admin role.externalmeans it can be called from outside the contract.if (winnersDrawn[prizeId] >= prizes[prizeId].quantity)checks whether the number of winners already drawn has reached the prize's quantity. If so,revert AllWinnersDrawn();stops the function with an error.revertmeans "cancel and undo everything".if (prizeRanges[prizeId].length == 0)checks whether the ticket pool is empty. If it is,revert EmptyTicketPool();stops with an error. You cannot draw a winner from no tickets.require(prizes[prizeId].isActive, "Prize not available");checks that the prize is still active. If not, the call fails with the message shown.if (isWinnerRequestPending[prizeId])checks whether a winner request is already in progress for this prize. If so,revert WinnerRequestPending(prizeId);stops it, so you cannot ask twice at once.isWinnerRequestPending[prizeId] = true;records that a request is now pending. This is the only state change before the outside call.string memory callbackSig = "handleWinnerSelection(uint256,uint256[])";stores the name and shape of the function the outside service should call back.memorymeans the value is kept temporarily while the function runs.uint256 requestId = supraRouter.generateRequest(...)asks the Supra router for a random number. The arguments include the callback signature, two1values, a number derived from the prize id and the current block time (keccak256is a hashing function that turns data into a fixed-length fingerprint), andmsg.sender, the address of whoever called the function.pendingVRFRequests[requestId] = prizeId;remembers which prize this request belongs to, so the reply can be matched up later.emit WinnerRequested(prizeId, requestId);writes a log entry (an "event") so anyone watching can see a winner was requested.
Notice what is missing: nowhere does this function mark the prize as locked. It checks several things, then asks for a random number, but the prize's value and quantity remain editable.
The second function, editPrize(), has no guard at all against editing while users have joined or while winner selection is active:
//@audit: the `editPrize` has no logic prevent prizes being edited while winner section is active or users have joined.
function editPrize( uint256 prizeId, string calldata name, string calldata description, uint256 value, uint256 quantity ) external onlyRole(ADMIN_ROLE) prizeIsActive(prizeId) {
// Update prize details without affecting tickets or active status
Prize storage prize = prizes[prizeId];
prize.name = name;
prize.description = description;
prize.value = value;
prize.quantity = quantity;
emit PrizeEdited(prizeId, name, description, value, quantity);
}
Line by line:
- The comment again flags the problem:
editPrizehas no logic to prevent editing while winner selection is active or users have joined. function editPrize(...)takes a prize number, a new name, a new description, a new value and a new quantity.calldatameans the text is passed in from outside and read-only.external onlyRole(ADMIN_ROLE) prizeIsActive(prizeId)means: callable from outside, only by the admin, and only if the prize is active.prizeIsActiveis a modifier, a reusable check attached to the function.Prize storage prize = prizes[prizeId];fetches the stored prize record.storagemeans it points at the permanent data on the blockchain, so changes to it are saved.- The next four lines overwrite the name, description, value and quantity with the new values, unconditionally.
emit PrizeEdited(...)logs that the prize was edited.
The only protection is the admin role and the active check. Neither cares whether users have joined or whether a winner is being drawn. In particular, value and quantity are the economic parameters, the numbers users relied on when they decided to spend tickets.
Because there is no redeem or release mechanism for tickets, a user who joined a pool cannot withdraw. If the prize is later made less attractive, the user is stuck with the changed prize.
Exploitation
This section walks through how the problem plays out in normal use. It is not a hack in the sense of breaking in; it is the admin using a function that should have been restricted by the contract.
Step 1: an attractive prize is added
The admin creates a prize with a high value and many winners:
addPrize("Annual Prize","Only the luckiest win big", 50000, 20)
This says: create a prize called "Annual Prize", described as "Only the luckiest win big", worth 50,000, with 20 winners. The high value and large number of winners make it appealing.
Step 2: the prize runs for a month
The prize is set to run for one month. The report notes this assumes a separate issue, Report #49868, is fixed. That other report is not described here.
Step 3: users join
Multiple users spend tickets to join, attracted by the high reward and the many winners. At this point they expect the prize as advertised.
Step 4: winner selection starts
The admin calls requestWinner(prizeId) and begins picking a winner. As shown above, this sets isWinnerRequestPending[prizeId] = true and asks the outside service for a random number, but it does not lock the prize.
Step 5: the prize is edited
The admin then calls:
editPrize(prizeId, ..., value = 10000, quantity = 5)
This changes the prize to be worth 10,000 with only 5 winners. The ... stands for the name and description arguments, which the report does not spell out here.
Step 6: the edit succeeds
Because editPrize has no locking logic, the change goes through even though users have joined and winner selection has started. Nothing in the contract objects.
Step 7: users are stuck
Users who bought tickets cannot redeem them, and the prize they joined is now materially different from the one advertised. There is no way out.
Step 8: loss relative to expectations
Users lost their tickets and the associated investment compared with the originally advertised prize parameters. They might never have entered had they known the final numbers.
Root cause
The mistake is a missing state transition. A "state" here is a stored condition, like a flag saying "this prize is active" or "a winner request is pending". A state transition is a change from one condition to another, for example from "open for joining" to "locked".
A prize has an active flag and a pending-winner-request flag, but no locked flag that freezes its economic parameters. requestWinner sets isWinnerRequestPending but never marks the prize as locked, and editPrize checks only prizeIsActive, so it will happily overwrite value and quantity at any time.
The existing defences, the role restriction and the active-prize modifier, do not address the timing problem. The admin is authorised to call the function, and the prize is still active, so both checks pass. The contract is asking "is this person allowed?" and "is the prize on?", but never "has this prize already been committed to by users?".
Impact
The impact is broken transparency and unfairness rather than direct loss of funds. The protocol can change announced prizes while users are participating, which breaks transparency and user trust. Users join pools for a specific reward expectation; if value or quantity is later reduced, they cannot redeem their tickets and are locked into a less favourable prize. Users might not have entered a pool had they known the updated prize parameters. The behaviour can also damage Plume's reputation through a perceived lack of full transparency and fairness.
Likelihood is high: the issue is easily triggered during normal operations by an admin call to editPrize. The severity label is "Contract fails to deliver promised returns, but doesn't lose value", and the author rates it Medium.
Fix
The recommendation is to enforce immutability for the prize economic parameters (value and quantity) once users have joined a prize or once winner selection has started. Immutability means once set, they cannot be changed. Per function:
Raffle::spendRaffle(): when a user joins a prize pool, set a locked state for that prize soeditPrizecannot changevalueorquantityfor that prize.Raffle::requestWinner(): as an additional precaution, set the prize as locked when winner selection is initiated.Raffle::editPrize(): check the prize locked state. If locked, only allow changes tonameanddescription; do not allowvalueorquantitychanges when locked.updatePrizeEndTimestamp: leave unchanged, so the admin can extend a prize's duration.
Once locked, the admin should only be able to update non-economic fields (name, description) and extend expiration times. This keeps admin flexibility while protecting users. In everyday terms: once people have bought tickets, the prize's worth and number of winners are frozen, but the organiser can still fix a typo in the description or give people more time.
Variants to test
These are other places to look for the same kind of mistake:
A positive result is a setter that changes an economic parameter with no locked-state check. A "setter" is a function that sets a value.
2. Check whether the winner-selection path sets any lock. In requestWinner, look for a write to a locked flag before the VRF request. A positive result is a request that proceeds with no state change that editPrize consults.
3. Check whether the join path sets any lock. In spendRaffle, look for a locked flag being set on first join. A positive result is a join that leaves the prize editable.
4. Check whether tickets can be redeemed or released. A positive result is the absence of any redeem or release function, which turns a mutable prize into a trap for users.
Hunting notes
This kind of bug hides in admin-only setters that overwrite configuration without a lifecycle guard. A lifecycle guard is a check that asks "what stage is this thing at?" before allowing a change. During recon (the early reading of a codebase to understand it), look for contracts with a join or commit phase and a separate draw phase, and check whether any state flag distinguishes the phases. Signals that point to it are an isActive modifier used as the only guard on an edit function, a pending-request flag that is set but never consulted by setters, and the absence of a redeem or release path for user commitments.
The researcher showed enough impact by walking through a concrete sequence: an attractive prize, users joining, winner selection starting, and an edit that reduces value and quantity, leaving users locked in. The report ties the behaviour to the project's own stated promise of fair and transparent winner selection, which is what makes the missing lock a contract-level failure rather than a style preference.
Glossary
- Smart contract: a program stored on a blockchain that runs exactly as written and cannot be quietly altered after deployment.
- Blockchain: a shared, append-only record of transactions kept by many computers, so no single party can rewrite history.
- Solidity: the programming language used to write smart contracts on Ethereum-style blockchains; files end in
.sol. - Raffle: a lottery-style game where users spend tickets to enter a draw and winners are picked later.
- Prize pool: the collection of tickets entered for a particular prize.
- Admin: a person or address with special permission to manage the contract.
- Role: a named permission in a smart contract; only addresses holding it can call certain functions.
ADMIN_ROLE: the specific role name that grants admin powers in this contract.- Function: a named block of code that does something when called.
- Parameter / argument: a value passed into a function, such as a prize number or a new value.
value: in this report, how much a prize is worth.quantity: in this report, how many winners a prize has.- Economic parameters: the numbers that affect what users get, here
valueandquantity. - Immutable: cannot be changed once set.
- Mutable: can be changed.
- State: the stored condition of the contract, such as flags and prize records.
- State transition: a change from one state to another, for example from "open" to "locked".
- Flag: a stored true/false value used to remember a condition.
revert: cancel the current call and undo its changes, usually because a check failed.require: a check that must be true, otherwise the call fails with a message.- Modifier: a reusable check attached to a function, such as
onlyRoleorprizeIsActive. external: callable from outside the contract.calldata: read-only data passed into a function from outside.memory: temporary storage that lasts only while the function runs.storage: permanent storage on the blockchain; changes are saved.- Event /
emit: a log entry written to the blockchain so outsiders can see something happened. - Callback: a function the contract agrees to run when an outside service replies.
- VRF (Verifiable Random Function): a way to produce a random number that can be checked later to prove it was not tampered with.
- Supra router: the outside service this contract asks for a random number.
keccak256: a hashing function that turns data into a fixed-length fingerprint.msg.sender: the address of whoever called the current function.block.timestamp: the time attached to the current block of transactions.- Setter: a function whose job is to set a value.
- Lifecycle guard: a check that asks what stage something is at before allowing a change.
- Recon: the early phase of reading and understanding a codebase before testing it.
- Insight: a finding about design or behaviour rather than a direct theft of funds.
- Severity: a rating of how serious a finding is, here Medium.
- Attackathon: a security competition where researchers look for bugs in a project's code.
- Redeem / release: a way for users to take back or withdraw what they committed, such as tickets.