Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Detect calls to Precompiled Contracts #10

Open
acuarica opened this issue Apr 10, 2023 · 0 comments
Open

Detect calls to Precompiled Contracts #10

acuarica opened this issue Apr 10, 2023 · 0 comments
Labels
feature New feature or request
Milestone

Comments

@acuarica
Copy link
Owner

acuarica commented Apr 10, 2023

The Yellow Paper defines[1] a set of precompiled contracts when sending messages to a set of predefined addresses

these are so-called ‘precompiled’ contracts, meant as a preliminary piece of architecture that may later become native extensions. The contracts in addresses 1 to 9 execute the elliptic curve public key recovery function, the SHA2 256-bit hash scheme, the RIPEMD 160-bit hash scheme, the identity function, arbitrary precision modular exponentiation, elliptic curve addition, elliptic curve scalar multiplication, an elliptic curve pairing check, and the BLAKE2 compression function F respectively.

Detect whether there is a call to any of these contracts and use symbols to represents these calls.

See [2,3] for a definition of these precompiled contracts, their inputs and outputs.
Moreover, to see Geth's implementation, check[4,5].


[1] https://ethereum.github.io/yellowpaper/paper.pdf#section.8
[2] https://ethereum.github.io/yellowpaper/paper.pdf Appendix E. Precompiled Contracts
[3] https://www.evm.codes/precompiled?fork=merge
[4] https://github.com/ethereum/go-ethereum/blob/v1.10.18/core/vm/contracts.go#L45-L93
[5] https://github.com/ethereum/go-ethereum/blob/v1.10.18/core/vm/evm.go#L214-L231

@acuarica acuarica added the feature New feature or request label Apr 10, 2023
@acuarica acuarica changed the title Add support for Precompiled Contracts Detect calls to Precompiled Contracts Apr 10, 2023
@acuarica acuarica added this to the Stage 2 milestone Apr 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
Status: Todo
Development

No branches or pull requests

1 participant