A Soroban smart contract + React frontend for minting NFTs on the Stellar testnet.
- Rust 1.74+ (
rustup target add wasm32v1-none) - Node.js 18+
- Stellar CLI (
cargo install stellar-cli) - Freighter browser extension
- Visual Studio 2022 Build Tools (Windows) with VC++ workload + Windows SDK
- Or:
brew install gcc(macOS) /apt install build-essential(Linux)
- Or:
stellar-nft-minter/
├── nft-contract/ # Soroban smart contract
│ ├── contracts/
│ │ └── nft-minter/ # NFT minter contract source
│ │ ├── src/lib.rs # Contract logic
│ │ └── src/test.rs# Tests
│ └── build.bat # Windows build script
├── frontend/ # React + Vite + TypeScript
│ ├── src/
│ │ ├── App.tsx # Main UI
│ │ ├── contract.ts # Contract client
│ │ └── types.ts # TypeScript types
│ └── .env.example # Environment config
└── deploy.ps1 # Deployment automation
The NFT Minter contract is deployed on Stellar Testnet.
| Detail | Value |
|---|---|
| Contract ID | CC7WQJXRNQBMCIFO3V6ZDWRVBM23RB4FK5QWH7UPBEETFH23TL7MPRZC |
| Network | Stellar Testnet (https://horizon-testnet.stellar.org) |
| Admin Address | GCIRI6IR6PPQSO7PJN2DS5C3RU55ZGWCTYV24GN3STOTKAR5UMHMQH3Y |
| Collection Name | StellarNFT |
| Collection Symbol | SNFT |
| Explorer | View on Stellar Expert |
cd nft-contract
# Windows (requires VS Build Tools + Windows SDK):
build.bat
# Or:
stellar contract buildcd nft-contract
cargo test# The deploy script creates an account, deploys, and initializes:
.\deploy.ps1Or manually:
# Create and fund a testnet account
stellar keys generate nft-admin
stellar keys fund nft-admin --network testnet
# Deploy
stellar contract deploy \
--wasm target/wasm32v1-none/release/nft_minter.wasm \
--source nft-admin \
--network testnet
# Initialize
stellar contract invoke \
--id <CONTRACT_ID> \
--source nft-admin \
--network testnet \
-- \
initialize \
--admin <ADMIN_ADDRESS> \
--name 'StellarNFT' \
--symbol 'SNFT'cd frontend
# Copy and configure
cp .env.example .env
# Edit .env and set VITE_CONTRACT_ID=<your-deployed-contract-id>
# Install & start
npm install
npm run dev- Open http://localhost:5173 in your browser
- Install Freighter wallet if you haven't
- Switch Freighter to Stellar Testnet
- Fund your account from Stellar Lab
- Click Connect Freighter
- Fill in NFT metadata and mint!
| Function | Description |
|---|---|
initialize(admin, name, symbol) |
Initialize collection |
mint(to, name, description, uri) |
Mint a new NFT |
transfer(from, to, token_id) |
Transfer NFT ownership |
owner_of(token_id) |
Get token owner |
balance_of(owner) |
Get NFT count |
token_metadata(token_id) |
Get token metadata |
name() / symbol() |
Collection info |
total_supply() |
Total minted count |
The contract emits events on:
mint— when an NFT is mintedtransfer— when ownership changesinitialize— when contract is initialized
- Wallet errors — Freighter not installed / not connected
- Network errors — Wrong network / testnet unreachable
- Transaction errors — Simulation failure / submission failure
- Input errors — Missing required fields
- Contract errors — Not initialized / token not found
- Smart Contract: Rust + Soroban SDK 26
- Frontend: React 19 + TypeScript + Vite
- Wallet: Freighter API
- Network: Stellar Testnet