In this challenge, you need to discover a hidden minting mechanism in the NFT contract itself! The key lies in the onERC721Received function.
The NFTFlags contract includes:
onERC721Received handleronERC721Received function. What does it check for?
data parameter during transfer
nftFlags.safeTransferFrom(
yourAddress,
address(nftFlags),
token1Id,
abi.encodePacked(token9Id)
);
The contract will:
- Verify you own both tokens
- Check that they're the correct challenge tokens
- Mint you the secret flag (10)
- Return your original token
Congratulations! You've discovered and exploited a hidden minting mechanism! 🎉
Remember: All contract code is public and can be analyzed. Hidden mechanics aren’t truly hidden - they’re just waiting to be discovered!
Hidden functionality in smart contracts has led to several security incidents:
This demonstrates: