TempleGold

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

ActivationMode functionality is not used in the SpiceAuction

Summary

In SpiceAuction, there can be two activation mode in auction config. However, this is not used properly in the contract and can be removed.

Vulnerability Details

The SpiceAuctioncontract currently has following code for checking ActivationModeconfig.

https://github.com/Cyfrin/2024-07-templegold/blob/main/protocol/contracts/templegold/SpiceAuction.sol#L161-L164

if (config.activationMode == ActivationMode.AUCTION_TOKEN_BALANCE) {
if (config.minimumDistributedAuctionToken == 0) { revert MissingAuctionTokenConfig(); }
}

It doesn't matter whether the config.activationModeis AcitvationMode.AUCTION_TOKEN_BALANCE or ActivationMode.USER_FIRST_BIDbecause config.minimumDistributedAuctionTokenwon't be 0in any case because it is already checked during setAuctionConfig.

https://github.com/Cyfrin/2024-07-templegold/blob/main/protocol/contracts/templegold/SpiceAuction.sol#L97-L98

if (_config.waitPeriod == 0
|| _config.minimumDistributedAuctionToken == 0) { revert CommonEventsAndErrors.ExpectedNonZero(); }

Impact

SpiceAuctioncontract contains unneeded functionality and can be removed.

Tools Used

Manual review

Recommendations

Remove the checks or add more functionality.

Updates

Lead Judging Commences

inallhonesty Lead Judge 12 months ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity

Support

FAQs

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