Skip to content

NFT Infrastructure - Current State

Quick Navigation

Status: Production on Tezos, Development on Arbitrum/EVM Last Updated: 2025-12-14


Executive Summary

EmProps has a production-ready NFT minting infrastructure with multi-chain support:

  • Tezos - Production, fully integrated (current live system)
  • Arbitrum - Active development (grant-funded, primary EVM target)
  • Ethereum/Base - Development/Testing

This document provides a comprehensive inventory of what exists today across the codebase, covering:

  1. What's in emerge-turbo (this monorepo)
  2. What's in external repos (emprops-hardhat, emprops-ponder, emprops-react-web3)
  3. The integration points between systems
  4. Gaps that need to be addressed

Table of Contents

  1. High-Level Architecture
  2. Current Implementation - emerge-turbo
  3. External Repositories (Not Yet Integrated)
  4. Blockchain Support Matrix
  5. Data Flow
  6. Key Integration Points
  7. What's Missing
  8. Technology Stack

High-Level Architecture

┌──────────────────────────────────────────────────────────────────────────────┐
│                           EmProps NFT Infrastructure                          │
├──────────────────────────────────────────────────────────────────────────────┤
│                                                                               │
│  ┌─────────────────────────────────────────────────────────────────────────┐ │
│  │                    emerge-turbo (This Monorepo)                          │ │
│  │                                                                          │ │
│  │  ┌─────────────────────┐    ┌──────────────────────────────────────┐   │ │
│  │  │   emprops-studio    │    │          External APIs               │   │ │
│  │  │   (Next.js)         │───▶│  - Tezos RPC (Taquito)               │   │ │
│  │  │                     │    │  - EVM RPC (Viem)                    │   │ │
│  │  │  NFT UI Components: │    │  - emprops-api (backend)             │   │ │
│  │  │  - ManageCollection │    └──────────────────────────────────────┘   │ │
│  │  │  - MintButton       │                                               │ │
│  │  │  - PublishModal     │    ┌──────────────────────────────────────┐   │ │
│  │  │  - BlockchainSelect │    │         Smart Contracts              │   │ │
│  │  │  - NFTPublishForm   │───▶│  (Deployed on-chain)                 │   │ │
│  │  │  - CollectionRecvrs │    │                                      │   │ │
│  │  └─────────────────────┘    │  Tezos:                              │   │ │
│  │                              │  - FA2 Collections                   │   │ │
│  │  ┌─────────────────────┐    │  - Member Gated Collections          │   │ │
│  │  │   Contract ABIs     │    │                                      │   │ │
│  │  │   (TypeScript)      │    │  Ethereum/Base:                      │   │ │
│  │  │                     │    │  - ERC721 Collections                │   │ │
│  │  │  - collections      │    │  - Member Collections                │   │ │
│  │  │  - member-colls     │    │  - Patron Pass                       │   │ │
│  │  │  - patron-pass      │    └──────────────────────────────────────┘   │ │
│  │  └─────────────────────┘                                               │ │
│  │                                                                          │ │
│  │  ┌─────────────────────┐    ┌──────────────────────────────────────┐   │ │
│  │  │   Wallet Context    │───▶│         Wallet Providers             │   │ │
│  │  │                     │    │  - Beacon SDK (Tezos)                │   │ │
│  │  │  - Tezos (Taquito)  │    │  - Dynamic Labs (EVM)                │   │ │
│  │  │  - EVM (Viem)       │    │  - RainbowKit (planned)              │   │ │
│  │  └─────────────────────┘    └──────────────────────────────────────┘   │ │
│  │                                                                          │ │
│  └─────────────────────────────────────────────────────────────────────────┘ │
│                                                                               │
│  ┌─────────────────────────────────────────────────────────────────────────┐ │
│  │              External Repos (Not Yet Integrated)                        │ │
│  │                                                                          │ │
│  │  ┌─────────────────┐  ┌─────────────────┐  ┌─────────────────┐         │ │
│  │  │ emprops-hardhat │  │ emprops-ponder  │  │emprops-react-web3│        │ │
│  │  │                 │  │                 │  │                  │        │ │
│  │  │ Smart Contracts │  │ Event Indexer   │  │ Reference SDK    │        │ │
│  │  │ (Solidity)      │  │ (Ponder)        │  │ (Demo/Patterns)  │        │ │
│  │  │                 │  │                 │  │                  │        │ │
│  │  │ - OwnerToken    │  │ - 8 DB tables   │  │ - Wagmi adapter  │        │ │
│  │  │ - NFTContractFactory    │  │ - WebSocket API │  │ - React hooks    │        │ │
│  │  │ - SimpleApp     │  │ - REST API      │  │ - Type defs      │        │ │
│  │  └─────────────────┘  └─────────────────┘  └─────────────────┘         │ │
│  │                                                                          │ │
│  │  Location: /Users/the_dusky/code/emprops/nft_investigation/             │ │
│  └─────────────────────────────────────────────────────────────────────────┘ │
│                                                                               │
└──────────────────────────────────────────────────────────────────────────────┘

