TempleGold

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

Inconsistent auction configuration validation across `DaiGoldAuction` and `SpiceAuction`

Summary

The DaiGoldAuction and SpiceAuction contracts have different validation rules for the auctionStartCooldown parameter in their respective setAuctionConfig functions. Specifically, the DaiGoldAuction contract requires auctionStartCooldown to be non-zero, while the SpiceAuction contract allows it to be zero.

Vulnerability Details

// DaiGoldAuction.sol
function setAuctionConfig(AuctionConfig calldata _config) external override onlyElevatedAccess {
if (
@> _config.auctionStartCooldown == 0 || _config.auctionMinimumDistributedGold == 0
|| _config.auctionsTimeDiff == 0
) revert CommonEventsAndErrors.ExpectedNonZero();
// Later code...
}
// SpiceAuction.sol
function setAuctionConfig(SpiceAuctionConfig calldata \_config) external onlyDAOExecutor {
// Previous code...
@> /// @dev startCooldown can be zero
if (_config.waitPeriod == 0 || _config.minimumDistributedAuctionToken == 0) {
revert CommonEventsAndErrors.ExpectedNonZero();
}
// Later code...

Impact

The differing validation rules for auctionStartCooldown between the DaiGoldAuction and SpiceAuction contracts can lead to confusion and potential misconfigurations. Users or administrators may expect the same behavior across both contracts but encounter different requirements, leading to potential issues in auction setup and execution.

Tools Used

Manual code review

Recommendations

To ensure consistency and reduce the risk of misconfigurations, the validation rules for auctionStartCooldown should be aligned across both DaiGoldAuction and SpiceAuction contracts. There are two possible approaches:

  • Allow zero value for auctionStartCooldown in DaiGoldAuction:

// DaiGoldAuction.sol
function setAuctionConfig(AuctionConfig calldata \_config) external override onlyElevatedAccess {
if (
- _config.auctionStartCooldown == 0 || _config.auctionMinimumDistributedGold == 0
+ _config.auctionMinimumDistributedGold == 0
|| _config.auctionsTimeDiff == 0
) revert CommonEventsAndErrors.ExpectedNonZero();
// Later code...
}
  • Enforce non-zero value for auctionStartCooldown in SpiceAuction:

// SpiceAuction.sol
function setAuctionConfig(SpiceAuctionConfig calldata _config) external onlyDAOExecutor {
// Previous code...
/// @dev startCooldown can be zero
- if (_config.waitPeriod == 0 || _config.minimumDistributedAuctionToken == 0) {
+ if (_config.waitPeriod == 0 || _config.minimumDistributedAuctionToken == 0 || config.startCooldown == 0) {
revert CommonEventsAndErrors.ExpectedNonZero();
}
// Later code...
}
Updates

Lead Judging Commences

inallhonesty Lead Judge about 1 year ago
Submission Judgement Published
Invalidated
Reason: Design choice

Support

FAQs

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