Platform: Code4rena
Start Date: 13/12/2022
Pot Size: $36,500 USDC
Total HM: 5
Participants: 77
Period: 3 days
Judge: gzeon
Total Solo HM: 1
Id: 191
League: ETH
Rank: 63/77
Findings: 1
Award: $19.22
๐ Selected for report: 0
๐ Solo Findings: 0
๐ Selected for report: Soosh
Also found by: 9svR6w, Apocalypto, Ch_301, HE1M, Koolex, SmartSek, Titi, Trust, Zarf, bin2chen, btk, carrotsmuggler, csanuragjain, dic0de, dipp, gz627, hansfriese, hihen, imare, immeas, indijanc, jadezti, kuldeep, ladboy233, maks, neumo, obront, rvierdiiev, sces60107, sk8erboy
19.2206 USDC - $19.22
owner can retrieve the token although drawing is in progress
lastResortTimelockOwnerClaimNFT() Be used in: " If no users ultimately claim the NFT, the admin specifies a timelock period after which they can retrieve the raffled NFT. "
But it is no check that if draw is already in progress, i.e. the current round of request.drawTimelock >= block.timestamp it should not be able to be lastResortTimelockOwnerClaimNFT(). Because a new round of draw has already started and the results may be available.
The above problems can occur in the following two cases๏ผ 1: Because: _settings.drawBufferTime >= HOUR_IN_SECONDS and <= MONTH_IN_SECONDS _settings.recoverTimelock > = WEEK_IN_SECONDS and <= MONTH_IN_SECONDS * 12
if drawBufferTime = two weeks and recoverTimelock = one weeks
So: this condition is possible: drawBufferTime > recoverTimelock
2: The first few rounds have been unfulfilled and keep repeating to start a new round, resulting in request.drawTimelock > settings.recoverTimelock will appear
add check drawTimelock
function lastResortTimelockOwnerClaimNFT() external onlyOwner { // If recoverTimelock is not setup, or if not yet occurred if (settings.recoverTimelock > block.timestamp) { // Stop the withdraw revert RECOVERY_IS_NOT_YET_POSSIBLE(); } + if (request.drawTimelock >= block.timestamp) { + revert STILL_IN_DRAWING(); + } ...
#0 - c4-judge
2022-12-17T12:37:01Z
gzeon-c4 marked the issue as duplicate of #146
#1 - c4-judge
2022-12-17T12:37:04Z
gzeon-c4 marked the issue as satisfactory
#2 - c4-judge
2023-01-23T17:09:29Z
gzeon-c4 changed the severity to 3 (High Risk)