Skip to content

Studio NFT Code Inventory

Complete inventory of all NFT-related code in apps/emprops-studio/. This codebase was originally built as a full NFT platform — AI generation fed into NFT minting. The studio still contains extensive NFT UI, contract interaction code, and marketplace components that can be reconnected to the new Diamond/Arbitrum backend.

Summary

CategoryFilesTotal LOC (est.)
Pages10+~2,000
Components35+~4,000
Clients7~2,500
Hooks10+~2,000
Contracts/ABIs11~1,500
State (Atoms)3~200
Types1~100
Utils3~300
Total~80 files~12,600

Pages

PagePathWhat It Does
Marketplacepages/marketplace/index.tsxBrowse published collections with filters (artist, blockchain, status, type, price). Uses EmPropsApi platform client. ~835 LOC
Marketplace Appspages/marketplace/apps/index.tsxApp listing view within marketplace
Collection Detailpages/marketplace/apps/[id]/index.tsxSingle collection view with token grid
Token Detailpages/tokens/emprops/[id]/[tokenId].tsxIndividual token view with metadata, image, traits
Token Collectionpages/tokens/emprops/[id].tsxToken list view for a collection
Collection Pagepages/collection/[id].tsxCollection management page (creator view)
Profile Collectionpages/profile/[address]/collection/User's owned/created collections
Profile Salespages/profile/[address]/sales/User's sales history
Profile Creationspages/profile/[address]/creations/User's created artworks
Redeempages/studio/redeem.tsxRedeem funds from collection sales

API Routes (Next.js)

RouteWhat It Does
pages/api/allowlist/proof/[address].tsGenerate Merkle proof for allowlist verification
pages/api/allowlist/validate/[address].tsValidate address is on allowlist
pages/api/blockchains/tezos/[network]/contracts/[contractAddress]/mints/signings/Tezos mint transaction signing
pages/api/contracts/[network]/[contractAddress]/mints/signings/EVM mint transaction signing
pages/api/checkout/Checkout flow
pages/api/checkout/stripe/Stripe payment integration for fiat purchases

Components

Minting Components

ComponentPathBlockchain Support
MintButton (router)components/MintButton/index.tsxDispatches to chain-specific mint button
TezosMintButtoncomponents/MintButton/TezosMintButton.tsxTEZOS — Beacon wallet minting
USDEthereumMintButtoncomponents/MintButton/USDEthereumMintButton.tsxETHEREUM — USD-denominated ETH minting
USDTezosMintButtoncomponents/MintButton/USDTezosMintButton.tsxTEZOS — USD-denominated minting
BatchMintCountercomponents/MintButton/BatchMintCounter.tsxALL — Quantity selector for batch mints
MintButtonLabelcomponents/MintButton/MintButtonLabel.tsxALL — Mint button text/styling
Base MintButtoncomponents/Blockchain/Base/v1/MintButtonBASE — Base chain mint button
Ethereum MintButtoncomponents/Blockchain/Ethereum/v1/MintButtonETHEREUM — Ethereum mint button

Arbitrum Impact

A new ArbitrumMint component is needed. For Phase 1 (custodial), it calls the API /nft/collections/:id/mint endpoint — no user wallet required. Later phases can add user-signed minting via wagmi.

Collection Management Components

ComponentPathDescription
PublishCollectionModalcomponents/PublishCollectionModal/index.tsx (~267 LOC)Publish collection to blockchain. Handles wallet connection, receivers, credits, metadata upload. Supports TEZOS, ETHEREUM, BASE.
CollectionSettingscomponents/CollectionSettings/Manage published collection (status, price, editions)
CollectionSettingsLoadercomponents/CollectionSettingsLoader/Loading state for settings
CollectionDetailscomponents/CollectionDetails/Display collection info (read-only)
CollectionDetailsFormcomponents/CollectionDetailsForm/Edit collection details
CollectionHistorycomponents/CollectionHistory/Collection event history log
CollectionItemscomponents/CollectionItems/Token grid for a collection
CollectionItems/BlockchainIconcomponents/CollectionItems/BlockchainIconChain icon display (Tezos, Eth, Base)
CollectionCorruptedModalcomponents/CollectionCorruptedModal/Error state for corrupted collection data
ManageCollectioncomponents/ManageCollection/Collection management actions
ManageCollectionPreviewcomponents/ManageCollectionPreview/Preview of managed collection
MoveCollectionDialogcomponents/MoveCollectionDialog/Move collection between projects
UpdateCollectionDetailscomponents/UpdateCollectionDetails/Update collection metadata
BlockchainSelectorcomponents/BlockchainSelector/Chain selection dropdown

Arbitrum Impact

