Stylus projects fail before their first deploy. One command fixes it: nine tested Rust templates, agent-ready from day one.
Pinned to the newest stylus-sdk and its matching alloy, with deploy scripts already run on a live network.
$ npm create stylus-latest my-app -- -t stream --with-client $ npx create-stylus-latest pay -t escrow --usdg --network arbitrum-one
.devcontainer/quickstart.sh: a contract is deployed and called in about 105 s. No wallet, no faucet.
Open in Codespaces →
On npm as create-stylus-latest, published from CI with provenance. Nothing to install first: npx fetches it.
cargo stylus new or Scaffold-Stylus?The official starter gives you a counter. Scaffold-Stylus gives you a frontend. This gives you contracts that move money correctly, the path to deploy them, and an interface an AI agent can drive.
| create-stylus-latest ✦ | cargo stylus new | Scaffold-Stylus (npx create-stylus) | |
|---|---|---|---|
| Focus | The contract and its path to a live deploy: payments and AI agents | The official minimal starter | A full-stack dApp: Next.js frontend, wallet connect, contract hot reload |
| Contracts | Nine: counter, ERC-20, ERC-721, vault, escrow, payment stream, Chainlink oracle, Rust–Solidity interop, faucet | A counter | A sample contract; ERC-20, ERC-721 and Chainlink extensions |
| Tests | Unit tests plus reference-model property tests; every template deployed to a Nitro node on every change | Example tests | yarn stylus:test |
| AI agents | A JSON tool interface and an MCP server on every template: 147 on-chain checks | – | – |
| Stablecoins, chains | Paxos USDG presets checked on-chain; Arbitrum One, Robinhood Chain and their testnets | – | Arbitrum Sepolia, mainnet, Orbit |
| Staying current | Pins the newest stylus-sdk at scaffold time, and CI re-checks every template against crates.io weekly | – | – |
Swipe the table to compare with cargo stylus new and Scaffold-Stylus →
They combine: pick Scaffold-Stylus for a ready-made frontend, and these contracts when the money has to move correctly. They are plain Stylus projects that any frontend can call.
The stream template ships a JSON tool interface for AI agents. Press the button and its three tool calls run for real from your wallet on Arbitrum Sepolia: open a stream of 10 test BUIDL, pay out what has been earned after a few seconds, then cancel and split the rest. Under each call is the exact JSON the agent gets back, with the transaction on Arbiscan. The page runs a port of the agent's own code, and CI checks every result against the agent CLI's output, field by field.
Three contracts scaffolded by this tool and deployed with its own scripts. The token and the vault are initialized by constructors at deploy time, so nobody can race the deployer. The values below are read from the chain in your browser right now. Connect a wallet to send a real transaction yourself.
You need a little free Arbitrum Sepolia test ETH. Faucets are listed on the Buildathon page. Test network only; no real funds.
The stream, escrow and vault templates above, live on Arbitrum Sepolia and usable from here with your own wallet. Get test BUIDL from the faucet, then open a payment stream and watch it pay out second by second, lock funds in an escrow and release or reclaim them, or park them in the vault. Every button is one real transaction; the page approves exactly the amount needed, never more. Test network only.
A rate-limited faucet (the faucet template): one drip per address per cooldown.
Locks the amount and pays the recipient continuously until the end.
Amount in BUIDL · duration in seconds
Locks the amount for a seller; you release it, or take it back after the deadline.
Amount in BUIDL · deadline in minutes
Deposit and withdraw your own balance; the vault holds the tokens.
No wallet needed. All nine templates ship a JSON tool interface and an MCP server that an AI agent can call. This is a real run of it on a local Arbitrum node, recorded in CI and replayed: each tool call the agent sent and the result it got back. The overspend and the early refund were refused before anything was signed, by limits the operator set and permission checks the contract answers.
cd my-stream/client && npx tsx --env-file=../.env src/agent-cli.ts --tools # hand these to your LLM
npx tsx --env-file=../.env src/agent-cli.ts '{"intent":"open_stream","recipient":"0x…","amountTokens":"25","durationSeconds":3600}'
The counter template and a line-for-line Solidity twin, deployed to the same Arbitrum Nitro node and sent
identical transactions. Execution gas from the receipts (gasUsed − gasUsedForL1), uncached. Stylus pays a
fixed cost to enter WASM, so plain storage calls cost about 2× more; real computation costs about 31× less. Pick it for
compute-heavy logic, not as a free win everywhere.
increment (0 → 1)1.7× more gasincrement2.1× more gasaddNumber2.1× more gassetNumber2.1× more gaswork(20000): pure compute loop31× less gasBoth contracts return the same work(20000) result; the benchmark fails if they differ.
CI run 36935538361 ·
method and caveats
Every contract above came out of one command. Scaffold the same thing, try it on a free local node, then deploy it.
npx create-stylus-latest my-stream -t stream --with-client cd my-stream && cargo test # unit + property tests cp .env.example .env && ./scripts/devnode.sh # local Nitro node, funded key, Stylus deployer RPC_URL=http://127.0.0.1:8547 ./scripts/deploy.sh -- 0xYourTokenAddress
The same three templates, deployed with the same scripts to Robinhood Chain testnet (chain id 46630). This section is static: the only RPC endpoint we have contains a private API key, so the page cannot read this chain live. Each card links to the public deploy run, which shows the address, the activation and the contract being read back.
Same address as the Arbitrum Sepolia counter because the same wallet made its first deployment on both chains. They are two separate contracts.
increment() confirmed in block 127297404.
Set up by a constructor; the supply was minted to the deployer in the deployment itself.
Buildathon Token (BUIDL), 1,000,000 supply.
Constructed with the Robinhood ERC-20 as its asset.
asset() reads back as the ERC-20; deposits 0.
Reads the crates.io index at scaffold time and pins the newest stable SDK with the exact alloy version it needs. Works offline with a known-good fallback.
counter, erc20, erc721, vault, escrow, stream, oracle (Chainlink), interop (Solidity calling Rust) and faucet. Every one except the counter has unit tests and a property test: every token movement against a reference model, every price against the oracle rules, every mulDiv against its 512-bit definition.
The erc721 template: metadata through tokenURI, safe transfers that ask a receiving contract first, a minter, burn, and the standard ERC-6093 errors, in about 20 KB of WASM (the limit is 24 KB). A property test checks every mint, approval, transfer and burn against a model. Its agent tools mint and send NFTs, and refuse a send that would lock the token in a contract.
All nine templates ship a JSON tool interface an AI agent can call, with spending limits enforced before signing and the contract's own error names in every failure. The same tools are an MCP server, so Claude Desktop, Claude Code or Cursor can use the contract directly.
deploy.sh handles the lockfile, RPC override, gas cap and key hand-off. devnode.sh starts a local Nitro node for free validation. VERIFY=1 deploys reproducibly, and verify.sh proves the deployed code is your source.
--with-client adds a viem script that fails loudly on reverted transactions.
--usdg wires vault, escrow and stream to Paxos USDG; --network targets Arbitrum or Robinhood Chain. Addresses checked on-chain in CI; mainnet deploys need MAINNET=1.
One click opens a Codespace with Rust, cargo-stylus and Docker ready; quickstart.sh deploys and calls a contract on a local Arbitrum chain in about 105 s. CI builds that container and times it.
Every npm release is published by CI with a signed provenance statement, so anyone can check which commit and workflow built the package they run with npx.
Templates, not audited products. Here is what that means before real funds are involved.
AGENT_MAX_AMOUNT and the allow-list stop a model from overspending, not someone holding the key. Give an agent a dedicated key with only what it may spend.deploy.sh refuses Arbitrum One, Nova and Robinhood Chain unless you set MAINNET=1.Per-template details and a pre-mainnet checklist: SECURITY.md.
interop template's Rust library on a Nitro node, and catches its errors by name.These are templates, not audited contracts. Do not hold real funds in them.