🧪 An open-source, up-to-date toolkit for building decentralized applications (dapps) on the Arbitrum blockchain. It's designed to make it easier for developers to create and deploy smart contracts and build user interfaces that interact with those contracts.
⚙️ Built using Rust, NextJS, RainbowKit, Stylus, Wagmi, Viem, and TypeScript.

Before you begin, you need to install the following tools:
Note: Windows Compatibility
Scaffold-Stylus currently does not support Windows natively. If you're using Windows, we recommend:
- Use WSL (Windows Subsystem for Linux) - Install WSL2 and run Scaffold-Stylus within the Linux environment
- Switch to Linux or macOS - For the best development experience
For WSL setup, follow the Microsoft WSL installation guide.
To get started with Scaffold-Stylus, follow the steps below:
If you prefer a one-liner, install via stylusup (recommended):
Tool for installing all the Stylus essentials for development. Stylusup will install the latest stable versions of:
curl -s https://stylusup.sh/install.sh | sh
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
Check the Rust installation guide for more information.
Then install the Stylus CLI tools:
cargo install --force --locked cargo-stylus@0.10.2
Prerequisite:
cargo-stylus version 0.10.2rustc version match with packages/stylus/contracts/rust-toolchain.tomlSet default toolchain match rust-toolchain.toml and add the wasm32-unknown-unknown build target to your Rust compiler:
rustup default 1.89
rustup target add wasm32-unknown-unknown --toolchain 1.89
You should now have it available as a Cargo subcommand:
cargo stylus --help
Use the interactive setup to scaffold a new project:
npx create-stylus@latest
Then navigate into your project directory:
cd <project-name>
yarn install
# Initialize submodules (required for Nitro dev node)
git submodule update --init --recursive
git clone https://github.com/Arb-Stylus/scaffold-stylus.git
cd scaffold-stylus
yarn install
# Initialize submodules (required for Nitro dev node)
git submodule update --init --recursive
In your first terminal:
yarn chain
This command starts a local Stylus-compatible network using the Nitro dev node script (./nitro-devnode/run-dev-node.sh). The network runs on your local machine and can be used for testing and development. You can customize the Nitro dev node configuration in the nitro-devnode submodule.
In your second terminal:
yarn deploy
This command deploys a test smart contract to the local network. The contract is located in packages/stylus/contracts/your-contract/src and can be modified to suit your needs. The yarn deploy command uses the deploy script located in packages/stylus/scripts to deploy the contract to the network. You can also customize the deploy script .
In your third terminal:
yarn start
Visit your app at: http://localhost:3000. You can interact with your smart contract using the Debug Contracts page, which provides a user-friendly interface for testing your contract's functions and viewing its state.
yarn stylus:test
lib.rs in packages/stylus/contracts/your-contract/srcpackages/nextjs/apppackages/stylus/scriptsScaffold-Stylus enables you to create and deploy multiple contracts within a single project. Follow the steps below to create and deploy your own contracts.
Use the following command to create a new contract and customize it as needed:
yarn new-module <contract-name>
The generated contract will be located in packages/stylus/contracts/<contract-name>.
Workspace structure: packages/stylus/contracts is a Cargo workspace with members = ["*"]. yarn new-module <name> (via scripts/new_module.sh) scaffolds the new contract under contracts/ — the glob auto-discovers it, no manual wiring needed.
Before deploying, it's recommended to validate your contract size using cargo stylus check:
cd packages/stylus/contracts/<contract-name>
cargo stylus check
This command performs several important checks:
Contract Size Indicators:
Important: When using constructors, error logs from constructor execution may not be visible. Consider using
initialize()functions instead for better error visibility.
yarn deploy [...options]
This command runs the deploy.ts script located in packages/stylus/scripts. You can customize this script with your deployment logic.
Available Options:
--network <network>: Specify which network to deploy to--estimate-gas: Only perform gas estimation without deploying--max-fee=<maxFee>: Set maximum fee per gas in gweiNote: Deployment information is automatically saved in packages/stylus/deployments by default.
To deploy your contracts to other networks (other than the default local Nitro dev node), you'll need to configure your RPC endpoint and wallet credentials.
Configure your target network's RPC endpoint using the proper RPC_URL_<network> environment variable. You can set this in your shell or create a .env file (see .env.example for reference):
env
RPC_URL_SEPOLIA=https://your-network-rpc-url
Note: If RPC URL is not provided, system will use default public RPC URL from that network
For real deployments, you must provide your own wallet's private key. Set the PRIVATE_KEY_<network> environment variable:
env
PRIVATE_KEY_SEPOLIA=your_private_key_here
Security Note: A development key is used by default when running the Nitro dev node locally, but for external deployments, you must provide your own private key.
Set the ACCOUNT_ADDRESS_<network>
env
ACCOUNT_ADDRESS_SEPOLIA=your_account_address_here
Open packages/nextjs/scaffold.config.ts and update the targetNetworks array to include your target chain. This ensures your frontend connects to the correct network and generates the proper ABI in deployedContracts.ts:
ts
import * as chains from "./utils/scaffold-stylus/supportedChains";
// ...
targetNetworks: [chains.arbitrumSepolia],
For Arbitrum testnets, you may need testnet ETH to deploy contracts. You can obtain testnet tokens from these faucets:
This template supports Arbitrum networks only. You can test which networks are available and their RPC URLs:
yarn info:networks
This will show you all supported networks and their corresponding RPC endpoints.
Once configured, deploy to your target network:
yarn deploy --network <network>
Important Security Notes:
.env.example provide a template for required environment variablesVisit our Deploy to Orbit chain documentation for detailed guide
Visit our Verify section
Visit our Troubleshooting section
Visit our docs to learn how to start building with Scaffold-Stylus.
To learn more about its features, check out our website.
We welcome contributions to Scaffold-Stylus!
Please see CONTRIBUTING.md for more information and guidelines for contributing to Scaffold-Stylus.
$ claude mcp add scaffold-stylus \
-- python -m otcore.mcp_server <graph>