Skip to main content

Mint a bPeg

Collectors mint bPegs from collection pages inside app.mirage.garden.

Quick path

  1. Open the marketplace at app.mirage.garden.
  2. Pick a collection.
  3. Connect the wallet that should receive the NFT.
  4. Confirm that your wallet holds the required gate token balance.
  5. Review the mint fee shown by the app.
  6. Click Mint 1 NFT and confirm the transaction in your wallet.

The app reads the collection's token and tokenThreshold, then checks your balance against the gate token. If your balance is below the threshold, the mint button is disabled.

What the contract checks

For a direct mint through BpegRouter.mint(collection), the router:

  1. Reads the collection's linked ERC-20 token.
  2. Confirms the collection is registered in the factory.
  3. Reads the collection's token threshold.
  4. Checks balanceOf(msg.sender) on the gate token.
  5. Reads the correct mint fee from BpegFactory.feeFor(msg.sender).
  6. Mints the NFT through the factory if the wallet qualifies.

If the wallet does not hold enough of the gate token, the router reverts with BelowThreshold.

Mint fees

The app reads the applicable fee from the factory. Fees can vary by wallet because ClankerCats-related holdings can qualify for discounts.

See Fees and Discounts for the fee tiers and owner-adjustable caveat.

After mint

After a successful transaction:

  • The collection's totalSupply increases.
  • The new token receives a sequential token ID.
  • The token seed is generated on-chain.
  • The token appears in the collection grid.
  • The token detail page reads ownerOf(tokenId) and tokenURI(tokenId).

The NFT is a standard ERC-721. It can be transferred or approved like a normal NFT.