arbitrum-dapp-skill
Newš Build and deploy decentralized applications on Arbitrum using Rust and Solidity with this practical guide and skill enhancement project.
Overview
Arbitrum dApp Development
Stack
| Layer | Tool | Notes |
|---|---|---|
| Smart contracts (Rust) | stylus-sdk v0.10+ | Compiled to WASM, runs on Stylus VM |
| Smart contracts (Solidity) | Solidity 0.8.x + Foundry | Standard EVM path on Arbitrum |
| Local node | nitro-devnode | Docker-based local Arbitrum chain |
| Contract CLI | cargo-stylus | Check, deploy, export-abi for Stylus |
| Contract toolchain | Foundry (forge, cast, anvil) | Build, test, deploy, interact for Solidity |
| Frontend | React / Next.js + viem + wagmi | viem for all chain interaction |
| Package manager | pnpm | Workspace-friendly, fast |
Decision Flow
When starting a new contract:
- Need max performance / lower gas? ā Stylus Rust. See
references/stylus-rust-contracts.md. - Need broad tooling compatibility / rapid prototyping? ā Solidity. See
references/solidity-contracts.md. - Hybrid? ā Use both. Stylus and Solidity contracts are fully interoperable on Arbitrum.
Project Scaffolding
Monorepo layout (recommended)
my-arbitrum-dapp/
āāā apps/
ā āāā frontend/ # React / Next.js app
ā āāā contracts-stylus/ # Rust Stylus contracts
ā āāā contracts-solidity/ # Foundry Solidity contracts
ā āāā nitro-devnode/ # Local dev chain (git submodule)
āāā pnpm-workspace.yaml
āāā package.jsonBootstrap steps
# 1. Create workspace
mkdir my-arbitrum-dapp && cd my-arbitrum-dapp
pnpm init
printf "packages:\n - 'apps/*'\n" > pnpm-workspace.yaml
# 2. Local devnode
git clone https://github.com/OffchainLabs/nitro-devnode.git apps/nitro-devnode
cd apps/nitro-devnode && ./run-dev-node.sh && cd ../..
# 3a. Stylus contract
cargo stylus new apps/contracts-stylus
# 3b. Solidity contract
cd apps && forge init contracts-solidity && cd ..
# 4. Frontend
pnpm create next-app apps/frontend --typescript
cd apps/frontend
pnpm add viem wagmi @tanstack/react-queryCore Workflow
Stylus Rust
# Validate
cargo stylus check --endpoint http://localhost:8547
# Deploy (uses the nitro-devnode pre-funded deployer account)
cargo stylus deploy \
--endpoint http://localhost:8547 \
--private-key $PRIVATE_KEY
# Export ABI for frontend consumption
cargo stylus export-abiSolidity (Foundry)
# Build
forge build
# Test
forge test
# Deploy locally (uses the nitro-devnode pre-funded deployer account)
forge script script/Deploy.s.sol --rpc-url http://localhost:8547 --broadcast \
--private-key $PRIVATE_KEYNote: The nitro-devnode ships with a pre-funded deployer account. See
references/local-devnode.mdfor the default private key and address. For testnet/mainnet, use your own key via environment variables ā never hardcode secrets.
Frontend (viem + wagmi)
import { createPublicClient, http } from "viem";
import { arbitrumSepolia } from "viem/chains";
const client = createPublicClient({
chain: arbitrumSepolia,
transport: http(),
});
// Read from contract
const result = await client.readContract({
address: "0x...",
abi: contractAbi,
functionName: "myFunction",
});See references/frontend-integration.md for full patterns with wagmi hooks, wallet connection, and write transactions.
Principles
- ā¢Always use viem for chain interaction.
- ā¢Test locally first against nitro-devnode before deploying to testnet.
- ā¢Export ABIs from both Stylus (
cargo stylus export-abi) and Solidity (forge inspect) and keep them in a shared location the frontend can import. - ā¢Use environment variables for RPC URLs, contract addresses, and private keys. Never hardcode secrets.
- ā¢Stylus contracts are EVM-compatible ā they share the same address space, storage model, and ABI encoding as Solidity contracts. Cross-contract calls work seamlessly.
References
Load these as needed for deeper guidance:
- ā¢
references/stylus-rust-contracts.mdā Stylus SDK patterns, storage, macros, entrypoints - ā¢
references/solidity-contracts.mdā Solidity on Arbitrum specifics and Foundry workflow - ā¢
references/frontend-integration.mdā React + viem + wagmi patterns - ā¢
references/local-devnode.mdā Nitro devnode setup, accounts, and debugging - ā¢
references/deployment.mdā Deploying to testnet and mainnet - ā¢
references/testing.mdā Testing strategies for both Stylus and Solidity
Install & Usage
mkdir -p .claude/skillsmkdir -p .claude/skills && curl -o .claude/skills/arbitrum-dapp-skill.md https://raw.githubusercontent.com/longtengsiha/arbitrum-dapp-skill/main/SKILL.md/arbitrum-dapp-skillSecurity Audits
Frequently Asked Questions
What is arbitrum-dapp-skill?
š Build and deploy decentralized applications on Arbitrum using Rust and Solidity with this practical guide and skill enhancement project.
How to install arbitrum-dapp-skill?
To install arbitrum-dapp-skill: create the skills directory (mkdir -p .claude/skills), then run: mkdir -p .claude/skills && curl -o .claude/skills/arbitrum-dapp-skill.md https://raw.githubusercontent.com/longtengsiha/arbitrum-dapp-skill/main/SKILL.md. Finally, /arbitrum-dapp-skill in Claude Code.
What is arbitrum-dapp-skill best for?
arbitrum-dapp-skill is a skill categorized under General. It is designed for: deployment, rust. Created by longtengsiha.