TempleGold

TempleDAO
Foundry
25,000 USDC
View results
Submission Details
Severity: medium
Invalid

Since Temple Gold is not transferable, when Temple Gold fails to be sold, the Temple Gold cannot be transferred out by other means.

Summary

The code design covers the start of the auction, bidding, and claiming, but does not take into account the situation where Temple Gold is unsold. Therefore, if Temple Gold is unsold, it will be stuck and cannot enter the next auction.

As the documentation says,Temple gold is non-transferrable(https://codehawks.cyfrin.io/c/2024-07-templegold),Temple gold that has been distributed from the TempleGold contract to the DaiGoldAuction contract cannot be transferred out in other ways.

A similar vulnerability in Sherlock is considered medium risk: https://github.com/sherlock-audit/2024-03-axis-finance-judging/issues/94

Vulnerability Details

//TempleGold.sol
function mint() external override onlyArbitrum {
VestingFactor memory vestingFactorCache = vestingFactor;
DistributionParams storage distributionParamsCache = distributionParams;
if (vestingFactorCache.numerator == 0) { revert ITempleGold.MissingParameter(); }
uint256 mintAmount = _getMintAmount(vestingFactorCache);
/// @dev no op silently
if (!_canDistribute(mintAmount)) { return; }
lastMintTimestamp = uint32(block.timestamp);
_distribute(distributionParamsCache, mintAmount);//temple gold sent to DaiGoldAuction contract
}
//DaiGoldAuction.sol
function notifyDistribution(uint256 amount) external override {
if (msg.sender != address(templeGold)) { revert CommonEventsAndErrors.InvalidAccess(); }
/// @notice Temple Gold contract mints TGLD amount to contract before calling `notifyDistribution`
nextAuctionGoldAmount += amount;
emit GoldDistributionNotified(amount, block.timestamp);
}
//Lack of handling of the situation where Temple Gold is unsold.

Impact

All auctions are susceptible to being unsold. The DaiGoldAuction contract only includes scenarios for starting the auction, bidding, and user claims after the auction concludes. It does not handle scenarios where Temple Gold cannot be sold. Therefore, if Temple Gold cannot be sold, it will be stuck, unable to be transferred or added to future Temple Gold auctions.

Tools Used

Manual review

Recommendations

Added handling of temple gold when no one bids. For example, after the auction ends and no one bids, the temple gold of the auction will be transferred to `nextAuctionGoldAmount`

Updates

Lead Judging Commences

inallhonesty Lead Judge 11 months ago
Submission Judgement Published
Invalidated
Reason: Incorrect statement

Support

FAQs

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