Skip to main content

Claude/ChatGPT Prompt to Build an NFT Marketplace MVP with Contracts and Frontend

Build a minimal NFT marketplace — list, buy, offer, cancel contracts plus a Next.js + wagmi frontend, IPFS metadata, and a test suite.

Fill in the placeholders

Edit the values, then copy your finished prompt.

Your Prompt
prompt.txt

                                

What this prompt does

This prompt sets the AI up as a senior smart-contract and web3 engineer and asks it to build a minimal NFT marketplace MVP — working contracts and frontend code, not pseudocode. The Marketplace contract handles list, buy, make-offer, accept-offer, and cancel with fee handling, guarded by reentrancy and access-control checks and checks-effects-interactions on every transfer. A Next.js + wagmi frontend, IPFS-style metadata, indexer-ready events, and a test suite round out an end-to-end flow you can stand up fast and then harden.

Four placeholders shape it to your build. [chain] sets the target network, [token_standard] picks the NFT standard (the default ERC-721), [fee_bps] sets the marketplace fee in basis points so the fee math is concrete, and [metadata_host] decides where token metadata is pinned and how the token URI scheme is documented. The emphasis on events for List, Buy, Offer, and Cancel means an indexer can later rebuild marketplace state from chain history.

When to use it

  • You want a working list/buy/offer/cancel marketplace flow end-to-end before polishing UI.
  • You need fee handling at a specific basis-point rate with correct fee math.
  • You want reentrancy guards and checks-effects-interactions baked into every transfer.
  • You're pinning metadata to IPFS and need a documented token URI scheme.
  • You want events emitted so an indexer can rebuild marketplace state later.
  • You need a test suite that includes the reentrancy attack you guarded against.

Example output

You get three fenced, copy-ready sections: the Marketplace contract, the Next.js + wagmi frontend pages, and the test suite. The contract implements list, buy, make-offer, accept-offer, and cancel with fee handling at [fee_bps], reentrancy and access-control guards, and List/Buy/Offer/Cancel events. The frontend covers listing and buying with wallet connect and transaction status. Metadata is pinned to [metadata_host] with a documented token URI scheme. The tests cover happy paths, fee math, and the specific reentrancy attack the guards defend against.

Pro tips

  • Set [fee_bps] as a real number like "250 (2.5%)" so the model writes exact fee math rather than a placeholder percentage.
  • Keep [token_standard] explicit; an ERC-721 marketplace and an ERC-1155 one differ in transfer and balance logic, so name the one you mean.
  • Spend real time on deliverable 6 — a reentrancy test you can run beats a comment claiming the code is safe.
  • For [metadata_host], naming "IPFS via Pinata" gets you a concrete pinning approach and URI scheme rather than a vague off-chain reference.
  • This is an MVP, not an audited production marketplace — treat the contract as audit-shaped scaffolding and harden it before handling real value.
  • Keep the events comprehensive; the List/Buy/Offer/Cancel events are what let you add an indexer later without re-deploying.

Frequently Asked Questions

Is the generated marketplace ready for production?
No. It's an MVP designed to stand up a working end-to-end flow fast, so treat the contract as audit-shaped scaffolding. Before handling real value you should harden it and have it professionally audited, which the prompt itself frames as a follow-up.
What token standards does it support?
Whatever you set in [token_standard]; the default is ERC-721. The transfer and balance logic differs between ERC-721 and ERC-1155, so name the standard you actually want rather than leaving it ambiguous to get correct contract code.
Why does the prompt insist on emitting events for List, Buy, Offer, and Cancel?
Those events let an off-chain indexer rebuild marketplace state from chain history without re-deploying the contract. Comprehensive events are what make it possible to add a queryable backend later, which is essential once the marketplace grows beyond reading directly from RPC.
Does the test suite actually test the reentrancy guard?
Yes. Deliverable 6 specifically covers the reentrancy attack the contract guards against, alongside happy paths and fee math. The prompt emphasizes a runnable reentrancy test over a comment claiming safety, so you can verify the guard holds.
Engr Mejba Ahmed

Need this built for real?

Engr Mejba Ahmed

AI Developer · Software Engineer

I'm Mejba — I design and ship production AI systems, automations, and full-stack apps. If you want this turned into a working solution for your team, let's talk.

More in Blockchain & Web3 Development Prompts

Engr Mejba Ahmed

Engr Mejba Ahmed

Claude Code Expert · Online

👋

Hey there!

Quick Actions

WhatsApp Instant reply

Chat on WhatsApp

+880 1723 741224 · Instant reply

Popular Questions

Engr Mejba Ahmed is connected
Engr Mejba Ahmed is typing...
Engr Mejba Ahmed avatar

✉ Want me to follow up? Drop your email

Engr Mejba Ahmed avatar

📞 Connect Directly

Choose how you'd like to reach me

WhatsApp

+880 1723 741224

Email

[email protected]

✓ Details sent! I'll get back to you shortly.

Powered by OpenAI

335+

Blog Posts

25

AI Courses

63

Projects

Services & Expertise

Pricing & Process

Learning & Resources

Connect & Support