Features
magical-nft comes packed with features to help you build onchain NFT projects efficiently.
Core Features
🎨 Fully Onchain Storage
All your NFT assets are stored directly on the blockchain using SSTORE2, an efficient storage pattern that reduces gas costs significantly.
📦 Modular Contract Architecture
The template separates concerns into three main contracts:
- Main Contract - ERC721 implementation with minting logic
- Storage Contract - SSTORE2-based asset storage
- Renderer Contract - Dynamic metadata and image generation
🔧 Developer Tools
Built-in scripts for common development tasks:
| Script | Description |
|---|---|
setup | Initialize a new project from the template |
extract-html | Extract HTML assets from source files |
convert-to-avif | Convert images to AVIF format |
base64-encode | Encode assets to base64 |
upload-all-files | Upload all assets to the storage contract |
verify | Verify deployed contracts on block explorers |
🚀 Deployment Scripts
Foundry deployment scripts for flexible deployment options:
- Full Deploy - Deploy all contracts at once
- Individual Deploy - Deploy contracts separately
- Upload Scripts - Upload assets after deployment
Technical Stack
- Solidity - Smart contract development
- Foundry - Testing and deployment framework
- Bun - TypeScript runtime for scripts
- SSTORE2 - Efficient onchain storage
- OpenZeppelin - Battle-tested contract libraries