TempleGold

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

`TempleGold.mint()` contract will stop working if Arbitrum is hardforked

## Summary
`TempleGold.mint()` funtion will stop working if Arbitrum is hardforked as the current chainId will not match the immutable `_mintChainId`.
## Vulnerability Details
Minting `$TGLD` tokens is only allowed on Arbitrum, and users can bridge their tokens via layerzero,where this is ensured by checking the chainId before accessing `TempleGold.mint()`:
```javascript
function mint() external override onlyArbitrum {
}
```
where:
```javascript
modifier onlyArbitrum() {
if (block.chainid != _mintChainId) {
revert WrongChain();
}
_;
}
```
where `_mintChainId` is private **immutable** value that can't be changed after deployment.
But this modifier will create issues if a hardfork happens for the network, as the `block.chainid` will change, and it will be different from the value of `_mintChainId` that was set when the contract was deployed.
## Impact
This will result in disabling minting `$TGLD` on Arbitrum; thus disabling the `SpiceAuction` & `TempleGoldStaking` contracts where `TempleGold.mint()` is called.
## Tools Used
Manual Review.
## Recommendations
Add a function to update `_mintChainId` to match the updated chainId of Arbitrum in case of hardforking.
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.