Module precompile_utils::precompile_set
source · Expand description
Provide utils to assemble precompiles and precompilesets into a final precompile set with security checks. All security checks are enabled by default and must be disabled explicely throught type annotations.
Structs§
- Precompile can be called using DELEGATECALL/CALLCODE.
- Precompiles are allowed to call this precompile.
- Wraps a stateless precompile: a type implementing the
Precompile
trait. Type parameters allow to define: - Wraps a tuple of
PrecompileSetFragment
to make a realPrecompileSet
. - Wraps an inner PrecompileSet with all its addresses starting with a common prefix. Type parameters allow to define:
- Wraps a precompileset fragment into a range, and will skip processing it if the address is out of the range.
- A precompile that was removed from a precompile set. Still considered a precompile but is inactive and always revert.
- Make a precompile that always revert. Can be useful when writing tests.
- Precompile is able to do subcalls with provided nesting limit.
Enums§
- The type of EVM address.
Traits§
- Allows to know if a precompile is active or not. This allows to detect deactivated precompile, that are still considered precompiles by the EVM but that will always revert when called.
- Trait representing checks that can be made on a precompile call. Types implementing this trait are made to be chained in a tuple.
- A fragment of a PrecompileSet. Should be implemented as is it was a PrecompileSet containing only the precompile(set) it wraps. They can be combined into a real PrecompileSet using
PrecompileSetBuilder
.
Functions§
- Retrieves the type of address demarcated by
AddressType
.