stylus-toolkit
v0.2.10
Published
A comprehensive CLI development environment for Arbitrum Stylus smart contracts with automated gas profiling
Maintainers
Readme
Stylus Toolkit
The easiest way to build Arbitrum Stylus smart contracts in Rust.
Build, deploy, and profile Stylus contracts with simple commands. No Docker required - works with testnets out of the box!
✨ Features
- 🚀 One-command project setup - 4 ready-to-deploy templates
- 📦 Built-in WASM compiler - Automatic Rust to WebAssembly compilation
- ⚡ Gas profiling - Compare Rust vs Solidity gas usage
- 🌐 Network support - Local, testnet, and mainnet configurations
- 🐳 Docker optional - Use testnets for development (no Docker needed!)
- 📊 Multiple export formats - JSON, CSV, HTML reports
🎯 Quick Start (3 Commands)
# 1. Install
npm install -g stylus-toolkit
# 2. Create project
stylus-toolkit init -n my-counter -t basic && cd my-counter
# 3. Build
cd contracts-rust && rustup target add wasm32-unknown-unknown && cd .. && stylus-toolkit buildThat's it! Your contract is ready to deploy.
No Docker? No problem! Deploy to testnet directly:
stylus-toolkit config --set defaultNetwork=arbitrum-sepolia📋 Prerequisites
Required:
Optional:
- Docker (only if you want local node) (Download)
Most developers use testnet and don't need Docker!
📚 Documentation
- Quick Start Guide - Complete tutorial from zero to deployment
- Cheat Sheet - All commands at a glance
- Troubleshooting - Common issues and solutions
🛠️ Commands
init
Initialize a new Stylus project.
stylus-toolkit init [options]
Options:
-n, --name <name> Project name
-t, --template <template> Template (basic, erc20, erc721, defi)
--rust-only Rust only
--solidity-only Solidity onlyprofile
Profile and compare gas usage.
stylus-toolkit profile [options]
Options:
-c, --contract <name> Contract name
-r, --rpc <url> RPC endpoint
-n, --network <network> Network (local, arbitrum-sepolia, arbitrum-one)
--export <format> Export format (json, csv, html)
--detailed Show detailed breakdownconfig
Manage configuration.
stylus-toolkit config [options]
Options:
--set <key=value> Set config value
--get <key> Get config value
--list List all config
--reset Reset to defaultsExample Output
┌────────────┬──────────────┬──────────────┬──────────┬────────┐
│ Metric │ Rust │ Solidity │ Savings │ % │
├────────────┼──────────────┼──────────────┼──────────┼────────┤
│ Deployment │ 120,456 │ 845,231 │ 724,775 │ 85.75% │
│ increment │ 2,341 │ 43,892 │ 41,551 │ 94.67% │
└────────────┴──────────────┴──────────────┴──────────┴────────┘Configuration
Default networks:
- Local:
http://localhost:8547 - Arbitrum Sepolia: Testnet
- Arbitrum One: Mainnet
Add custom networks:
stylus-toolkit config --set networks.custom.rpcUrl=https://your-rpc.comProject Structure
my-project/
├── contracts-rust/
│ └── src/lib.rs
├── contracts-solidity/
│ └── Contract.sol
├── .stylus-toolkit/
└── README.mdDevelopment
git clone https://github.com/soloking1412/stylus-toolkit.git
cd stylus-toolkit
npm install
npm run buildLicense
MIT
