Crate precompile
Available on crate feature
evm only.Expand description
§revm-precompile
Implementations of EVM precompiled contracts.
Modules§
- blake2
- Blake2 precompile. More details in
run - bls12_
381 - BLS12-381 precompiles added in
EIP-2537For more details check modules for each precompile. - bls12_
381_ const - Constants specifying the precompile addresses for each precompile in EIP-2537
- bls12_
381_ utils - Utility functions for the BLS12-381 precompiles
- bn254
- BN254 precompiles added in
EIP-1962 - hash
- Hash precompiles, it contains SHA-256 and RIPEMD-160 hash precompiles
More details in
sha256_runandripemd160_run - identity
- Identity precompile returns
- interface
- Interface for the precompiles. It contains the precompile result type, the precompile output type, and the precompile error type.
- kzg_
point_ evaluation - KZG point evaluation precompile added in
EIP-4844For more details checkrunfunction. - modexp
- Modexp precompile added in
EIP-198and reprices in berlin hardfork withEIP-2565. - secp256k1
ecrecoverprecompile.- secp256r1
- RIP-7212 secp256r1 Precompile
- utilities
- Utility function that precompiles use, padding and converting between types.
Macros§
- eth_
precompile_ fn - Macro that generates a thin wrapper function converting a
PrecompileEthFninto aPrecompileFn.
Structs§
- Default
Crypto - Default implementation of the Crypto trait using the existing crypto libraries.
- EthPrecompile
Output - Simple precompile execution output used by individual Ethereum precompile functions.
- Precompile
- Precompile wrapper for simple eth function that provides complex interface on execution.
- Precompile
Output - Rich precompile execution output with gas accounting and status support.
- Precompiles
- Precompiles contain map of precompile addresses to functions and AddressSet of precompile addresses.
Enums§
- Precompile
Error - Fatal precompile error type.
- Precompile
Halt - Non-fatal halt reasons for precompiles.
- Precompile
Id - Precompile with address and function. Unique precompile identifier.
- Precompile
Spec Id - Ethereum hardfork spec ids. Represents the specs where precompiles had a change.
- Precompile
Status - Status of a precompile execution.
Traits§
- Crypto
- Crypto operations trait for precompiles.
Functions§
- calc_
linear_ cost - Calculate the linear cost of a precompile.
- calc_
linear_ cost_ u32 Deprecated - Calculate the linear cost of a precompile.
- call_
eth_ precompile - Calls a
PrecompileEthFnand wraps the result into aPrecompileOutput. - crypto
- Get the installed crypto provider, or the default if none is installed.
- install_
crypto - Install a custom crypto provider globally.
- u64_
to_ address - Const function for making an address by concatenating the bytes from two given numbers.
Type Aliases§
- EthPrecompile
Result - A precompile operation result type for individual Ethereum precompile functions.
- Precompile
EthFn - Eth precompile function type. Takes input and gas limit, returns an Eth precompile result.
- Precompile
Fn - Precompile function type. Takes input, gas limit and reservoir, returns a
PrecompileResult. - Precompile
Result - A precompile operation result type for the precompile provider.