An open API service indexing awesome lists of open source software.

https://github.com/d3portillo/arbitrum-stylus-starter-c

An starter project to write Smart Contracts using Arbitrum Stylus https://arbitrum.io/stylus SDK in C Lang.
https://github.com/d3portillo/arbitrum-stylus-starter-c

arbitrum starter stylus

Last synced: 14 days ago
JSON representation

An starter project to write Smart Contracts using Arbitrum Stylus https://arbitrum.io/stylus SDK in C Lang.

Awesome Lists containing this project

README

        

# Arbitrum Stylus Starter Template for C

[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2FD3Portillo%2Farbitrum-stylus-starter-c&project-name=arbitrum-starter-c-frontend&repository-name=arbitrum-stylus-starter-c&root-directory=frontend)

---

## Requisitos

- Brew (Mac) / Chocolatey (Windows)
- Docker (Docker Desktop)
- rust, cargo y rustup
- LLVM (con wasm-ld): Disponible desde la versión 15 (`llvm@15`)

## Verificar si tenemos `wasm-strip` instalado

Si no, podemos instalarlo con `brew install wabt`

## Instalando Cargo Stylus

- fork / git clone de este repositorio
- `git submodule update --init --recursive`
- `cargo install cargo-stylus`
- `rustup target add wasm32-unknown-unknown` (**opcional**, solventa un error de target wasm32 not found al hacer make)

## Validar entorno de desarollo

- `make` para generar el archivo contract.wasm
- `cargo stylus check --wasm-file ./contract.wasm -e https://sepolia-rollup.arbitrum.io/rpc` (si tenemos output en verde estamos listos 🚀🚀)

---

![](./reference.png)

> [!TIP]
> Cuando veamos este error significa que no hemos inicializado los modulos de git. Lo solventamos haciendo `git submodule update --init --recursive`

---

## Notas para el desarrollador

### Register and Storage Slots

Storage slots are pretty similar to registers in 32bit architectures.
Since both have:

1. Fixed Size: Storage slots in Ethereum can hold exactly 32 bytes. Similar to how registers have a fixed size in assembly (e.g., 32-bit, 64-bit).

2. Direct Addressing: Just as you access a specific register by its identifier (eax, r1), you access storage slots using their indexes: 0x01, 0x02.

3. Explicit Management: Like assembly programming, developers must explicitly manage how storage slots are allocated and used. Miss assignment of memory/slots can cause data corruption.

Leer más [A gentle introduction: Stylus](https://docs.arbitrum.io/stylus/gentle-introduction)