Enum precompile_utils::solidity::revert::RevertReason
source · #[non_exhaustive]pub enum RevertReason {
Custom(String),
ReadOutOfBounds {
what: String,
},
UnknownSelector,
ValueIsTooLarge {
what: String,
},
PointerToOutofBound,
CursorOverflow,
ExpectedAtLeastNArguments(usize),
}
Expand description
Possible revert reasons.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Custom(String)
A custom revert reason if other variants are not appropriate.
ReadOutOfBounds
Tried to read data out of bounds.
UnknownSelector
An unknown selector has been provided.
ValueIsTooLarge
A value is too large to fit in the wanted type.
For security reasons integers are always parsed as uint256
then
casted to the wanted type. If the value overflows this type then this
revert is used.
PointerToOutofBound
A pointer (used for structs and arrays) points out of bounds.
CursorOverflow
The reading cursor overflowed. This should realistically never happen as it would require an input of length larger than 2^64, which would cost too much to be included in a block.
ExpectedAtLeastNArguments(usize)
Used by a check that the input contains at least N static arguments. Often use to return early if the input is too short.
Implementations§
source§impl RevertReason
impl RevertReason
sourcepub fn custom(s: impl Into<String>) -> Self
pub fn custom(s: impl Into<String>) -> Self
Create a RevertReason::Custom
from anything that can be converted to a String
.
Argument is the custom revert message.
sourcepub fn read_out_of_bounds(what: impl Into<String>) -> Self
pub fn read_out_of_bounds(what: impl Into<String>) -> Self
Create a RevertReason::ReadOutOfBounds
from anything that can be converted to a String
.
Argument names what was expected to be read.
sourcepub fn value_is_too_large(what: impl Into<String>) -> Self
pub fn value_is_too_large(what: impl Into<String>) -> Self
Create a RevertReason::ValueIsTooLarge
from anything that can be converted to a String
.
Argument names what was expected to be read.
Trait Implementations§
source§impl Display for RevertReason
impl Display for RevertReason
source§impl From<RevertReason> for PrecompileFailure
impl From<RevertReason> for PrecompileFailure
source§fn from(err: RevertReason) -> Self
fn from(err: RevertReason) -> Self
source§impl From<RevertReason> for Revert
impl From<RevertReason> for Revert
source§fn from(a: RevertReason) -> Revert
fn from(a: RevertReason) -> Revert
source§impl InjectBacktrace for RevertReason
impl InjectBacktrace for RevertReason
source§impl PartialEq for RevertReason
impl PartialEq for RevertReason
source§fn eq(&self, other: &RevertReason) -> bool
fn eq(&self, other: &RevertReason) -> bool
self
and other
values to be equal, and is used
by ==
.impl Eq for RevertReason
impl StructuralEq for RevertReason
impl StructuralPartialEq for RevertReason
Auto Trait Implementations§
impl RefUnwindSafe for RevertReason
impl Send for RevertReason
impl Sync for RevertReason
impl Unpin for RevertReason
impl UnwindSafe for RevertReason
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> CheckedConversion for T
impl<T> CheckedConversion for T
§fn checked_from<T>(t: T) -> Option<Self>where
Self: TryFrom<T>,
fn checked_from<T>(t: T) -> Option<Self>where
Self: TryFrom<T>,
§fn checked_into<T>(self) -> Option<T>where
Self: TryInto<T>,
fn checked_into<T>(self) -> Option<T>where
Self: TryInto<T>,
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> IsType<T> for T
impl<T> IsType<T> for T
§impl<T, Outer> IsWrappedBy<Outer> for T
impl<T, Outer> IsWrappedBy<Outer> for T
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> SaturatedConversion for T
impl<T> SaturatedConversion for T
§fn saturated_from<T>(t: T) -> Selfwhere
Self: UniqueSaturatedFrom<T>,
fn saturated_from<T>(t: T) -> Selfwhere
Self: UniqueSaturatedFrom<T>,
§fn saturated_into<T>(self) -> Twhere
Self: UniqueSaturatedInto<T>,
fn saturated_into<T>(self) -> Twhere
Self: UniqueSaturatedInto<T>,
T
. Read more§impl<T, U> TryIntoKey<U> for Twhere
U: TryFromKey<T>,
impl<T, U> TryIntoKey<U> for Twhere
U: TryFromKey<T>,
type Error = <U as TryFromKey<T>>::Error
fn try_into_key(self) -> Result<U, <U as TryFromKey<T>>::Error>
§impl<S, T> UncheckedInto<T> for Swhere
T: UncheckedFrom<S>,
impl<S, T> UncheckedInto<T> for Swhere
T: UncheckedFrom<S>,
§fn unchecked_into(self) -> T
fn unchecked_into(self) -> T
unchecked_from
.§impl<T, S> UniqueSaturatedInto<T> for S
impl<T, S> UniqueSaturatedInto<T> for S
§fn unique_saturated_into(self) -> T
fn unique_saturated_into(self) -> T
T
.