Rust → WASM → Arbitrum · 9 templates

Scaffold a Stylus project that deploys on the first try.

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.

14+ Built for the Stylus teams in this buildathon. At least 14 entries ship Rust/Stylus code, and they hand-built what these templates generate in one command: Solidity calling a Rust engine, 512-bit math, gas benchmarks, reproducible builds. See the evidence →
$ npm create stylus-latest my-app -- -t stream --with-client
$ npx create-stylus-latest pay -t escrow --usdg --network arbitrum-one
Try it in your browser: one click, nothing to install Opens a GitHub Codespace with Rust, cargo-stylus and a local Arbitrum chain ready. Run .devcontainer/quickstart.sh: a contract is deployed and called in about 105 s. No wallet, no faucet. Open in Codespaces →
Arbitrum Sepolia live Robinhood Chain testnet Paxos USDG on-chain verified AI-agent ready

On npm as create-stylus-latest, published from CI with provenance. Nothing to install first: npx fetches it.

9
contract templates, tested on a real node
147
on-chain MCP checks across all nine templates
17
CI jobs green on every change
20
on-chain checks: USDG, Chainlink feeds, RPCs

Why this, and not 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 newScaffold-Stylus (npx create-stylus)
FocusThe contract and its path to a live deploy: payments and AI agentsThe official minimal starterA full-stack dApp: Next.js frontend, wallet connect, contract hot reload
ContractsNine: counter, ERC-20, ERC-721, vault, escrow, payment stream, Chainlink oracle, Rust–Solidity interop, faucetA counterA sample contract; ERC-20, ERC-721 and Chainlink extensions
TestsUnit tests plus reference-model property tests; every template deployed to a Nitro node on every changeExample testsyarn stylus:test
AI agentsA JSON tool interface and an MCP server on every template: 147 on-chain checks––
Stablecoins, chainsPaxos USDG presets checked on-chain; Arbitrum One, Robinhood Chain and their testnets–Arbitrum Sepolia, mainnet, Orbit
Staying currentPins 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.

Run the AI agent demo

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.

Needs a wallet with a little Arbitrum Sepolia ETH and 10 BUIDL (free from the faucet). Your wallet asks 3 or 4 times; about a minute in all.

    Live on Arbitrum Sepolia

    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.

    Playground: move real (test) money

    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.

    1. Get test tokens

    A rate-limited faucet (the faucet template): one drip per address per cooldown.

    Your balance
    connect a wallet
    In the faucet
    –

    2. Stream a payment

    Locks the amount and pays the recipient continuously until the end.

    Amount in BUIDL · duration in seconds

    3. Escrow a deal

    Locks the amount for a seller; you release it, or take it back after the deadline.

    Amount in BUIDL · deadline in minutes

    4. Deposit into the vault

    Deposit and withdraw your own balance; the vault holds the tokens.

    Your activity

    1. Transactions you send from this page appear here, with links to Arbiscan.

    Replay: a longer agent run

    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.

    Loading the recorded run…
      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}'

      Stylus vs Solidity: measured gas

      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 gas
      Stylus72,299
      Solidity43,561
      increment2.1× more gas
      Stylus55,199
      Solidity26,461
      addNumber2.1× more gas
      Stylus55,360
      Solidity26,881
      setNumber2.1× more gas
      Stylus55,323
      Solidity26,596
      work(20000): pure compute loop31× less gas
      Stylus58,800
      Solidity1,821,893

      Both contracts return the same work(20000) result; the benchmark fails if they differ. CI run 36935538361 · method and caveats

      Deploy your own

      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

      Also live on Robinhood Chain testnet

      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.

      Counter

      Same address as the Arbitrum Sepolia counter because the same wallet made its first deployment on both chains. They are two separate contracts.

      0x41218640903eab654a555371d51d1c4fcfb28580

      increment() confirmed in block 127297404.

      Deploy run →

      ERC-20 token

      Set up by a constructor; the supply was minted to the deployer in the deployment itself.

      0xe1f6ff1f3efb2fb92846f97a2e4e017b311245b9

      Buildathon Token (BUIDL), 1,000,000 supply.

      Deploy run →

      Vault

      Constructed with the Robinhood ERC-20 as its asset.

      0x141ea9d975236de4cb3720115c04440008066de1

      asset() reads back as the ERC-20; deposits 0.

      Deploy run →

      What you get

      Always current

      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.

      Nine templates

      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.

      NFTs in Rust

      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.

      Agent-native

      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 that works

      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.

      Typed client

      --with-client adds a viem script that fails loudly on reverted transactions.

      USDG & Robinhood

      --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.

      Zero install

      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.

      Provenance

      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.

      Security & limitations

      Templates, not audited products. Here is what that means before real funds are involved.

      • Not audited. Tested hard (property tests against a model, deploys to a real Nitro node on every change), but get an independent review before holding real money.
      • No admin keys, no upgrades. The vault, escrow and stream have no owner, no pause and no proxy: a bug means a redeploy, not a patch.
      • Known gaps. Fee-on-transfer and rebasing tokens are not supported; the oracle does not check Arbitrum's sequencer-uptime feed; the faucet is not anti-sybil.
      • Agent limits are client-side. 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.
      • Mainnet is opt-in. deploy.sh refuses Arbitrum One, Nova and Robinhood Chain unless you set MAINNET=1.

      Per-template details and a pre-mainnet checklist: SECURITY.md.

      How it was verified

      1. Every template is built, tested and validated against a local Nitro node in CI, using live crates.io versions.
      2. An end-to-end CI job deploys a generated contract and calls it through the generated client.
      3. The same flow was then run against Arbitrum Sepolia, producing the contracts above.
      4. A Solidity contract calls the interop template's Rust library on a Nitro node, and catches its errors by name.
      5. A reproducible deploy is verified against its source, and a one-line change to that source must fail verification.
      6. The official MCP SDK client drives the MCP server of all nine templates against real contracts: 147 checks, covering streams, tokens and NFTs that move exactly as reported, payments priced through an oracle that refuses a stale or zero price, and spending limits that refuse with the CLI's exact JSON.

      These are templates, not audited contracts. Do not hold real funds in them.