The Lyra Playground features a premium code sandbox that rivals and exceeds tools like CodePen, JSFiddle, and Ethereum Remix. Our sandbox provides two specialized environments:
- Web Sandbox - For HTML, CSS, JavaScript, React, Vue, and Python development
- Solidity IDE - Professional smart contract development environment
Access both at /ide or through any example page.
A CodePen-like environment for web development with advanced features.
- File Tree Navigation: Full folder structure with create/delete/rename
- Tabbed Interface: Open multiple files simultaneously
- Monaco Editor: Professional code editor with syntax highlighting, autocomplete
- Auto-save: Changes persist automatically
- Instant Hot Reload: See changes as you type
- Device Presets: Test on Desktop, Tablet, and Mobile viewports
- Responsive Testing: Drag to resize preview window
- Console Integration: Capture console.log, errors, and warnings
| Language | Features |
|---|---|
| HTML | Full syntax, Emmet support |
| CSS | Autoprefixer, live reload |
| JavaScript | ES2022+, modules |
| TypeScript | Full type checking |
| React/JSX | Component preview, hooks |
| Vue | Single-file components |
| Python | Pyodide runtime in-browser |
- Theme (VS Dark / Light)
- Font size (10-24px)
- Tab size (2/4 spaces)
- Word wrap toggle
- Minimap toggle
- Line numbers toggle
- Format on save
- Vim mode
- Auto-save
- Font ligatures
- Download project as ZIP
- Generate shareable URLs
- Copy code snippets
A Remix-quality (or better!) smart contract development environment.
- Solidity 0.6.12 through 0.8.24
- Real-time compilation (Ctrl+S)
- Error/warning highlighting with line numbers
- Copy ABI and Bytecode buttons
| Network | Type |
|---|---|
| JavaScript VM | Local simulation |
| Sepolia | Ethereum testnet |
| Goerli | Ethereum testnet |
| Mumbai | Polygon testnet |
| Mainnet | Ethereum mainnet |
- 5 pre-funded test accounts (100 ETH each)
- Balance tracking
- Nonce management
- Custom gas limit
- Value in Wei/Gwei/Ether
- Deployed Contracts Panel: Expandable list of all deployed contracts
- Function Buttons: Color-coded (blue for read, orange for write)
- Input Fields: Type-aware form inputs for function parameters
- Result Display: Return values shown inline
- Transaction History: Full log with status, gas used, timestamps
- Timestamped log messages
- Color-coded by type (log/warn/error/info)
- Clear button
- Collapsible panel
Every example on the platform now features an integrated sandbox view.
- Contract.sol: Pre-loaded with the example's smart contract
- Frontend.jsx: Auto-generated React dApp from contract ABI
- Preview: Live-rendered frontend
- Deploy & Interact: Full contract deployment and function calls
Switch between:
- Sandbox (default): Full IDE experience
- Tutorial: Traditional step-by-step guide
- Direct Access: Navigate to
/ide - From Examples: Click any example, defaults to sandbox view
- Quick Links:
/ide?type=web- Web Sandbox/ide?type=solidity- Solidity IDE
- Go to
/ideand select "Web Sandbox" - Edit
index.html,style.css, orscript.js - See live preview update automatically
- Add new files with the + button
- Toggle device presets for responsive testing
- Go to
/ideand select "Solidity IDE" - Write or paste your Solidity code
- Press Ctrl+S or click "Compile"
- Select network and account
- Click the orange "Deploy" button
- Interact with deployed contract in the right panel
The original Interactive Sandbox provides a full-featured, CodeSandbox-like development environment for smart contract development directly in your browser. It combines powerful editing capabilities with live compilation, deployment, and testing features.
- File Tree Navigation: Browse and manage multiple files in your workspace
- Tabbed Interface: Switch between files with an intuitive tab system
- Monaco Editor: Full-featured code editor with syntax highlighting, autocomplete, and error detection
- File Management: Create, delete, and organize Solidity and other files
- Auto-save: Changes are automatically persisted to your workspace
- One-Click Compilation: Compile Solidity contracts with multiple compiler versions (0.8.17-0.8.20)
- Optimization Options: Enable/disable compiler optimizations
- Real-time Feedback: See compilation errors and warnings instantly
- Testnet Deployment: Deploy directly to Sepolia, Mumbai, and other testnets
- Transaction Tracking: Monitor deployment transactions with explorer links
Three powerful AI modes to accelerate your development:
-
Generate: Create smart contracts from natural language descriptions
- Example: "Create an ERC721 NFT contract with minting and royalties"
- AI generates complete, production-ready contract code
-
Explain: Get detailed explanations of your code
- Understand complex contract logic
- Learn best practices and security patterns
- Get line-by-line breakdowns
-
Test: Automatically generate test suites
- Creates comprehensive unit tests for your contracts
- Supports Hardhat and Foundry frameworks
- Tests edge cases and security scenarios
- Function Discovery: Automatically detects all public contract functions
- Read/Write Operations: Distinguish between view and state-changing functions
- Form Inputs: Type-safe input forms for function parameters
- Result Display: See function return values and transaction receipts
- Gas Estimation: Preview gas costs before sending transactions
- Real-time Logging: Track all compilation, deployment, and interaction events
- Filterable Logs: Filter by type (info, success, error, warning)
- Search: Quickly find specific log messages
- Export: Download log files for debugging
- Timestamps: Precise timing for all events
Pre-built templates to kickstart your project:
- Simple Storage: State management fundamentals
- MultiSig Wallet: Multi-signature authorization patterns
- ERC20 Token: Fungible token with minting/burning
- Custom Token: Extended ERC20 with advanced features
- NFT Collection: ERC721 with URI storage
- NFT Marketplace: Complete buying/selling platform
- Staking Rewards: Token staking with reward distribution
- Lending Protocol: Deposit and borrow functionality
- Yield Farming: LP token staking for rewards
- Persistent Storage: Workspaces saved in browser localStorage
- Export/Import: Download and share workspace configurations
- Share Links: Generate shareable URLs for collaboration
- Multiple Workspaces: Switch between different projects
Navigate to /sandbox or click "Interactive Sandbox" in the navigation bar.
- Click the "Template" button in the toolbar
- Browse available templates by category
- Select a template to load it into your workspace
- The template files will be automatically created
- Click the "+" button in the file tree
- Enter a filename (e.g.,
MyContract.sol) - Start coding with full autocomplete support
- Open the AI Assistant panel (lightning bolt icon)
- Select "Generate" mode
- Describe your contract in natural language
- AI generates the code, which you can insert as a new file
- Use the Monaco editor with Solidity syntax highlighting
- Multiple files open in tabs
- Auto-complete and error detection
- Real-time syntax checking
- Select your desired Solidity version (0.8.17-0.8.20)
- Click the "Compile" button
- View any warnings or errors in the console
- Green checkmark indicates successful compilation
- MetaMask or compatible wallet installed
- Connected to a supported testnet (Sepolia, Mumbai)
- Sufficient testnet ETH for gas fees
- Ensure your contract is compiled (see green checkmark)
- Connect your wallet if not already connected
- Click the "Deploy" button
- Confirm the transaction in your wallet
- Wait for deployment confirmation
- Contract address and explorer link appear in console
- Switch to the "Interact" panel
- Find your function in the list (marked with eye icon)
- Fill in any required parameters
- Click "Read" to execute
- Result displays below the function
- Locate the function (marked with send icon)
- Enter parameter values
- Click "Write" to initiate transaction
- Confirm in your wallet
- Transaction hash and status appear in console
- View all events chronologically
- Filter by type (info, success, error, warning)
- Search for specific messages
- Export logs for external analysis
- View transaction hashes
- Click explorer links to see on-chain data
- Monitor gas usage
- See revert reasons for failed transactions
- Horizontal Layout: Editor left, panels right (default)
- Vertical Layout: Editor top, panels bottom
- Toggle with the maximize/minimize button
- Toggle visibility with the folder icon
- Create nested file structures
- Organize by contract type or feature
Ctrl/Cmd + S: Save file (auto-save enabled by default)Ctrl/Cmd + F: Find in editorCtrl/Cmd + H: Find and replaceF1: Command palette
-
Be Specific: More detailed prompts yield better results
- ❌ "Create a token"
- ✅ "Create an ERC20 token with 1M supply, 18 decimals, and minting limited to owner"
-
Iterate: Use "Explain" to understand generated code, then refine
-
Test Generation: Generate tests after finalizing your contract logic
- Click the share icon in toolbar
- Link is automatically copied to clipboard
- Share the URL with collaborators
- Recipients can view and fork your workspace
- Check Solidity version: Ensure you're using a compatible version
- Review imports: Verify all import statements are correct
- Check syntax: Look for missing semicolons, brackets, etc.
- View console: Detailed error messages appear in the console
- Wallet connected: Ensure MetaMask is connected
- Correct network: Switch to the intended testnet
- Sufficient balance: Get testnet ETH from faucets
- Gas limits: Try increasing gas limit manually in MetaMask
- Contract deployed: Verify deployment was successful
- Correct parameters: Check input types match function signature
- Sufficient allowance: For token interactions, ensure approval
- Gas price: Network congestion may require higher gas
- Start with a template or AI generation
- Compile frequently to catch errors early
- Use AI explain to understand complex patterns
- Deploy to testnet once stable
- Interact thoroughly to test all functions
- Generate tests with AI
- Export workspace for backup
- Close unused file tabs to reduce memory usage
- Clear console logs periodically
- Export and reimport workspaces to reset state
- Always test on testnets before mainnet
- Use AI explain to identify potential vulnerabilities
- Follow compiler warnings
- Review generated code carefully
- Test edge cases in contract interaction
The sandbox integrates with the backend API for:
- Compilation: Server-side Solidity compilation
- Deployment: Contract deployment to testnets
- AI Services: OpenAI-powered features
- IPFS: File storage (coming soon)
- Faucet: Testnet funding (coming soon)
Tested and optimized for:
- Chrome 90+
- Firefox 88+
- Safari 14+
- Edge 90+
- Local Storage: Workspaces saved in browser localStorage
- No Server Storage: Your code stays on your device
- Share Links: Encoded workspace data in URL
- Privacy: No tracking or analytics on code content
Coming soon:
- Hardhat/Foundry fork sandboxes
- Gas profiling and optimization
- Contract verification
- Integrated testing framework
- Subgraph integration
- Multi-file debugging
- Version control integration
- Cloud sync with authentication ✅
- Community sharing ✅
- Collaborative editing
- Custom themes
Share your creations with the world and discover projects from other developers.
Community features use wallet connect instead of traditional login:
- Connect your MetaMask or compatible wallet
- Your wallet address serves as your identity
- No email, password, or account creation required
- Sign transactions to prove ownership
- Click the Share button in the sandbox header
- If not connected, a wallet connect modal appears
- Connect your wallet to proceed
- Add a title and description
- Choose a category (Sandbox, Template, Tutorial, Example)
- Add tags for discoverability
- Select visibility (Public or Unlisted)
- Click Share to publish
Discover shared projects from the community:
- Search: Find projects by keyword
- Categories: Filter by Sandbox, Template, Tutorial, or Example
- Sort: By Most Recent, Most Viewed, or Most Liked
- View modes: Grid or List view
View any shared project with:
- Full Code View: Monaco editor with read-only access
- Like & Fork: Show appreciation or create your own copy
- Comments: Discuss with other developers
- Stats: Views, likes, and forks count
- Embed Code: Add projects to your own site
- Open in IDE: Continue working on any project
All social features require wallet connection:
- Likes: Connect wallet to like projects
- Comments: Connect wallet to leave feedback
- Forks: Connect wallet to create your own copy
- Sharing: Connect wallet to publish projects
Share projects on external sites with embed code:
<iframe
src="https://lyra.works/embed/[share_token]?theme=dark"
width="100%"
height="500px"
style="border: 1px solid #374151; border-radius: 8px;"
loading="lazy"
allow="clipboard-write"
></iframe>Real-time cryptocurrency and DeFi market data is available throughout the platform.
Comprehensive market dashboard with four tabs:
- Cryptocurrencies: Top coins by market cap from CoinGecko
- DeFi Protocols: Protocol TVL from DeFiLlama
- Yields: Top yield farming opportunities
- Chains: TVL by blockchain
Use these components to add market data to your projects:
import { TopProtocolsWidget, TopYieldsWidget, TopChainsWidget } from '@/components/DeFiWidgets';
import PriceTicker from '@/components/PriceTicker';
// Price ticker bar
<PriceTicker coins={['bitcoin', 'ethereum', 'solana']} />
// DeFi widgets
<TopProtocolsWidget limit={5} />
<TopYieldsWidget limit={5} />
<TopChainsWidget limit={5} />Use market data hooks in your components:
import { useTopCoins, useLivePrices, useTopProtocols } from '@/hooks/useMarketData';
function MyComponent() {
const { data: coins, loading } = useTopCoins(10);
const { data: prices } = useLivePrices(['bitcoin', 'ethereum'], 30000);
const { data: protocols } = useTopProtocols(5);
}- Issues: Report bugs on GitHub
- Feature Requests: Open a discussion
- Documentation: Check the main README
- Community: Join our Discord (coming soon)
MIT License - see LICENSE file for details