PublishCollectionModal needs an Arbitrum deployment flow — call /nft/collections/:id/deploy instead of direct contract interaction. BlockchainSelector needs ARBITRUM added.

Marketplace Components

ComponentPathDescription
MarketActionscomponents/MarketActions/index.tsx (~100 LOC)Buy/Sell/List tokens — TEZOS ONLY (line 60 blockchain check)
BuyTokencomponents/MarketActions/BuyToken.tsxBuy a listed token
ListForSalecomponents/MarketActions/ListForSale.tsxList token for sale
UnlistForSalecomponents/MarketActions/UnlistForSale.tsxCancel listing
MarketplaceToastcomponents/MarketplaceToast/Transaction notification toasts

Arbitrum Impact

MarketActions is currently Tezos-only. For Arbitrum Phase 1: replace with "View on OpenSea" link. Phase 3+: add native marketplace facet support.

Publishing & NFT Flow

ComponentPathDescription
NFTPublishingFormcomponents/NFTPublishingForm/NFT publishing form
PublishAlertscomponents/PublishAlerts/Publishing validation alerts
PublishLongFormcomponents/PublishLongForm/Long-form publishing flow
VerificationModalcomponents/VerificationModal/Collection verification
StorefrontHeadercomponents/StorefrontHeader/Storefront page header
Storefrontscomponents/Storefronts/Storefront listing

Wallet Components

ComponentPathDescription
ConnectWalletcomponents/ConnectWallet/Wallet connection UI
Walletcomponents/Wallet/Tezos wallet component (Beacon)
WalletEthcomponents/WalletEth/EVM wallet component (wagmi)
WalletAlertscomponents/WalletAlerts/Wallet status alerts
WalletsTablecomponents/WalletsTable/Manage multiple wallets
AddWalletFormcomponents/AddWalletForm/Add new wallet
NetworkSwitchcomponents/NetworkSwitch/Switch network prompt (EVM)

Financial Components

ComponentPathDescription
Redeemcomponents/Redeem/Redeem collection funds
RedeemLoadercomponents/RedeemLoader/Redeem loading state
ClaimRewardsFormcomponents/ClaimRewardsForm/Claim rewards
Royaltiescomponents/Royalties/Royalty configuration
SalesConfigFormcomponents/SalesConfigForm/Sales configuration
PriceDisplaycomponents/PriceDisplay/Price with blockchain icon

Token Display Components

ComponentPathDescription
TokenInfocomponents/TokenInfo/Token detail display
TokenTypeLinkcomponents/TokenTypeLink/Link to token type
GridItemTokencomponents/GridItemToken/Token in grid view
GridItemCollectioncomponents/GridItemCollection/Collection in grid view
RandomTokenViewercomponents/RandomTokenViewer/Random token preview

Clients

contract-client.ts (Core NFT Engine)

Path: clients/contract-client.ts1,275 LOC

This is the most important file for understanding NFT contract interactions. It handles:

  • Tezos: Collection creation, minting, redeeming, status updates, price updates, edition management via Taquito
  • Ethereum/Base (EVM): Contract interactions via ethers.js/wagmi
  • Contract Registry: allowedContracts mapping for TEZOS, ETHEREUM, BASE with addresses and ABIs
  • Multi-chain dispatch: Routes operations to the correct chain handler

Critical for Arbitrum

This file needs Diamond contract interaction functions added for Arbitrum — getArbitrumCollection(), getArbitrumTokenMetadata(). Write operations should go through the API (custodial), not direct contract calls.

Other Clients

ClientPathDescription
tezos-client.tsclients/tezos-client.tsTezos-specific client (Beacon wallet SDK)
indexer-client.tsclients/indexer-client.tsTzKT indexer client for Tezos blockchain data
wallet.tsclients/wallet.tsWallet abstraction layer
emprops-api-client.tsclients/emprops-api-client.tsPlatform API client (originally called Java backend)
open-api-client/clients/open-api-client/Open API client (metadata, collections)
stripe-client.tsclients/stripe-client.tsStripe payments for fiat purchases

Hooks

contract-client.ts (EVM Contract Hooks)

Path: hooks/contract-client.ts402 LOC

Uses @stakeordie/emprops-clients ContractFactoryFacade to provide:

  • useCollectionContract — Get contract instance for a collection
  • usePublishCollection — Publish collection to blockchain
  • useMintToken — Mint tokens
  • useUpdateStatus / useUpdatePrice / useUpdateEditions — Update collection settings
  • useWithdrawFunds — Withdraw collected funds
  • useRedeemAmount — Calculate redeemable amount

collections.ts (Collection CRUD)

