TempleGold

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

we need to implement access control for distributeGold() and check for call to mint()

Unchecked External Call to mint Function + we need access controll

The call to templeGold.mint() in the _distributeGold function is not checked. If templeGold.mint() fails or reverts, the transaction will silently fail, which could lead to unexpected behavior.

Anyone can call the distributeGold()

/**
* @notice Mint and distribute TGOLD
*/
//@audit add access control
function distributeGold() external {
_distributeGold();
}
//@audit add check for success of the tx
function _distributeGold() private {
/// @dev no op silent fail if nothing to distribute
templeGold.mint();
}

Fix: Ensure to handle the success or failure of the mint function call properly.

function _distributeGold() private {
// Check if minting succeeds
try templeGold.mint() {
// Minting successful
} catch {
// Handle minting failure
revert CommonEventsAndErrors.MintFailed();
}
}
Updates

Lead Judging Commences

inallhonesty Lead Judge 11 months ago
Submission Judgement Published
Invalidated
Reason: Incorrect statement

Support

FAQs

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