NFT Dealers

First Flight #58
Beginner FriendlyFoundry
100 EXP
Submission Details
Impact: low
Likelihood: low

[G-6] Redundant `isWhitelisted` external function can be removed

Author Revealed upon completion

Redundant isWhitelisted external function can be removed

Description

The smart contract implements a getter for the whitelisted user but the mapping is already public. Public mappings already implement an accessor function, making the custom function redundant and increasing the deployment gas cost:

@> function isWhitelisted(address _user) external view returns (bool) {
@> return whitelistedUsers[_user];
@> }

Recommended Mitigation

Delete this function:

- function isWhitelisted(address _user) external view returns (bool) {
- return whitelistedUsers[_user];
- }

Support

FAQs

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

Give us feedback!