The marketplace contract relies on users to externally approve NFT transfers before listing, which is a common source of confusion and transaction failures in NFT marketplaces.
Users who try to list NFTs without first approving the marketplace contract will experience failed transactions, leading to a poor user experience and increased gas costs due to failed transactions.
The normal behavior in NFT marketplaces is to either explicitly handle the approval process within the contract or clearly document the requirement for pre-approval.
The specific issue is that the listNFT function in the marketplace contract attempts to transfer NFTs from the seller to the contract using transferFrom, but there is no mechanism within the contract to ensure proper approval has been granted.
Likelihood: Medium
This issue affects every new listing attempt where the user hasn't previously approved the marketplace.
Transaction failures due to missing approvals are a common issue in NFT marketplaces
Impact: Low
No funds or NFTs are at risk, but users will experience failed transactions.
Users must understand they need to first approve the marketplace to transfer their NFTs, creating additional steps and potential confusion.
Failed transactions result in wasted gas fees for users.
Here's a demonstration of the issue:
This demonstrates that:
Attempting to list an NFT without first approving the marketplace will fail
The error message comes from the ERC721 contract, not from the marketplace
Users must perform a separate approval transaction before they can list NFTs
The benefits of these changes:
Improved User Experience: Users receive clear error messages about what they need to do or can use a combined function.
Reduced Failed Transactions: With proper checks, users are less likely to submit transactions that will fail.
Clear Documentation: The contract's requirements are explicitly stated in the code.
Gas Savings: Users don't waste gas on transactions that are guaranteed to fail.
While this isn't a security vulnerability per se, it's a significant usability concern that could lead to a poor user experience and unnecessary transaction failures. Implementing these changes would make the marketplace more user-friendly and reduce friction for users listing NFTs.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.