TempleGold

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

Refactor the `authorizeContract` function so admin will only input addresses and the bool will be automatically true.

Summary

The boolean value for whitelist in the authorizeContract function can be set once and for all to true once and for all. This is easier as the admin will only have to input addresses.

Vulnerability Details

This submission is to refactor the code for efficiency and convinience. Here is how the refactored function will look:

function authorizeContract(address _contract) external override onlyOwner {
//if (_contract == address(0)) { revert CommonEventsAndErrors.InvalidAddress(); }
bool _whitelist = !authorized[_contract];
authorized[_contract] = _whitelist;
// emit ContractAuthorizationSet(_contract, _whitelist);
}

Impact

Convinience for the admin. No funds at risk.

Tools Used

Manual review.

Recommendations

make bool _whitelist in a local variable and not an argument

Updates

Lead Judging Commences

inallhonesty Lead Judge about 1 year ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity

Support

FAQs

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