Zig Stylus is an Arbitrum Stylus SDK for the Zig programming language, designed for writing WebAssembly (WASM) smart contracts. It offers a concise and minimal syntax for those who prefer not to use Rust, providing an alternative for developing Zig smart contracts on the Arbitrum Stylus platform.
Note: This library is still in development and not mature enough for production use.
-
Install Cargo Stylus CLI:
cargo install cargo-stylus
-
Install Foundary Cast for calling deployed contracts:
curl -L https://foundry.paradigm.xyz | bash
-
Clone the Repository
git clone https://github.com/Stylish-Stylus/zig-stylus.git cd zig-stylus
-
Build your Contract
zig build-lib ./src/main.zig -target wasm32-freestanding -dynamic --export=user_entrypoint -OReleaseSmall
-
Check Deployment Compatibility
cargo stylus check --wasm-file-path main.wasm
-
Deploy to Arbitrum Stylus
cargo stylus deploy --wasm-file-path chainid.wasm --private-key <private-key>
-
Call Contract Entry Point
./cast call --rpc-url 'https://stylus-testnet.arbitrum.io/rpc' <contract-id> <input>