Lyra Web3 Playground — Solidity IDE Guide
A browser-based Solidity IDE for writing, compiling, deploying, and interacting with smart contracts. No local setup required — everything runs in the browser.
Features
| Feature | Description |
|---|---|
| Solidity Editor | Monaco editor with syntax highlighting |
| Compiler | In-browser Solc compilation |
| Deploy | Deploy to any EVM chain |
| Interact | Call contract functions from UI |
| Templates | Pre-built contract templates |
| ABI Viewer | Visual ABI explorer |
| Gas Estimator | Pre-deployment gas estimates |
| Verification | Auto-verify on block explorers |
Quick Start
- Open the playground in your browser
- Write or paste Solidity code
- Click "Compile"
- Connect wallet
- Click "Deploy"
- Interact with your contract
Supported Chains
| Chain | Testnet | Mainnet |
|---|---|---|
| Ethereum | Sepolia | ✅ |
| Arbitrum | Sepolia | ✅ |
| Base | Sepolia | ✅ |
| Polygon | Amoy | ✅ |
| BSC | Testnet | ✅ |
| Optimism | Sepolia | ✅ |
Contract Templates
ERC-20 Token
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
contract MyToken is ERC20 {
constructor(uint256 initialSupply) ERC20("My Token", "MTK") {
_mint(msg.sender, initialSupply * 10 ** decimals());
}
}
ERC-8004 Agent
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;
import "@erc8004/contracts/AgentNFT.sol";
contract MyAgentRegistry is AgentNFT {
function registerAgent(
string memory name,
string memory metadataURI
) external returns (uint256) {
return _mintAgent(msg.sender, name, metadataURI);
}
}
Sperax USDs Vault
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
contract USDsVault {
IERC20 public immutable usds;
constructor(address _usds) {
usds = IERC20(_usds);
}
function deposit(uint256 amount) external {
usds.transferFrom(msg.sender, address(this), amount);
}
function withdraw(uint256 amount) external {
usds.transfer(msg.sender, amount);
}
}
Interaction Panel
After deployment, the playground generates an interaction panel:
┌─────────────────────────────────────┐
│ Contract: MyToken │
│ Address: 0x742d...Bc9 │
│ Chain: Arbitrum One │
├─────────────────────────────────────┤
│ Read Functions: │
│ ├── name() → "My Token" │
│ ├── symbol() → "MTK" │
│ ├── totalSupply() → 1,000,000 │
│ └── balanceOf(address) → [input] │
├─────────────────────────────────────┤
│ Write Functions: │
│ ├── transfer(to, amount) │
│ ├── approve(spender, amount) │
│ └── mint(to, amount) │
└─────────────────────────────────────┘
Educational Mode
The playground includes an "Explain" feature:
- Hover over any Solidity keyword for a tooltip
- Click "Explain" to get an AI explanation of the contract
- Step-through debugger for understanding execution flow
Links
- GitHub: https://github.com/nirholas/lyra-web3-playground
- Remix IDE: https://remix.ethereum.org (alternative)
- OpenZeppelin: https://docs.openzeppelin.com
- Sperax: https://app.sperax.io