Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

README.md

Solidity Calls Stylus Example

This example demonstrates how a standard Solidity smart contract can safely call methods on a Rust (Stylus) smart contract.

How to run

The deploy.sh script compiles and deploys both parts of the system.

What the script does:

  1. Checks for or Deploys the Stylus Counter contract.
  2. Compiles the Solidity Caller contract with the Stylus Counter's address in its constructor.
  3. Deploys the Solidity Caller contract.
  4. Tests the connection by triggering an update from the Solidity contract to the Stylus Counter.
  5. Creates a deployment.env file with all addresses and transaction hashes.

Prerequisites:

Make sure you have these installed:

  • solc (Solidity compiler)
  • cast (from Foundry)
  • cargo stylus tool (Installation guide)
  • soldb (walnuthq/soldb) for tracing interop contracts. Start it by running soldb bridge in a separate terminal.

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:

From your terminal inside this folder, run:

chmod +x deploy.sh
./deploy.sh

Once done, check out deployment.env for the generated addresses.