Skip to content

Commit

Permalink
Add your own precompiles guide (#152)
Browse files Browse the repository at this point in the history
  • Loading branch information
mationorato authored Oct 4, 2023
1 parent b23a364 commit 228e0e3
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions precompiles/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# How to add and test your own precompile

> **DISCLAIMER**: This guide assumes you’re developing in the `zksync_era_precompiles` repo, if not, step one should be done differently.

1. Create a file in `precompiles/`.
2. Add the precompile name to the refresh precompiles script in the `era-test-node` submodule `submodules/era-test-node/scripts/refresh_precompiles.sh`
3. Wiring the precompile to the node
1. Assign an address to it in `submodules/era-test-node/src/deps/system_contracts.rs`.
2. Add it to the `yul_contracts` array inside `COMPILED_IN_SYSTEM_CONTRACTS` in `submodules/era-test-node/src/deps/system_contracts.rs`.
4. Now, running `make run` should run the node with your added precompile.

0 comments on commit 228e0e3

Please sign in to comment.