Path: hooks/collections.ts517 LOC

  • Collection listing with infinite scroll
  • Collection CRUD operations
  • Receiver management (revenue split recipients)
  • Preview generation
  • Feed/discovery queries

useMarketContract.ts (Tezos Marketplace)

Path: hooks/useMarketContract.ts210 LOC

Tezos-only marketplace operations:

  • listNFTForSale(price) — List token on marketplace
  • unlistNFTForSale() — Remove listing
  • buyNFT() — Purchase listed token

Other Hooks

HookPathDescription
useIndexerClienthooks/useIndexerClient.tsTzKT indexer access
publish-utilshooks/publish-utils.tsPublishing validation helpers
publish-verifierhooks/publish-verifier.tsPublish verification
walletshooks/wallets.tsWallet management
rewardshooks/rewards.tsCollection rewards
useWertConverterhooks/useWertConverter.tsFiat-to-crypto conversion (Wert widget)

Contracts (Ethereum ABIs & TypeScript Wrappers)

Path: contracts/ethereum/

These are TypeScript wrappers around contract ABIs, used by the contract-client and hooks.

FileDescription
collections-contract.tsCollections contract ABI wrapper
collections-contract.jsonCollections contract ABI
member-collections-contract.tsMember collections ABI wrapper
member-collections-contract.jsonMember collections ABI
member-collections-token-contract.tsMember token ABI wrapper — exports contractConfig with address + ABI for wagmi
member-collections-token-contract.jsonMember token ABI
patron-pass-collections-contract.tsPatron pass collections ABI wrapper
patron-pass-collections-contract.jsonPatron pass collections ABI
patron-pass-token-contract.tsPatron pass token ABI wrapper
patron-pass-token-contract.jsonPatron pass token ABI
utils.tsABI utility functions

Arbitrum Impact

New Diamond ABI files will be needed: diamond-factory.ts, diamond-collection.ts with the Diamond facet interfaces (ERC721A, Mint, Metadata, Royalty).


State Management (Jotai Atoms)

AtomPathDescription
mintatoms/mint.tsMint state tracking (current mint progress, tx status)
tokenMarketatoms/tokenMarket.tsMarket state (listing changes, price updates)
addressatoms/address.tsConnected wallet address state

Types

wallet.ts

Path: types/wallet.ts

typescript
type Blockchain = "TEZOS" | "ETHEREUM" | "BASE"

Key types:

  • Blockchain — Chain identifier enum (needs "ARBITRUM" added)
  • ChainId — Numeric chain IDs
  • WalletState — Current wallet connection state
  • Wallet — Wallet interface (address, chain, provider)

Utils

FilePathDescription
allowlist.tsutils/allowlist.tsMerkle tree allowlist utilities for gated mints
wallet.tsutils/wallet.tsWallet helper functions
transactionDetails.tsutils/transactionDetails.tsTransaction formatting and display

External Package: @stakeordie/emprops-clients

Used by hooks/contract-client.ts. This is an npm package (not in the monorepo) that provides:

  • ContractFactoryFacade — Creates chain-specific contract instances
  • BlockchainType, VersionType — Chain/version enums
  • CollectionStatus — Contract state enums (active, paused, etc.)
  • MintModeEthereumV1 — Mint mode configuration
  • CreateCollectionParamsBaseV1, CreateCollectionParamsEthereumV1 — Collection creation parameter types

Dependency Note

This package was built for the ERC721A/ERC1167 architecture. For Diamond contracts, we'll either update this package or create Diamond-specific hooks directly in the studio.


What Needs to Change for Arbitrum

Files to Modify

FileChange
types/wallet.tsAdd "ARBITRUM" to Blockchain type + Arbitrum chain IDs
clients/contract-client.tsAdd Diamond contract read functions for Arbitrum
hooks/contract-client.tsAdd Arbitrum chain + Diamond hooks
hooks/collections.tsSupport Arbitrum in collection publish flow
components/MintButton/Add ArbitrumMint.tsx component
components/PublishCollectionModal/Add Diamond deployment flow
components/MarketActions/Add Arbitrum support (OpenSea links initially)
components/CollectionSettings/Add Arbitrum collection management
components/BlockchainSelector/Add Arbitrum option
pages/tokens/emprops/[id]/[tokenId].tsxRender Arbitrum token metadata

Files to Create

FilePurpose
components/MintButton/ArbitrumMint.tsxCustodial mint button (calls API)
hooks/diamond.tsDiamond-specific hooks (loupe, facets, read)
lib/arbitrum.tsArbitrum chain config + utilities
contracts/ethereum/diamond-factory.jsonDiamond Factory ABI
contracts/ethereum/diamond-collection.jsonDiamond Collection ABI (all facets)

Released under the MIT License.