Snowman Merkle Airdrop

AI First Flight #10
Beginner FriendlyFoundrySolidityNFT
EXP
View results
Submission Details
Impact: low
Likelihood: low
Invalid

Inefficient Token Existence Check

function tokenURI(uint256 tokenId) public view override returns (string memory) {
@> ownerOf(tokenId); // Reverts if token doesn't exist (expensive)
return string.concat(s_baseUri, Strings.toString(tokenId));
}

Risk

Likelihood:

Impact:

  • Gas waste and poor UX

Proof of Concept

Recommended Mitigation

function tokenURI(uint256 tokenId) public view override returns (string memory) {
if (_ownerOf(tokenId) == address(0)) revert TokenDoesNotExist();
return string.concat(s_baseUri, Strings.toString(tokenId));
}
Updates

Lead Judging Commences

ai-first-flight-judge Lead Judge about 6 hours ago
Submission Judgement Published
Invalidated
Reason: Incorrect statement

Support

FAQs

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

Give us feedback!