Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

README.md

Stylus Counter Example

This is a very simple Rust (Stylus) smart contract that acts as a counter. It can store a number and increase it.

How to run

Use the deploy.sh script to quickly deploy and test the contract.

What the script does:

  1. Builds and deploys the Stylus Counter contract.
  2. Sends a test transaction to increment the counter.
  3. Creates a deployment.env file with the counter address and test transaction hash.

Prerequisites:

Make sure you have these installed:

Nitro Dev Node: A local Nitro node is required. Start it 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

Running the deployment:

Open your terminal in this folder and run:

chmod +x deploy.sh
./deploy.sh

When it finishes, look for the deployment.env file. The script also shows instructions on how to call the counter yourself.