Skip to main content

Claude/ChatGPT Prompt to Build an ERC-721 NFT Minting Contract

Build an ERC-721A NFT minting contract with allowlist, reveal mechanics, ERC-2981 royalties, payment splits, and metadata management.

Fill in the placeholders

Edit the values, then copy your finished prompt.

Your Prompt
prompt.txt
Create an NFT minting smart contract for CryptoCreatures — a collection of 10,000 NFTs on Ethereum mainnet. The mint has 3 (team reserve, allowlist, public) phases. Build: 1) ERC-721A contract (gas-efficient batch minting) with name, symbol, baseURI, contractURI for OpenSea — implement maxSupply, maxPerWallet (5), and maxPerTransaction (3) limits. 2) Mint phases: allowlist mint using Merkle tree proof verification with 0.05 ETH price and 2 max per wallet, followed by public mint at 0.08 ETH per NFT. Include phase start/end timestamps controlled by owner. 3) Reveal mechanism: delayed reveal with provenance hash committed pre-mint — store provenance hash before mint, use Chainlink VRF v2 for fair assignment, and implement a reveal function that updates the baseURI from placeholder to revealed metadata. 4) Royalty enforcement using ERC-2981 at 5% — implement operator filtering for OpenSea Operator Filter Registry to enforce on-chain royalties. 5) Metadata: on-chain tokenURI returning ERC-721 JSON metadata (name, description, image, attributes array) with attributes stored IPFS via Pinata with CID stored as baseURI. Include a contractURI for collection-level metadata. 6) Withdraw function: split proceeds to 70% founder, 20% artist, 10% community treasury using PaymentSplitter or custom logic with pull-payment pattern. 7) Admin functions: setBaseURI, setMintPhase, setPrice, airdrop(addresses, quantities) for team members (50 NFTs), contest winners (20 NFTs), and pause/unpause. All admin functions emit events.

What this prompt does

This prompt scopes an ERC-721 NFT drop end to end using gas-efficient ERC-721A. You set [collection_name], [total_supply], [target_chain], and the number of [mint_phases], and it builds a contract with maxSupply, [max_per_wallet], and [max_per_tx] limits, multi-phase minting (allowlist via [allowlist_method] at [allowlist_price], then public at [public_price]), a [reveal_strategy], royalties, payment splits, and admin functions.

The structure works because launch-day disasters come from the parts that are easy to get subtly wrong. By specifying the reveal mechanism with a provenance hash and [randomness_source], royalty enforcement via [royalty_standard] at [royalty_percentage] with [marketplace_compliance], metadata in [metadata_format] stored on [metadata_storage], and proceeds split per [payment_splits] using a pull-payment pattern, the prompt forces every launch-critical decision to be concrete before deploy. The [mint_phases] count and per-phase limits like [max_per_wallet] and [max_per_tx] also shape the access control, so a team-reserve, allowlist, then public structure is encoded rather than improvised at mint time.

When to use it

  • You are planning an NFT drop and need mint phases, reveal, and royalties handled together
  • You want ERC-721A for cheaper batch minting
  • You need a Merkle-based allowlist with separate [allowlist_price] and [allowlist_max]
  • You want a fair delayed reveal backed by [randomness_source]
  • You need on-chain royalty enforcement compatible with [marketplace_compliance]
  • You are splitting proceeds across founder, artist, and treasury per [payment_splits]
  • You need owner-controlled phase timing and per-wallet caps enforced on-chain

Example output

Expect a full ERC-721A contract: supply and per-wallet limits ([max_per_wallet], [max_per_tx]), phase logic with owner-controlled start/end timestamps, [allowlist_method] verification, a [reveal_strategy] that swaps baseURI from placeholder to revealed metadata, [royalty_standard] implementation at [royalty_percentage], a tokenURI returning [metadata_format], a contractURI, a withdraw function splitting to [payment_splits], and admin functions (setBaseURI, setMintPhase, setPrice, airdrop, pause) that emit events. A reveal and provenance section explains the fairness guarantees and how the committed hash lets anyone verify the assignment afterward. The metadata layer describes how [metadata_format] is served from [metadata_storage], including the contractURI that marketplaces read for collection-level details like name, image, and royalty info.

Pro tips

  • Keep placeholders concrete to your real drop — actual [total_supply], [allowlist_price], and [public_price] so the generated contract matches the collection
  • Use a Merkle tree for [allowlist_method] rather than storing addresses on-chain; it is dramatically cheaper at scale
  • Commit the provenance hash before mint so the [reveal_strategy] is verifiably fair after the fact
  • Verify [randomness_source] is genuinely unpredictable; on-chain pseudo-randomness is exploitable, which is why Chainlink VRF is the default
  • Confirm royalty enforcement matches current [marketplace_compliance] reality, since operator-filter behavior has shifted across marketplaces
  • Reserve airdrop quantities for [airdrop_recipients] against [total_supply] deliberately, so the public mint does not exceed the cap
  • Use the pull-payment pattern for [payment_splits] and test the withdraw path, because stuck funds are a common launch failure

Frequently Asked Questions

Why ERC-721A instead of standard ERC-721?
ERC-721A optimizes batch minting so users minting multiple tokens in one transaction pay far less gas than with standard ERC-721. For a `[total_supply]` collection with public minting, that saving is significant for your minters, which is why it is the default here.
How does the fair reveal work?
The `[reveal_strategy]` commits a provenance hash before minting, uses `[randomness_source]` such as Chainlink VRF for assignment, and a reveal function swaps `baseURI` from a placeholder to the real metadata. The pre-committed hash lets anyone verify the order was not manipulated afterward.
Will royalties actually be enforced on marketplaces?
It implements `[royalty_standard]` (ERC-2981) at `[royalty_percentage]` and adds operator filtering for `[marketplace_compliance]`. Honest enforcement depends on each marketplace honoring those signals, and that landscape has changed over time, so verify current behavior before relying on it.
Can I airdrop tokens to the team and winners?
Yes. The contract includes an `airdrop(addresses, quantities)` admin function for recipients like `[airdrop_recipients]`, and it emits events. Mind that airdropped tokens count against `[total_supply]`, so reserve them deliberately rather than minting past your cap.
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

AI assistant · trained on my work

👋

Hey there!

Quick Actions

WhatsApp Direct line to me

Chat on WhatsApp

+880 1723 741224 · Replies within the hour on working days

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

mejba.13@gmail.com

✓ 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