โ† All NFT Flashcard Decks

Marketplace Integration Flashcards

6 cards from real NFT practice questions. Tap to flip, then mark Knew It or Still Learning โ€” missed cards come back until you master them.

Read the first 6 Marketplace Integration flashcards as text
  1. A user wants to list a single, specific NFT for sale on a decentralized marketplace. To grant the marketplace the most precise and secure permission to transfer only that specific NFT upon a successful sale, which function must the user call on the NFT contract?

    Answer: approve(marketplaceAddress, tokenId)

    The `approve(address to, uint256 tokenId)` function grants an external address permission to transfer a single, specific token. This follows the principle of least privilege, as it's safer than `setApprovalForAll`, which would grant permission for all NFTs in the collection. The `transferFrom` functions would immediately transfer the token, which is not how listings work.

  2. A development team wants to programmatically receive a percentage of the sale price each time their NFTs are resold on compliant secondary marketplaces. Which EIP provides a standardized interface for contracts to signal and retrieve this royalty information?

    Answer: EIP-2981

    EIP-2981 is the NFT Royalty Standard. It specifies a `royaltyInfo(uint256 _tokenId, uint256 _salePrice)` function that marketplaces can call to determine the correct royalty recipient and amount for a given sale, enabling standardized, on-chain royalty payments.

  3. After deploying a new ERC-721 contract, a developer notices that marketplaces are not displaying the collection's overall name, description, or logo, although individual NFTs and their traits appear correctly. Which of the following is the most likely missing feature in the contract?

    Answer: A `contractURI()` function that points to collection-level metadata.

    Marketplaces like OpenSea use the `contractURI()` function to pull collection-level metadata, including the name, description, and image for the collection page. While a broken `tokenURI` would affect individual NFTs, the problem described is with the collection as a whole.

  4. An NFT marketplace enables gas-less listings by having users sign an off-chain message that details the sale terms (e.g., NFT, price, deadline). A buyer can then submit this signed message to the marketplace's smart contract to execute the trade. What is this common integration pattern called?

    Answer: Off-chain order book with on-chain settlement

    This pattern describes an off-chain order book. Sale orders are created and stored off-chain as signed messages (gas-less), and the final settlement (the actual transfer of NFT and payment) occurs on-chain when a buyer submits the valid, signed order to the contract.

  5. For a marketplace to programmatically discover if an NFT contract supports optional features like EIP-2981 (Royalties) or ERC721Enumerable, which standard EIP-165 function must the contract implement?

    Answer: supportsInterface(bytes4 interfaceId)

    EIP-165 specifies the `supportsInterface(bytes4 interfaceId)` function. This function allows external contracts and platforms to check if a contract implements a specific set of functions, defined as an interface. Marketplaces use this to gracefully handle different NFT features.

  6. Which of the following represents the most significant security risk to a user who calls `setApprovalForAll(marketplaceAddress, true)` on their NFT contract?

    Answer: A vulnerability in the marketplace contract could allow an attacker to drain all of the user's approved NFTs from that collection.

    `setApprovalForAll` grants the specified address (the marketplace) ongoing permission to transfer ALL NFTs the user owns in that collection. If the marketplace's contract has a reentrancy bug or other vulnerability, an attacker could exploit it to call `transferFrom` repeatedly, stealing every approved NFT from the user's wallet.