pub enum Error {
NonceAlreadyUsed = 37_000,
AuthorizationExpired = 37_001,
AuthorizationNotYetValid = 37_002,
InvalidSignature = 37_003,
InvalidPublicKey = 37_004,
InvalidCaller = 37_005,
AuthorizationUsed = 37_006,
InvalidNonceLength = 37_007,
}Expand description
Errors raised by CEP-3009 authorization operations.
Variants§
NonceAlreadyUsed = 37_000
The (from, nonce) pair has already been consumed by a transfer or
burned by a cancel. Authorizations are single-use.
AuthorizationExpired = 37_001
The current block time is past valid_before — the authorization has
expired.
AuthorizationNotYetValid = 37_002
The current block time is at or before valid_after — the
authorization is not yet in its validity window.
InvalidSignature = 37_003
Signature verification against the supplied public key failed, or the
recomputed digest does not match what the signer signed (e.g. wrong
amount, to, or nonce).
InvalidPublicKey = 37_004
The supplied public_key does not hash to the declared from /
authorizer address. Guards against using a valid signature from a
different keypair to move someone else’s tokens or burn their nonce.
InvalidCaller = 37_005
receive_with_authorization was submitted by an account other than
to. See the module-level docs for why this restriction exists.
AuthorizationUsed = 37_006
Attempted to cancel an authorization whose (authorizer, nonce) pair
has already been consumed.
InvalidNonceLength = 37_007
The supplied nonce is not exactly 32 bytes. ERC-3009 nonces are
bytes32; the EIP-712 digest only covers 32 bytes, so accepting a
shorter or longer nonce would let an attacker craft length aliases
that share a digest (and thus a signature) while occupying distinct
replay-protection storage keys.
Trait Implementations§
Source§impl SchemaErrors for Error
Available on non-WebAssembly only.
impl SchemaErrors for Error
Auto Trait Implementations§
impl Freeze for Error
impl RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl UnsafeUnpin for Error
impl UnwindSafe for Error
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
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>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more