No description
  • Cairo 58.6%
  • Rust 26%
  • Python 12.7%
  • Shell 2.4%
  • Makefile 0.3%
Find a file
lakewik 5b31a23c37 Revert "Upgrade to newer deps"
This reverts commit 52743de2df.
2025-11-07 14:38:48 +01:00
.github tests in CI 2024-10-22 09:58:55 +02:00
cairo_vm_hints Revert "Upgrade to newer deps" 2025-11-07 14:38:48 +01:00
lib typos and clippy 2025-07-08 10:41:55 +02:00
tests typos and clippy 2025-07-08 10:41:55 +02:00
tools typos and clippy 2025-07-08 10:41:55 +02:00
.gitignore working tests scheme 2024-10-22 09:08:10 +02:00
.nvmrc Squash 2023-10-31 21:32:25 +00:00
Cargo.lock cairovm version update 2025-03-20 10:43:52 +01:00
Cargo.toml Revert "Upgrade to newer deps" 2025-11-07 14:38:48 +01:00
LICENSE Update LICENSE 2024-04-23 16:24:29 +02:00
Makefile feat: add cairo eval + make command 2024-04-25 17:04:56 +02:00
README.md chore: update readme and tep disable CI cache 2024-04-23 15:48:05 +02:00
rustfmt.toml fmt config 2025-01-06 19:07:53 +01:00

EVM Libs Cairo

This repository contains a variety of cairo0 functions, useful when dealing with EVM related tasks. The repo contains the following:

  • MPT (Merkle Patricia Trie): verify_mpt_proof verifies a Merkle Patricia Trie proof and returns the value if valid
  • RLP (Recursive Length Prefix): contains a variety of different functions when dealing with RLP encoded data
  • MMR (Merkle Mountain Range): useful stuff for working with MMRs
  • Headers: functions for extracting header params from an rlp encoded EVM header

Please be sure to explore the lib directory, as the functions are well documented and should be easy to understand.

Import Package

As these functions are written in cairo0, we rely on git submodules for using this package. Install this repo as a submodule in your project.

E.g. like this:

[submodule "packages/eth_essentials"]
  path = packages/eth_essentials
  url = https://github.com/HerodotusDev/eth_essentials.git

When compiling your program, it is important to set the CAIRO_PATH environment variable to the path of the eth_essentials directory. This is necessary for the compiler to find the imported functions. For the example above, this would look like this: cairo-compile --cairo_path="packages/eth_essentials" ...

Now the functions can be imported like this:

from packages.eth-essentials.lib.utils import pow2alloc128

Testing

Please ensure to expose a valid Ethereum mainnet RPC via an ENV variable RPC_URL_MAINNET before running the tests.

make ci-local