Closed sherlock-admin4 closed 5 months ago
This is intended design since the auction must complete within a guaranteed time frame to leave enough time for the claimer to incentivize all prize claims before the next draw closes.
If the entire process could be restarted, there may not be enough time left for claims after the draw is awarded and some prizes may not be claimed. The prize pool is designed to handle skipped draws gracefully by rolling over all prize liquidity to the next draw.
Agree, valid design decision
berndartmueller
medium
A new draw auction for the same draw cannot be started if the RNG request succeeded but the
finishDraw
auction expiredSummary
If the
finishDraw
auction expires while the RNG request succeeded, a new draw auction for the same draw cannot be started, resulting in the current draw not being rewarded.Vulnerability Detail
Multiple RNG request (upper limit is
maxRetries
) attempts are possible for the same draw if such a request fails. The two-step process consists of starting a draw action and requesting a random number, and once the RNG request succeeded,finishDraw
is called to retrieve the random number and provide it to the prize pool. Both thestartDraw
andfinishDraw
auctions are time-restricted and have to be retried if the elapsed auction time exceeds the configured duration.However, there is a specific scenario where it is not possible to start a new draw auction:
startDraw
has been called for a new draw, and the RNG request has been sent to the randomness provider contract. But thefinishDraw
call for this specific (completed) RNG request is too late, i.e., the auction expired. As a result, it is not possible to call thestartDraw
function for the same draw again, because the previous RNG request succeeded and thus it reverts withAlreadyStartedDraw
. Consequently, the current draw can not be rewarded.Impact
The current draw can not be rewarded, and it must be waited for the next draw to be rewarded.
Code Snippet
DrawManager.startDraw(..)
Tool used
Manual Review
Recommendation
Consider allowing the
startDraw
function to be called for the same draw again if the RNG request has succeeded but thefinishDraw
auction has expired.