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.
- Host: GitHub
- URL: https://github.com/d3portillo/arbitrum-stylus-starter-c
- Owner: D3Portillo
- Created: 2024-11-29T23:50:40.000Z (5 months ago)
- Default Branch: master
- Last Pushed: 2024-12-21T13:06:31.000Z (4 months ago)
- Last Synced: 2025-04-01T23:55:29.030Z (22 days ago)
- Topics: arbitrum, starter, stylus
- Language: TypeScript
- Homepage:
- Size: 408 KB
- Stars: 12
- Watchers: 2
- Forks: 30
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Arbitrum Stylus Starter Template for C
[](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 🚀🚀)---

> [!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)