Current Implementation - emerge-turbo

1. Smart Contract Interfaces (TypeScript ABIs)

Location: apps/emprops-studio/contracts/ethereum/

These are TypeScript-generated interfaces from deployed EVM smart contracts:

FileContract TypePurpose
collections-contract.ts/jsonERC721Main NFT collections with minting logic
member-collections-contract.ts/jsonERC721Member-gated NFT collections
member-collections-token-contract.ts/jsonERC721Token contract for member collections
patron-pass-collections-contract.ts/jsonERC721Patron pass NFT implementation
patron-pass-token-contract.ts/jsonERC721Patron pass token contract
utils.tsUtilityABI method detection helpers

Note: Generated using ethereum-abi-types-generator


2. Blockchain Client Layer

Location: apps/emprops-studio/clients/

contract-client.ts (~1,270 lines)

The main NFT infrastructure client providing:

Type Definitions:

typescript
type TezosCollectionKey = "projects" | "collections"
type Blockchain = "TEZOS" | "ETHEREUM" | "BASE"

interface CollectionMetadataRequest { ... }
interface CollectionMetadataResponse { ... }
interface CreateTezosCollectionParams { ... }
interface CollectionData { ... }
interface CollectionContractConfig {
  price: number;
  editions: number;
  status: "ON" | "OFF";
}

Key Functions:

FunctionPurpose
getTezCollection()Fetch Tezos collection data from on-chain
getEthCollection()Fetch Ethereum/Base collection data
createTezosCollection()Deploy new NFT collection on Tezos
handleContractsMintBatchs()Batch minting operations
getRedeemableTezFunds()Get available royalty funds (Tezos)
getRedeemableEthFunds()Get available royalty funds (EVM)
updateTezCollectionStatus()Toggle minting on/off
updateTezCollectionPrice()Update mint price
updateTezCollectionEditions()Update max supply

tezos-client.ts (42 lines)

Tezos-specific functionality:

  • Domain resolution via @tezos-domains/taquito-client
  • Tzip16 metadata support
  • Domain name lookup

emprops-api-client.ts

REST API client for EmProps backend:

  • Projects, contracts, sales, tokens, profiles, events
  • SWR-based data fetching

3. React Hooks

Location: apps/emprops-studio/hooks/

Collection Hooks (collections.ts)

HookPurpose
usePublishedCollections()Paginated collection listing
usePublishedCollection()Single collection lookup
useCountPublishedCollections()Count collections by owner
useCollections() / useCollection()Collection CRUD operations
useCurrentCollection()Current collection in context
useCollectionPreview()Preview data for collection
useCreateCollection()Create new collection
useUpdateCollection()Update collection metadata
useMoveCollection()Reorganize collections
useUpdateCollectionVisibility()Publish/unpublish

Contract Hooks (contract-client.ts)

HookPurpose
useCollectionContract()Get contract instance for writing
useCollectionQuerierContract()Get contract instance for reading
useCollectionInfo()Collection metadata
useCollectionConfig()Collection configuration (price, editions, status)
useMintToken()Token minting mutations
usePublishCollection()Collection publication to blockchain
useGetCollectionTokensMinted()User's token inventory

Other Hooks

HookPurpose
useCollectionRewards()Reward distribution tracking
useCollectionOutputs()Collection-specific output management

4. UI Components

Location: apps/emprops-studio/components/

Mint Button Components

ComponentPurpose
MintButton/index.tsxRouter - selects blockchain-specific button
MintButton/TezosMintButton.tsxTezos minting UI
MintButton/USDTezosMintButton.tsxUSD price display for Tezos
MintButton/USDEthereumMintButton.tsxUSD price display for Ethereum
MintButton/MintButtonLabel.tsxCommon label rendering
MintButton/BatchMintCounter.tsxBatch minting quantity selector
Blockchain/Ethereum/v1/MintButton.tsxEthereum/EVM minting
Blockchain/Base/v1/MintButton.tsxBase chain minting
Blockchain/Base/v1/Redeem.tsxFund redemption for Base

Collection Management

ComponentPurpose
ManageCollection/Collection management dashboard
ManageCollectionPreview/Quick preview
PublishCollectionModal/Publication workflow
CollectionSettings/Collection configuration UI
CollectionDetails/Collection metadata display
CollectionDetailsForm/Form for updating collection details
CollectionDetailsForm/CollectionReceiversForm.tsxRevenue split configuration
CollectionDetailsForm/CollectionReceiversList.tsxDisplay receivers
CollectionHistory/Historical events tracking
CollectionItems/NFT grid display
GridItemCollection/Gallery item renderer
UpdateCollectionDetails/Inline editing
CollectionCorruptedModal/Error recovery
NFTPublishingForm/NEW - Comprehensive NFT publishing form

