pub enum Cis2Error<R> {
    InvalidTokenId,
    InsufficientFunds,
    Unauthorized,
    Custom(R),
}
Expand description

The different errors the contract can produce.

Variants

InvalidTokenId

Invalid token id (Error code: -42000001).

InsufficientFunds

The balance of the token owner is insufficient for the transfer (Error code: -42000002).

Unauthorized

Sender is unauthorized to call this function (Error code: -42000003).

Custom(R)

Custom error

Trait Implementations

Formats the value using the given formatter. Read more

Converts the error by wrapping it in Self::Custom.

Convert Cis2Error into a reject with error code:

  • InvalidTokenId: -42000001
  • InsufficientFunds: -42000002
  • Unauthorized: -42000003
  • Custom: The error code of R.

Also serializes the Cis2Error and adds it as the return value.

Converts to this type from the input type.

Converts the error by wrapping it in Self::Custom.

Converts the error by wrapping it in Self::Custom.

Converts the error by wrapping it in Self::Custom.

Converts the error by wrapping it in Self::Custom.

Converts the error by wrapping it in Self::Custom.

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more

Attempt to write the structure into the provided writer, failing if only part of the structure could be written. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.