TempleGold

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

Immutable chainId could pause minting of templeGold in case of hard fork

Summary

TempleGold can be minted only possible on source chain Arbitrum. mint() function includes onlyArbitrum modifier which checks if current chain is arbitrum by matching immutable saved chainId. The issue is, There is always a possibility of a chain being hard forked, it has happened with Ethereum in the past. In case of a hard fork, the actual chainID could change but contract will be using same chainId which will DOS the minting functionlties which affect overall staking and Auction ecosystem aroung templeGold

TempleGold can only be minted on the source chain, Arbitrum. The mint() function includes the onlyArbitrum modifier, which checks if the current chain is Arbitrum by matching an immutable saved chainId. However, there is always a possibility of a chain being hard-forked, as has happened with Ethereum in the past. In case of a hard fork, the actual chainId could change, but the contract will be using the same immutable chainId. This will cause a pause for the minting functionality, affecting the overall staking and auction ecosystem around TempleGold

Vulnerability Details

modifier onlyArbitrum() {
if (block.chainid != _mintChainId) { revert WrongChain(); }
_;
}

https://github.com/Cyfrin/2024-07-templegold/blob/main/protocol/contracts/templegold/TempleGold.sol#L343

Impact

Pause on minting TempleGold token

Tools Used

Manual

Recommendations

Do not use an immutable chainId to check if the current chain is Arbitrum. Consider implementing a more flexible chain identification method that can adapt to changes such as chain forks

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.