Blockchain UI

ComponentPurpose
BlockchainSelector/UI for choosing blockchain (Tezos/Ethereum/Base)

Studio V2 Collection View

ComponentPurpose
studio/v2/CollectionView/index.tsxMain collection view
studio/v2/CollectionView/CollectionOutputGrid.tsxNFT output grid
studio/v2/CollectionView/CollectionOutputGroup.tsxOutput grouping
studio/v2/CollectionView/CollectionOutputCard.tsxIndividual NFT card
studio/v2/CollectionView/CollectionStats.tsxCollection statistics

5. Wallet & Context

Location: apps/emprops-studio/context/ and apps/emprops-studio/types/

clients-context.tsx

React Context for wallet clients:

  • Dynamic import of TezosWallet (SSR-safe)
  • ClientsProvider wrapper component
  • useClients() hook for wallet access

wallet.ts

Type definitions for blockchain integration:

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

enum ChainId {
  // Mainnet
  TezosMainnet = "NetXdQprcVkpaWU",
  EthereumMainnet = "1",
  BaseMainnet = "8453",

  // Testnet
  TezosGhostnet = "NetXnHfVqm9iesp",
  EthereumSepolia = "11155111",
  BaseSepolia = "84532"
}

interface Wallet {
  connect(): Promise<void>;
  disconnect(): Promise<void>;
  authenticate(): Promise<string>;
  // ...
}

6. State Management

Location: apps/emprops-studio/atoms/

mint.ts

typescript
import { atom } from 'jotai';
export const recentlyMintedAtom = atom(false);

utils/mintStatus.ts (~150 lines)

Mint state determination logic:

  • getTezMintStatus() - Can user mint? (allowlist, freelist, public)
  • getTezProjectsMintStatus() - Project-level restrictions
  • getTezCollectionsMintStatus() - Collection-level restrictions
  • Checks: mint mode, allowance, freelist limits, sold-out status

7. API Endpoints

Location: apps/emprops-studio/pages/api/

EndpointPurpose
/api/contracts/[network]/[contractAddress]/mints/Mint operations
/api/contracts/[network]/[contractAddress]/mints/signings/Signing operations
/api/blockchains/tezos/[network]/contracts/[contractAddress]/mints/Tezos-specific mints
/api/blockchains/tezos/[network]/contracts/[contractAddress]/mints/signings/Tezos signing

8. Mint Modes & Access Control

Implemented on both Tezos and Ethereum:

ModeDescription
PUBLICAnyone can mint
ALLOW_LIST / ALLOWLISTWhitelisted addresses with per-address limits
FREE_LIST / FREELISTFree minting list with per-address redemption limits
ON / OFFContract state for enabling/disabling minting

9. Dependencies

Tezos Stack

json
{
  "@taquito/taquito": "16.0.1",
  "@taquito/beacon-wallet": "16.2.0",
  "@taquito/tzip16": "16.1.2",
  "@tezos-domains/taquito-client": "1.24.0",
  "@airgap/beacon-sdk": "4.6.2"
}

EVM Stack

json
{
  "viem": "2.28.4",
  "ethereum-abi-types-generator": "1.3.4"
}

Wallet Integration

json
{
  "@dynamic-labs/sdk-react-core": "4.25.7",
  "@dynamic-labs/ethereum": "4.39.0"
}

External Repositories (Not Yet Integrated)

These repos exist at /Users/the_dusky/code/emprops/nft_investigation/ and are documented for future integration.

1. emprops-hardhat (Smart Contracts)

Status: ✅ Complete, needs migration

Location: /Users/the_dusky/code/emprops/nft_investigation/emprops-hardhat

Contracts:

ContractPurposePattern
OwnerTokenContract.solMaster NFT for collection ownershipERC721A + UUPS
NFTContractFactoryContract.solCREATE2 factory for NFT collectionsUUPS Upgradeable
SimpleAppContract.solIndividual ERC721A NFT collectionMinimal Proxy
SimpleAppInitializerContract.solCollection configurationOne-time init

Features:

  • Gas-optimized (ERC721A, minimal proxies, CREATE2)
  • Upgradeable (UUPS pattern)
  • Database integration for deployment tracking
  • Cross-chain compatible (deterministic addresses)

See: emprops-hardhat-documentation.md


2. emprops-ponder (Blockchain Indexer)

Status: ✅ Complete, needs migration

Location: /Users/the_dusky/code/emprops/nft_investigation/emprops-ponder

Database Schema (8 tables):

TablePurpose
owner_tokensOwner NFTs (collection ownership)
owner_token_transfersTransfer history
appsNFT collections
app_tokensIndividual NFTs
app_token_mintsBatch minting events
app_token_transfersNFT transfer history
contract_upgradesContract upgrade events

