The legendary sword that forges smart contracts
A blazing-fast toolkit for scaffolding OpenZeppelin-powered smart contracts, tests, and deployment scripts. Supports Solidity (Foundry) and Rust (Arbitrum Stylus) projects.
🦀 Built with Rust 🦀
curl --proto '=https' --tlsv1.2 -sSf https://gramr.pxlvre.eth.limo/install.sh | shwotanThe wizard guides you through creating any type of smart contract with zero configuration!
# ERC20 Token
gramr new contract MyToken --solidity --oz-erc20
# ERC721 NFT with extensions
gramr new contract MyNFT --solidity --oz-erc721 --extensions enumerable,burnable- Installation Guide - Complete installation instructions
- Quick Start - Get up and running in 5 minutes
- CLI Reference - Complete command documentation
- Wotan Wizard - Interactive mode guide
- API Documentation - Rust library docs
Gramr is organized as a Rust workspace with four components:
gramr(library) - Core functionality for contract generationgramr-cli- Command-line interfacewotan- Interactive wizard for guided creationgramrup- Installer with dependency management
✅ Contracts - ERC20, ERC721, ERC1155 tokens
✅ Libraries - Reusable utility functions
✅ Interfaces - Contract interface definitions
✅ Abstract Contracts - Abstract base contracts
✅ Tests - Foundry test files
✅ Scripts - Deployment scripts
ERC20 (11 extensions): permit, burnable, capped, pausable, votes, wrapper, flashmint, temporaryapproval, bridgeable, erc1363, erc4626
ERC721 (8 extensions): pausable, burnable, consecutive, uristorage, votes, royalty, wrapper, enumerable
ERC1155 (4 extensions): pausable, burnable, supply, uristorage
- ✅ All contract types and extensions
- ✅ Upgradeable patterns
- ✅ Test and script generation
- ✅ Complete OpenZeppelin integration
- ✅ Basic ERC20, ERC721, ERC1155 contracts
- ✅ Library generation
- ❌ Extensions (coming soon)
- ❌ Upgradeable contracts (not yet supported by OpenZeppelin Stylus)
curl --proto '=https' --tlsv1.2 -sSf https://gramr.pxlvre.eth.limo/install.sh | shThis installs gramr, wotan, and gramrup binaries.
# Install from crates.io (library only)
cargo install gramr
# Install from GitHub (all tools)
cargo install --git https://github.com/pxlvre/gramr gramr-cli
cargo install --git https://github.com/pxlvre/gramr wotan
cargo install --git https://github.com/pxlvre/gramr gramrup# Run with Docker
docker run --rm -v $(pwd):/workspace ghcr.io/pxlvre/gramr:latest gramr --help
# Development environment
docker-compose up -d gramr-devgit clone https://github.com/pxlvre/gramr
cd gramr
cargo build --release --allStart the interactive wizard for guided contract creation:
wotan
# OR
gramr wizardThe wizard handles:
- Resource type selection (contract, library, script, test)
- Language choice (Solidity or Rust/Stylus)
- Token standard selection with previews
- Extension configuration
- Generation options (tests, scripts, upgradeable)
gramr new <TYPE> <NAME> [OPTIONS]# Basic contract
gramr new contract MyContract --solidity
# ERC20 Token
gramr new contract MyToken --solidity --oz-erc20
# ERC721 NFT with extensions
gramr new contract MyNFT --solidity --oz-erc721 --extensions enumerable,burnable
# ERC1155 Multi-token
gramr new contract GameAssets --solidity --oz-erc1155 --extensions supply,pausable
# Upgradeable contract
gramr new contract MyToken --solidity --oz-erc20 --upgradeable
# With tests and deployment script
gramr new contract MyToken --solidity --oz-erc20 --with-test --with-script# Library
gramr new library MathUtils --solidity
# Interface
gramr new interface IMyToken --solidity
# Abstract contract
gramr new abstract BaseToken --solidity
# Test file
gramr new test TokenTest --solidity
# Deployment script
gramr new script DeployToken --solidity# Basic Rust contracts for Arbitrum Stylus
gramr new contract MyToken --rust-stylus --oz-erc20
gramr new contract MyNFT --rust-stylus --oz-erc721
gramr new library Utils --rust-stylusLanguages:
--solidity- Generate Solidity code (Foundry projects)--rust-stylus- Generate Rust code (Arbitrum Stylus projects)
Token Standards:
--oz-erc20- OpenZeppelin ERC20 token--oz-erc721- OpenZeppelin ERC721 NFT--oz-erc1155- OpenZeppelin ERC1155 multi-token
Patterns:
--upgradeable- Use upgradeable contract patterns--extensions <LIST>- Comma-separated extensions
Generation:
--with-test- Generate test file--with-script- Generate deployment script--with-section-markers- Add organized comment sections
Configuration:
--pragma <VERSION>- Solidity version (default: 0.8.30)--license <LICENSE>- SPDX license identifier (default: MIT)
# Production container
docker run --rm -v $(pwd):/workspace ghcr.io/pxlvre/gramr:latest \
gramr new contract MyToken --solidity --oz-erc20
# Development environment
docker-compose up -d gramr-dev
docker-compose exec gramr-dev bashghcr.io/pxlvre/gramr:latest- Production (200MB)ghcr.io/pxlvre/gramr-dev:latest- Development (1.5GB)ghcr.io/pxlvre/gramr-docs:latest- Documentation server
- Rust 1.70+ and Cargo
- Foundry (
forge,anvil,cast)
- Rust nightly
- cargo-stylus (optional)
Add to your Cargo.toml:
[dependencies]
gramr = "0.1"Use programmatically:
use gramr::{GenericContractGenerator, ContractType, ProjectType, Language};
fn main() -> gramr::Result<()> {
let project = ProjectType::detect_project_type(".")?;
let generator = GenericContractGenerator::new(
project,
Language::Solidity,
"MyToken",
ContractType::ERC20,
None,
);
generator.generate()?;
Ok(())
}- ✅ Complete Solidity support
- ✅ Interactive wizard (Wotan)
- ✅ Experimental Rust/Stylus support
- ✅ Docker containerization
- ✅ One-line installer
- Full Rust/Stylus extension support
- Cairo/StarkNet support
- Template customization
- Windows support
We welcome contributions! See our Contributing Guide.
MIT or Apache-2.0
Built by Pol Vidal • pxlvre.eth
Special thanks to the OpenZeppelin, Foundry, and Arbitrum teams.
Links: