Skip to content

Latest commit

 

History

History
46 lines (30 loc) · 2.22 KB

File metadata and controls

46 lines (30 loc) · 2.22 KB

Stylus Examples

This repository contains a collection of simple Arbitrum Stylus smart contract examples written in Rust. They demonstrate how to build various systems, from basic counters to complex cross-contract logic with Solidity.

Provided Examples

How to run

Each example folder comes with its own deploy.sh script that automates the deployment process. Generally, you can navigate into any folder and run:

chmod +x deploy.sh
./deploy.sh

Prerequisites

For running the deployment scripts and tracing, make sure you have the following installed:

  1. solc (Solidity Compiler)
  2. cast and forge (Foundry tools)
  3. cargo stylus (Installation guide)

Running a local node

The examples require a local Nitro dev node running on http://localhost:8547. Start one using Docker:

docker run -it --rm --name nitro-dev -p 8547:8547 offchainlabs/nitro-node:v3.9.5-rc.2-762ee40 --dev --http.addr 0.0.0.0 --http.api=net,web3,eth,arb,arbdebug,debug

Interoperability Examples (Stylus + Solidity)

For examples that demonstrate interoperability between Stylus and Solidity contracts (e.g., stylus-deep-logic, stylus-calls-solidity, solidity-calls-stylus, auction-with-stylus-token), you will also need to run soldb.

  • Repository: walnuthq/soldb
  • Start the bridge by running soldb bridge in a separate terminal before executing your tests or traces.

Explore each subfolder's README.md for more details!