Build, compile, and deploy Python smart contracts with an AI-powered IDE
- Overview
- Features
- Tech Stack
- Getting Started
- Project Structure
- Available Routes
- Smart Contract Templates
- Zero Wizard
- Python Compiler
- Development
- Deployment
- Documentation
Zerothon is a comprehensive platform for developing Python-based smart contracts. It features:
- Unified IDE: Monaco-based code editor with Python and Solidity support
- Zero Wizard: Interactive contract generator (OpenZeppelin-style)
- Python Compiler: Transpiles Python to EVM bytecode
- AI Assistant: Integrated AI chat for contract development
- Contract Explorer: View and interact with deployed contracts
- Template Library: Pre-built contract templates
Interactive smart contract builder with:
- Contract Types: Token (ERC20), NFT (ERC721), Vault, Governance
- Modules: Ownable, Mintable, Burnable, Pausable, ReentrancyGuard
- Real-time Code Generation: Compiler-compatible Python code
- Security Analysis: Built-in security checks
- Production-Ready: 500-650 lines per contract, 30-40 functions
Full-featured IDE with:
- Monaco Editor: Syntax highlighting, autocomplete
- Multi-language: Python, Solidity, JavaScript
- Compiler Integration: Real-time compilation
- Deployment: Deploy to blockchain
- Interaction: Call contract functions
- File Management: Save/load contracts
AI-powered development assistant:
- Contract generation
- Code explanation
- Bug fixing
- Best practices
Pre-built contracts:
- Python Contracts: TokenMint, NFTSimple, Staking, DeFiSwap
- Wizard Examples: AdvancedToken, AdvancedNFT, SecureVault
- Production-Ready: Fully tested and documented
Blockchain explorer:
- View deployed contracts
- Transaction history
- Contract interaction
- Event logs
- Framework: Next.js 14.2.25
- Language: TypeScript 5
- Styling: Tailwind CSS 4.1.9
- UI Components: Radix UI
- Animations: Framer Motion, GSAP
- 3D Graphics: Three.js, React Three Fiber
- Code Editor: Monaco Editor
- Runtime: Node.js
- API: Next.js API Routes
- Database: Dexie (IndexedDB)
- Authentication: JWT
- Library: ethers.js
- Compiler: solc 0.8.30
- Python Runtime: Pyodide 0.29.0
- Provider: OpenRouter
- SDK: Vercel AI SDK
- Node.js 18+
- npm or pnpm
- Git
# Clone the repository
git clone https://github.com/ShahiTechnovation/zerothon.git
cd zerothon
# Install dependencies
npm install --legacy-peer-deps
# Run development server
npm run devThe app will be available at http://localhost:3000
# Create production build
npm run build
# Start production server
npm startzerothon/
βββ app/ # Next.js app directory
β βββ ai-chat/ # AI assistant page
β βββ api/ # API routes
β βββ contract/ # Contract details page
β βββ docs/ # Documentation page
β βββ explorer/ # Blockchain explorer
β βββ features/ # Features showcase
β βββ playground/ # IDE page
β βββ templates/ # Template gallery
β βββ wizard/ # Zero Wizard page
βββ components/ # React components
β βββ bottom-dock-menu.tsx # Navigation dock
β βββ ui/ # UI components (Radix)
β βββ zerothan-ai/ # IDE components
β βββ unified-ide.tsx # Main IDE component
βββ lib/ # Utilities and libraries
β βββ pychain/ # Python smart contract library
β β βββ std/ # Standard library
β β βββ base/ # Base contracts (Token, NFT)
β β βββ mixins/ # Composable modules
β βββ plugins/ # Compiler plugins
β βββ utils/ # Helper functions
βββ templates/ # Contract templates
β βββ python_contracts/ # Basic Python contracts
β βββ wizard_examples/ # Generated examples
βββ zerothan_cli/ # Python to EVM compiler
β βββ transpiler.py # AST analyzer & bytecode generator
β βββ compiler.py # Compilation orchestration
β βββ py_contracts.py # Base contract classes
β βββ deployer.py # Deployment utilities
βββ python-compiler-service/ # Compiler microservice
βββ docs/ # Documentation
β βββ ZERO_WIZARD_*.md # Wizard documentation
β βββ *.md # Other guides
βββ public/ # Static assets
βββ scripts/ # Build scripts
β βββ sync-cli.js # CLI sync script
βββ package.json # Dependencies
| Route | Description | Features |
|---|---|---|
/ |
Home page | Landing, features showcase |
/playground |
IDE | Code editor, compiler, deployment |
/wizard |
Contract wizard | Interactive contract builder |
/templates |
Template gallery | Pre-built contracts |
/ai-chat |
AI assistant | Contract generation, help |
/explorer |
Blockchain explorer | View contracts, transactions |
/contract/[address] |
Contract details | Interact with deployed contracts |
/docs |
Documentation | Guides, API reference |
/features |
Features page | Platform capabilities |
-
TokenMint.py (~90 lines)
- Basic ERC20 token
- Minting and burning
- Admin controls
-
NFTSimple.py (~95 lines)
- Basic ERC721 NFT
- Minting and transfers
- Approval system
-
Staking.py (~95 lines)
- Token staking
- Reward calculation
- Stake/unstake
-
DeFiSwap.py (~100 lines)
- Token swapping
- Liquidity pools
- Price calculation
-
MyToken.py (~500 lines, 30+ functions)
- Complete ERC20 implementation
- Minting, burning, pausing
- Blacklist, transfer controls
- Statistics tracking
-
MyNFT.py (~600 lines, 35+ functions)
- Complete ERC721 implementation
- Metadata management
- Royalty system
- Operator approvals
-
SecureVault.py (~650 lines, 40+ functions)
- Time-locked withdrawals
- Fee system
- Whitelist/blacklist
- Emergency mode
The Zero Wizard is an interactive contract builder inspired by OpenZeppelin's Contracts Wizard.
-
4-Step Process:
- Select contract type (Token, NFT, Vault, Governance)
- Configure parameters (name, symbol, decimals, supply)
- Enable modules (Ownable, Mintable, Burnable, Pausable, etc.)
- Preview and export code
-
Module System:
- Ownable: Single-owner access control
- Mintable: Create new tokens/NFTs
- Burnable: Destroy tokens/NFTs
- Pausable: Emergency pause
- ReentrancyGuard: Attack prevention
-
Security Analysis:
- Conflict detection
- Access control checks
- Reentrancy warnings
- Best practice suggestions
All generated contracts:
- β
Import from
zerothan.py_contracts - β
Use
@public_functionand@view_functiondecorators - β Include comprehensive error handling
- β Emit events for all state changes
- β Are compiler-compatible
The zerothan_cli transpiles Python smart contracts to EVM bytecode.
Python Source Code
β
AST Analysis (transpiler.py)
β
State Variables & Functions Extraction
β
EVM Bytecode Generation
β
Deployable Contract
- transpiler.py: AST analyzer and bytecode generator
- compiler.py: Compilation orchestration
- py_contracts.py: Base contract classes
- deployer.py: Deployment utilities
from zerothan.py_contracts import PySmartContract
class MyContract(PySmartContract):
def __init__(self):
super().__init__()
self.my_var = self.state_var("my_var", 0)
@public_function
def set_value(self, value: int):
self.my_var = value
self.event("ValueSet", value)
@view_function
def get_value(self) -> int:
return self.my_var# Development server (with CLI sync)
npm run dev
# Production build
npm run build
# Start production server
npm start
# Lint code
npm run lintCreate .env.local:
# Optional: Add your environment variables here
NEXT_PUBLIC_APP_NAME=Zerothon
NEXT_PUBLIC_APP_URL=http://localhost:3000- Create contract in
templates/python_contracts/ortemplates/wizard_examples/ - Follow the compiler-compatible format
- Add to template gallery in
app/templates/page.tsx
- Push to GitHub
- Import project in Vercel
- Deploy automatically
# Or use Vercel CLI
npm install -g vercel
vercel --prod# Build
npm run build
# Start
npm startSee DEPLOYMENT.md for detailed instructions.
- Architecture - System design
- Modules - Module composition
- Security - Security best practices
- Quick Reference - Cheat sheet
- Compiler Compatibility - Compiler guide
- Production Contracts - Contract features
- Deployment Guide - GitHub & Vercel deployment
- Quick Deploy - Quick reference
Contributions are welcome! Please:
- Fork the repository
- Create a feature branch
- Make your changes
- Submit a pull request
This project is licensed under the MIT License.
- OpenZeppelin: Inspiration for the Wizard
- Next.js Team: Amazing framework
- Vercel: Hosting and deployment
- Monaco Editor: Code editor
- Radix UI: UI components
- GitHub: ShahiTechnovation/zerothon
- Issues: Report bugs
- Discussions: Community forum
- β Zero Wizard with 5 modules
- β Production-ready contracts
- β Unified IDE
- β Python compiler
- β Template library
- More wizard modules (AccessControl, Permit, Upgradeable)
- Enhanced compiler optimizations
- Contract verification
- Testnet deployment
- Wallet integration
- Multi-chain support
- Contract marketplace
- Audit integration
- Advanced analytics
- Team collaboration
Built with β€οΈ by the Zerothon Team
Making Python smart contract development accessible to everyone
Last Updated: January 15, 2026
Version: 1.0.0
Status: Production Ready