Skip to content

Instantly share code, notes, and snippets.

@glihm
glihm / keccak_rust_eth.md
Last active July 4, 2023 16:09
Keccak rust / ethereum

I am trying to pre-compute a keccak hash in a rust library, to then send it to Ethereum where it must match the re-computed hash in solidity.

However, I have a strange behavior.

The data to hash:

function testConsumeMessageFromL2(uint256 fromAddress, uint256[] calldata payload)
    external
@glihm
glihm / cairo_long_string.md
Last active November 29, 2023 10:47
Cairo LongString impl with examples of useful Cairo traits impl

LongString opiniated implementation

The long string implementation in cairo will be present in the compiler itself. Can be tracked here: https://github.com/orgs/starkware-libs/projects/1/views/1

But waiting for this to come, here is a demo implementation of how long string can work.

This implementation is not exhaustive, and not heavily tested. However, you can find some useful implementation of some traits

@glihm
glihm / sharingan_starter_pack.md
Last active June 8, 2023 14:34
Sharingan starter pack

Sharingan starter pack

Madara

Madara is a Starknet sequencer. Written using rust and substrate (a SDK to build blockchain), Madara is a community driven sequencer supported by Starkware Keep-Starknet-Strange team which is expected to be one of the major sequencers participating in the Starknet decentralization.

If you don't know Madara, take a look at the repository and the contributor starter pack to have an idea of how it is built.

@glihm
glihm / beerus-dockerize.md
Last active April 23, 2023 05:18
Beerus dockerize

Beerus dockerize

Dockerfile

Dockerfile must be placed at the root of beerus project.

FROM rust:1.69 as builder

WORKDIR /beerus
@glihm
glihm / madara-test-errors.md
Created April 20, 2023 02:43
Madara test errors

I have this error after doing:

  1. cd tests
  2. npm install
  3. npm run test-seq

> ts-tests@1.0.0 test-seq
> mocha -r ts-node/register 'tests/**/test-*.ts'
@glihm
glihm / docker-development-cairo.md
Last active February 25, 2024 17:42
Docker for Cairo development

Docker for Cairo development

Cairo is the language used by Starknet to write smart contracts. Lately, the version was switched from Cairo 0 to Cairo 1, where the syntax has changed but the tooling is also evolving.

Moreover, the reference implementations of Starknet are migrating from python to rust. Cairo lang will soon be replaced by starknet-rs used by starkli. But until those tools become 100% functional, we need to compile Cairo 1 code, and use el cli of cairo-lang to deploy contracts on-chain.

@glihm
glihm / docker-desarrollo-cairo.md
Created April 12, 2023 06:36
Docker para desarrollo de Cairo

Docker para el desarrollo de Cairo

Cairo es el lenguaje utilizado en Starknet para escribir contratos. Últimamente, la versión de Cairo pasó de Cairo 0 a Cairo 1, lo cuál implica un cambio de sintaxis pero también las herramientas de desarrollo.

Además, la implementación de referencia esta migrando de python a rust. Cairo lang serà en los próximos meses reemplazado por starknet-rs implementado en starkli. Pero hasta que esto sea hecho, necesitamos poder compilar Cairo 1, y utilisar el cli de cairo-lang para desplegar el código compilado

@glihm
glihm / madara_rpc_contrib.md
Last active April 12, 2023 17:09
Madara: how to dive in RPC contribution

Madara RPC contribution (for new contributors)

This file is intented for very new contributor (as I am) to onboard on the madara project, the sequencer of Starknet.

At the last community call, a special accent was put on RPC contributions to make madara quickly featured to be queried as a fullnode.

Here is a little guide to quickly dive into madara project, focused on RPC.

@glihm
glihm / 0xtitans_23.md
Last active April 11, 2023 14:31
The battle of titans 2023

The battle of titans 2023

As a new dev in web3, here are some quick notes about 0xTitans 2023 challenge.

Setup for training:

Lot's of information are given in the official notion.

  1. Foundry installation