Setting Up Arbitrum Stylus

Setting Up the Arbitrum Stylus Environment

To start developing with Arbitrum Stylus, follow these steps to set up your environment properly:

Prerequisites

  1. Rust Toolchain

  2. VS Code

    • Download and install Visual Studio Code.

    • Recommended extensions for Rust development:

      • rust-analyzer

      • Error Lens

      • Even Better TOML

      • crates

Setting Up Arbitrum Stylus

  1. Install Cargo Stylus

    • Install the cargo-stylus and cargo-stylus-check tools:

      cargo install --force cargo-stylus cargo-stylus-check
  2. Add WASM Target

    • Add WebAssembly as a build target for your Rust compiler:

      rustup target add wasm32-unknown-unknown
  3. Cargo Stylus Commands

    • Verify the installation and see the available commands:

      cargo stylus --help
    • Available commands include:

      • new: Create a new Rust project

      • export-abi: Export a Solidity ABI

      • check: Check a contract

      • deploy: Deploy a contract

      • replay: Replay a transaction in gdb

      • trace: Trace a transaction

      • c-gen: Generate C code

      • help: Print help

Developer Wallet / Account

  1. Create a Developer Wallet

    • Use MetaMask or another wallet service to create a fresh account for development purposes.

    • Avoid using personal accounts with real assets.

  2. Obtain the Private Key

    • For MetaMask, follow the instructions to export your private key.

CAUTION: Never share your “secret recovery phrase” with anyone. A private key is valid for an individual account only, but a secret recovery phrase can be used to gain access to ALL accounts in your wallet.

Acquiring Testnet ETH

  1. BwareLabs Faucet

Summary

By following these steps, you will have your environment set up for developing and deploying Rust smart contracts on Arbitrum Stylus. Ensure you have the Rust toolchain, configure your development environment with VS Code, install the necessary cargo-stylus tools, set up a developer wallet, and acquire testnet ETH for testing your contracts.

Last updated