TempleGold

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

Miner Attack

Summary

The usage of block.timestamp in the SpiceAuction, TempleGoldStaking, and DaiGoldAuction contracts is vulnerable to a miner attack.

Vulnerability Details

https://github.com/Cyfrin/2024-07-templegold/blob/57a3e597e9199f9e9e0c26aab2123332eb19cc28/protocol/contracts/templegold/SpiceAuction.sol#L24

https://github.com/Cyfrin/2024-07-templegold/blob/57a3e597e9199f9e9e0c26aab2123332eb19cc28/protocol/contracts/templegold/TempleGoldStaking.sol#L23

https://github.com/Cyfrin/2024-07-templegold/blob/57a3e597e9199f9e9e0c26aab2123332eb19cc28/protocol/contracts/templegold/DaiGoldAuction.sol#L24

In the SpiceAuction, TempleGoldStaking, and DaiGoldAuction contracts, block.timestamp is used to determine time. This approach is susceptible to manipulation by miners, who can influence the block timestamp to a certain extent, potentially leading to undesirable behavior in the smart contracts.

Impact

The vulnerability allows miners to manipulate the timing-dependent functionalities within the contracts, which can result in unfair advantages, unintended contract behaviors, or exploitation of the auction and staking mechanisms.

Tools Used

Manual Review

Recommendations

Consider using block.number as a safer alternative for determining time within the contracts. block.number provides a more secure and predictable way to measure the passage of time and reduces the risk of miner manipulation.

Updates

Lead Judging Commences

inallhonesty Lead Judge about 1 year ago
Submission Judgement Published
Invalidated
Reason: Incorrect statement

Support

FAQs

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