Snowman Merkle Airdrop

First Flight #42
Beginner FriendlyFoundrySolidityNFT
100 EXP
View results
Submission Details
Impact: medium
Likelihood: low
Invalid

`Snow::changeCollector` function `missing check for duplicate collectors.

Description:
The Snow::changeCollector function have check for zero address, but not for set the active collector again.

function changeCollector(address _newCollector) external onlyCollector {
if (_newCollector == address(0)) {
revert S__ZeroAddress();
}
@> s_collector = _newCollector;
emit NewCollector(_newCollector);
}

Impact:
Unnecesary gas consumption

Recommended Mitigation:
On Snow::changeCollector revert if the new collector address is the same that the old:

function changeCollector(address _newCollector) external onlyCollector {
if (_newCollector == address(0)) {
revert S__ZeroAddress();
}
+ if (s_collector == _newCollector) {
+ revert("Not Allow The Same Address");
+ }
s_collector = _newCollector;
emit NewCollector(_newCollector);
}
Updates

Lead Judging Commences

yeahchibyke Lead Judge about 1 month ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity

Support

FAQs

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