TempleGold

TempleDAO
Foundry
25,000 USDC
View results
Submission Details
Severity: low
Valid

Potential Lock of TGLD Tokens in Zero-Bid Auctions in DaiGoldAuction Due to `recoverToken` Not Allowed on Past Auctions

Summary

The recoverToken function in the DaiGoldAuction contract uses the _currentEpochId to identify the epoch from which to recover tokens. This design can permanently lock TGLD tokens if a zero-bid auction is not processed before the next auction starts.

Vulnerability Details

The recoverToken function is designed to recover TGLD tokens from auctions that have not started or are in a cooldown period. It uses _currentEpochId to identify the relevant epoch:

DaiGoldAuction.sol#L274-L279

// auction started but cooldown pending
uint256 epochId = _currentEpochId;
EpochInfo storage info = epochs[epochId];
if (info.startTime == 0) { revert InvalidOperation(); }
if (info.isActive()) { revert AuctionActive(); }
if (info.hasEnded()) { revert AuctionEnded(); }

If an auction ends with zero bids and the admin doesn't recover the tokens before the next auction starts (which increments _currentEpochId), the tokens from the previous auction become unrecoverable and forever locked in the contract.

Note: The risk is exacerbated by the fact that an auction can potentially be started by anyone if auctionStarter is set to 0, and auctionsTimeDiff can be as low as 1 second. In such cases, as soon as a 0-bid auction ends, another auction could be started by anyone just 1 second later, thus permanently locking the tokens in the contract before the admin has a reasonable chance to recover them.

Impact

Permanent loss of funds.

Recommendations

Modify the recoverToken function to accept an epochId parameter, allowing recovery from specific past epochs.

Updates

Lead Judging Commences

inallhonesty Lead Judge 11 months ago
Submission Judgement Published
Validated
Assigned finding tags:

Auctioned tokens cannot be recovered for epochs with empty bids in DaiGoldAuction

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.