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; anERC-721marketplace 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.