Module 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 through type annotations.

Structs§

AcceptDelegateCall
Precompile can be called using DELEGATECALL/CALLCODE.
AddressU64
CallableByContract
CallableByPrecompile
Precompiles are allowed to call this precompile.
ForAllSelectors
OnlyFrom
PrecompileAt
Wraps a stateless precompile: a type implementing the Precompile trait. Type parameters allow to define:
PrecompileCheckSummary
PrecompileSetBuilder
Wraps a tuple of PrecompileSetFragment to make a real PrecompileSet.
PrecompileSetStartingWith
Wraps an inner PrecompileSet with all its addresses starting with a common prefix. Type parameters allow to define:
PrecompilesInRangeInclusive
Wraps a precompileset fragment into a range, and will skip processing it if the address is out of the range.
RemovedPrecompileAt
A precompile that was removed from a precompile set. Still considered a precompile but is inactive and always revert.
RemovedPrecompilesAt
Precompiles that were removed from a precompile set. Still considered precompiles but are inactive and always revert.
RestrictiveHandle
RevertPrecompile
Make a precompile that always revert. Can be useful when writing tests.
SubcallWithMaxNesting
Precompile is able to do subcalls with provided nesting limit.

Enums§

AddressType
The type of EVM address.
DiscriminantResult
PrecompileKind

Traits§

IsActivePrecompile
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.
PrecompileChecks
Trait representing checks that can be made on a precompile call. Types implementing this trait are made to be chained in a tuple.
PrecompileSetFragment
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.
SelectorFilter

Functions§

get_address_type
Retrieves the type of address demarcated by AddressType.
is_precompile_or_fail