Features:

  • Real-time event indexing via Ponder framework
  • HTTP API (Hono) + WebSocket server (Socket.io)
  • Dynamic configuration from database
  • Sub-second latency

See: emprops-ponder-documentation.md


3. emprops-react-web3 (Reference SDK)

Status: ℹ️ Reference only, do not migrate

Location: /Users/the_dusky/code/emprops/nft_investigation/emprops-react-web3

Valuable Patterns:

  • Adapter pattern (WagmiAdapter vs PonderAdapter)
  • React Query + WebSocket integration
  • Transaction hooks with pre-validation
  • Zod environment validation
  • Type definitions

See: emprops-react-web3-documentation.md


Blockchain Support Matrix

FeatureTezosEthereumBase
Collection Creation✅ Production⚠️ Dev⚠️ Dev
Minting✅ Production⚠️ Dev⚠️ Dev
Batch Minting
Allowlist
Freelist
Fund Redemption
Price Management
Status Toggle
Wallet Integration✅ Beacon✅ Dynamic✅ Dynamic
Contract ABIsN/A (FA2)
Event Indexing⚠️ ponder⚠️ ponder

Legend:

  • ✅ Production ready
  • ⚠️ Development/Testing
  • ❌ Not implemented

Data Flow

Current Flow (Tezos - Production)

1. User clicks "Publish to Blockchain" in emprops-studio

   ├─▶ PublishCollectionModal opens

   ├─▶ User selects blockchain (TEZOS), configures price/editions

   ├─▶ ManageCollection calls contract-client.ts

   ├─▶ createTezosCollection() deploys FA2 contract via Taquito

   ├─▶ Beacon wallet prompts for signature

   ├─▶ Transaction submitted to Tezos network

   ├─▶ Collection contract deployed

   └─▶ Collection data stored in database + contract address saved

Planned Flow (EVM with Ponder Integration)

1. User clicks "Publish to Blockchain" in emprops-studio

   ├─▶ NFTPublishingForm collects settings

   ├─▶ Viem submits transaction to NFTContractFactory

   ├─▶ SimpleApp deployed via CREATE2

   ├─▶ Events emitted on blockchain

   ├─▶ emprops-ponder indexes events
   │    └─▶ Stores in PostgreSQL
   │    └─▶ Emits WebSocket event

   └─▶ UI updates in real-time

Key Integration Points

1. emprops-studio → Smart Contracts

Current:

  • Direct blockchain interaction via Taquito (Tezos) and Viem (EVM)
  • Contract ABIs stored in contracts/ethereum/

Needed:

  • Integration with emprops-hardhat contracts
  • Deployment flow using NFTContractFactory

2. emprops-studio → emprops-api

Current:

  • REST API for collection CRUD
  • Database storage for collection metadata

Needed:

  • API endpoints for EVM contract interactions
  • Metadata pinning (IPFS)

3. emprops-ponder → emprops-studio

Current:

  • Not integrated

Needed:

  • Real-time collection/mint data
  • WebSocket subscriptions for UI updates
  • Historical data queries

4. Smart Contracts → Database

Current:

  • Tezos contract addresses stored in database
  • EVM contracts not tracked

Needed:

  • Contract deployment tracking
  • Cross-chain address mapping

What's Missing

Critical Gaps

GapCurrent StateNeeded
Event IndexingNo blockchain event indexingIntegrate emprops-ponder
EVM Contract ManagementBasic UI, no deploymentFull NFTContractFactory integration
Real-time UpdatesPollingWebSocket from ponder
Cross-chain HistoryPer-chain queriesUnified indexer API

Nice-to-Have

FeatureStatus
Secondary market support❌ Not planned
Royalty distribution automation⚠️ Manual
Multi-chain deployment⚠️ Per-chain
Gas estimation⚠️ Basic

Technology Stack

Current (emerge-turbo)

LayerTechnology
FrontendNext.js, React, Tailwind
StateJotai, SWR
TezosTaquito, Beacon SDK
EVMViem, Dynamic Labs
DatabasePostgreSQL, Prisma
APINext.js API Routes

External (Not Integrated)

LayerTechnology
Smart ContractsSolidity, Hardhat, OpenZeppelin
IndexingPonder, PostgreSQL
Real-timeSocket.io
Reference SDKWagmi, RainbowKit

Next Steps

  1. Validate external repos - Ensure emprops-hardhat and emprops-ponder compile and work
  2. Plan integration - Follow ADR-019 for migration strategy
  3. Migrate contracts - Move to packages/nft-contracts
  4. Deploy indexer - Set up apps/nft-indexer
  5. Connect UI - Wire emprops-studio to indexer API

Current Development Focus

Technical Reference

Planning & Architecture

Released under the MIT License.