Module revert

Source
Expand description

Utilities to work with revert messages with support for backtraces and consistent formatting.

Structs§

Backtrace
Backtrace of an revert. Built depth-first. Implement Display to render the backtrace as a string.
Revert
An revert returned by various functions in precompile-utils. Allows to dynamically construct the backtrace (backtrace) of the revert and manage it in a typed way. Can be transformed into a PrecompileFailure::Revert and String, and implement Display and Debug.

Enums§

RevertReason
Possible revert reasons.

Constants§

ERROR_SELECTOR
Generic error to build abi-encoded revert output. See: https://docs.soliditylang.org/en/latest/control-structures.html?highlight=revert#revert

Traits§

BacktraceExt
Additional function for everything having a Backtrace.
InjectBacktrace
Allows to inject backtrace data.
RevertExt
Additional functions for Revert and MayRevert.

Functions§

revert
Generate an encoded revert from a simple String. Returns a PrecompileFailure that fits in an EvmResult::Err.
revert_as_bytes
Generate an encoded revert from a simple String. Returns a Vec<u8> in case PrecompileFailure is too high level.

Type Aliases§

MayRevert
Represent the result of a computation that can revert.