How to Build an NFT Marketplace on Flow
An NFT marketplace on Flow is built in Cadence with the NonFungibleToken standard and the Flow CLI. This guide covers the stack, the steps and the mistakes to avoid.
On this page
Short answer
An NFT marketplace on Flow is a web app where people list, buy and sell NFTs that live on the Flow blockchain. You build it with Cadence smart contracts for the tokens and listings, the Flow CLI for local work, and the Flow Client Library to connect wallets and send transactions from the browser.
What is an NFT marketplace on Flow?
An NFT marketplace on Flow is a web application where creators list digital items and buyers purchase them, with ownership recorded on the Flow blockchain. Flow is a layer-1 network built by Dapper Labs for consumer apps such as NBA Top Shot, and it uses Cadence, a resource-oriented smart contract language.
In Cadence, an NFT is a resource: a typed object stored in the owner's account that exists in one place only. That differs from Ethereum, where a token is an entry in an ownership table inside a contract. The resource model makes it impossible to copy or double-spend a token by accident, because a resource cannot be duplicated.
Use this comparison to pick your build path. Both paths run on Flow, and Cadence code can call into Flow EVM.
| Build path | Language | Ownership model | Tools |
|---|---|---|---|
| Cadence NFT | Cadence | Resource in the user's account | Flow CLI, emulator, Flow Client Library |
| Flow EVM NFT | Solidity | Mapping in the contract | Hardhat, Foundry, MetaMask |
| Hybrid | Both | Bridge between the two | Cadence plus EVM tooling |
Most new Flow marketplaces use the Cadence path, because native Flow wallets and marketplaces expect Cadence NFTs. The EVM path suits teams that already have Solidity contracts and want to reuse them.
Chain-specific guides exist for other networks too. See how to create an NFT marketplace on Polygon for the Polygon approach.
The Near approach is similar in shape but different in language. See how to build an NFT marketplace on Near for that version.
Which pieces does a Flow marketplace need?
A Flow marketplace has five pieces: an NFT contract, a listing or sale contract, a web front end, a wallet connection, and an indexer that reads on-chain events. Each piece has a standard way to build it on Flow.
The NFT contract should implement the NonFungibleToken standard. That contract interface defines the NFT resource, the Collection resource, and the deposit and withdraw functions, plus standard events such as Deposited and Withdrawn that indexers use to track tokens. The standard contract lives at mainnet address 0x1d7e57aa55817448.
Metadata matters as much as the token. The MetadataViews contract defines standard views that wallets and marketplaces read: display name, thumbnail, royalties, editions, traits, external URL and collection display. An NFT shows correctly across Flow apps only when its contract implements the common views.
The front end connects through the Flow Client Library (FCL), which handles wallet sign-in and transaction signing. Listings usually live in a sale contract that holds the NFT in escrow until a buyer pays, so a sale cannot complete without the token moving.
How do you set up the project?
Set up the project with the Flow CLI before writing any contract code. The CLI gives you a local emulator, a testnet connection and the commands to deploy contracts and run transactions.
- Install the Flow CLI. With Homebrew, run brew install flow-cli; otherwise follow the Flow CLI installation guide.
- Run flow init in an empty folder. It creates a cadence folder with contracts, scripts, transactions and tests subfolders, plus a flow.json configuration file.
- Generate the NFT contract with flow generate contract, then add the NFT resource, a Collection resource and an NFTMinter resource that controls who can mint.
- Import the NonFungibleToken standard and make your contract conform to it, so the token works with wallets and other marketplaces.
- Write a sale contract that lists an NFT at a price, holds it in escrow, and releases it when payment arrives.
- Connect the front end with FCL, add a wallet sign-in button, and wire the list, buy and cancel actions to transactions.
Keep the contract code small at first. A marketplace that mints, lists and sells one collection is enough to prove the flow end to end before you add auctions, offers or royalties.
How do you test before mainnet?
Test a Flow marketplace in three stages: the local emulator, Flow testnet, then mainnet. Each stage catches a different class of problem, and skipping one usually costs more time than it saves.
Start on the emulator. It runs a local Flow network on your machine, so you can deploy contracts, mint test NFTs and run buy and sell transactions with no fees and instant blocks. Write Cadence tests in the tests folder and run them after every contract change.
Move to testnet next. Testnet behaves like mainnet but uses test FLOW, so you can check wallet sign-in with real wallets, FCL transaction signing, and how the front end handles pending and failed transactions. Testnet is also where you check that your metadata views render correctly in Flow wallets.
Before mainnet, audit the sale contract. The risky parts are the escrow logic, the royalty split and the access control on minting. If the minter resource is not restricted, anyone can mint new tokens and inflate the supply. If the sale contract releases payment before the token moves, a buyer can pay and receive nothing.
What does the sale flow look like in practice?
The sale flow has four steps, and each one is a transaction the user signs. The seller lists the NFT, the buyer pays, the sale contract moves the token, and the payment is split between seller, creator royalty and marketplace fee.
Listing starts with the seller depositing the NFT into the sale contract and setting a price in FLOW. The listing is visible to anyone who reads the contract, and the seller can cancel it at any time to withdraw the token. The NFT stays in escrow while listed, so the seller cannot sell the same token twice.
Buying is a single transaction: the buyer sends FLOW, the contract checks the amount, moves the NFT into the buyer's collection, and splits the payment. Royalties go to the creator's address, the fee goes to the marketplace, and the rest goes to the seller. If any step fails, the whole transaction rolls back.
Fees on Flow are charged in compute units priced in FLOW. The Flow fee table lists example costs for common operations, and each FLOW held gives 100 MB of account storage, with every account required to keep at least 0.001 FLOW. Check the current fee table before you promise users a cost.
Example (hypothetical): a first week of sales
Example (hypothetical): a creator launches a collection of 40 art NFTs on a new Flow marketplace, each listed at 25 FLOW. In the first week, 12 of the 40 sell.
The gross sales are 12 times 25 FLOW, which is 300 FLOW. The marketplace takes a 2.5 percent fee, which is 7.5 FLOW. The creator keeps 292.5 FLOW after the fee, before any royalty split to collaborators.
The numbers also show what the team should watch. With 28 of 40 NFTs unsold, the listing page needs better discovery, not more minting. And with 12 sales in a week, the team can check whether buyers came from the marketplace itself or from links the creator shared elsewhere.
Run the same arithmetic on your own launch before you set the fee. A fee that looks small on one sale can eat a creator's margin across a whole collection, and a fee that looks generous can leave the marketplace with nothing to pay for hosting and support.
What are the common mistakes?
Most Flow marketplace failures come from contract details, not from the idea. The same mistakes appear in project after project, and all of them are avoidable with a checklist.
- Copying pre-Cadence 1.0 code that no longer compiles, then debugging syntax instead of building features.
- Leaving minting open to anyone, so the supply can be inflated after launch.
- Skipping MetadataViews, so NFTs show up blank in wallets and other marketplaces.
- Releasing payment before the token moves, which lets a sale complete without the buyer receiving anything.
- Testing only on the emulator and finding wallet and signing problems for the first time on mainnet.
- Storing images only on a single server instead of content-addressed storage, so the art disappears when the server does.
- Promising a fixed fee in FLOW without checking the current fee table, then finding the real cost is higher.
Build the small version first: one collection, one sale type, one wallet. Ship that, watch real users, and add auctions, offers and cross-chain support only after the basic flow works. If you are planning a marketplace and want help with the contracts and the front end, how to develop an NFT marketplace covers the general build in more depth.
Key takeaways
- An NFT marketplace on Flow uses Cadence contracts, the NonFungibleToken standard and the Flow Client Library.
- Native Cadence NFTs are resources stored in the owner's account, not entries in a contract table.
- Implement MetadataViews so your NFTs display correctly in wallets and other marketplaces.
- Test on the emulator, then testnet, then mainnet, and audit the sale contract before launch.
- Only use Cadence 1.0 code; tutorials written before the Crescendo upgrade no longer compile.
Frequently asked questions
Do I need Cadence to build on Flow, or can I use Solidity?
No, you do not need Cadence if you use Flow EVM, where you can deploy Solidity contracts with Hardhat or Foundry. But native Flow wallets and marketplaces expect Cadence NFTs, so the Cadence path fits a marketplace built for Flow users.
What is the Flow Client Library?
The Flow Client Library, or FCL, is the JavaScript library that connects a web app to Flow wallets. It handles sign-in, account access and transaction signing, so the front end can send mint, list and buy transactions without managing keys itself.
How much does it cost to mint an NFT on Flow?
Fees on Flow are charged in compute units priced in FLOW, and the fee table lists example costs for common operations. Check the current fee table on the Flow docs before launch, because fees change and the table is the only reliable source.
Can Flow NFTs work with Ethereum marketplaces?
Not directly. Flow also runs an EVM environment next to Cadence, and a bridge exists between Cadence NFTs and EVM NFTs, but the bridge adds another system to build, test and support. Most teams pick one side and build there.
What is NBA Top Shot built on?
NBA Top Shot is built on Flow. It is the best-known consumer app on the network and the reason many teams choose Flow for collectibles aimed at mainstream users rather than crypto-native traders.
Do I need an audit before launching on mainnet?
Yes, for anything that holds user funds or NFTs. At minimum, have a second developer review the sale contract, the minting access control and the royalty split. A full audit is the safer choice before real money moves.