pub struct Erc721Base {
    pub balances: Mapping<Address, U256>,
    pub owners: Mapping<U256, Option<Address>>,
    pub token_approvals: Mapping<U256, Option<Address>>,
    pub operator_approvals: Mapping<(Address, Address), bool>,
}
Expand description

The ERC721 base implementation.

Fields§

§balances: Mapping<Address, U256>§owners: Mapping<U256, Option<Address>>§token_approvals: Mapping<U256, Option<Address>>§operator_approvals: Mapping<(Address, Address), bool>

Implementations§

source§

impl Erc721Base

source

pub fn is_approved_or_owner(&self, spender: &Address, token_id: &U256) -> bool

Returns true if the spender is the owner or an operator of the token_id token.

source

pub fn clear_approval(&mut self, token_id: &U256)

Revokes permission to transfer the token_id token.

source

pub fn exists(&self, token_id: &U256) -> bool

Returns true if the token_id token exists.

source

pub fn assert_exists(&self, token_id: &U256)

Reverts with Error::InvalidTokenId if the token_id token does not exist.

Trait Implementations§

source§

impl Clone for Erc721Base

source§

fn clone(&self) -> Erc721Base

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl DynamicInstance for Erc721Base

source§

fn instance(namespace: &[u8]) -> Self

source§

impl Erc721 for Erc721Base

source§

fn balance_of(&self, owner: &Address) -> U256

Returns the amount of tokens owned by owner.
source§

fn owner_of(&self, token_id: &U256) -> Address

Returns the owner of the token_id token. Read more
source§

fn safe_transfer_from(&mut self, from: &Address, to: &Address, token_id: &U256)

Safely transfers token_id token from from to to, checking the recipient contract uses Erc721Receiver. Read more
source§

fn safe_transfer_from_with_data( &mut self, from: &Address, to: &Address, token_id: &U256, data: &Bytes )

Safely transfers token_id token from from to to, checking the recipient contract uses Erc721Receiver, passes additional data. Read more
source§

fn transfer_from(&mut self, from: &Address, to: &Address, token_id: &U256)

source§

fn approve(&mut self, approved: &Option<Address>, token_id: &U256)

Grants permission to approved to transfer token_id token. The approval is cleared when the token is transferred. Read more
source§

fn set_approval_for_all(&mut self, operator: &Address, approved: bool)

Approves or removes operator for the caller. Operators can call transfer_from or safe_transfer_from for all tokens owned by the caller. Read more
source§

fn get_approved(&self, token_id: &U256) -> Option<Address>

Returns the address approved for token_id token. Read more
source§

fn is_approved_for_all(&self, owner: &Address, operator: &Address) -> bool

Returns if the operator is allowed to manage all of the tokens of owner.
source§

impl HasEvents for Erc721Base

source§

impl Node for Erc721Base

source§

const IS_LEAF: bool = false

source§

const COUNT: u32 = 4u32

source§

fn __keys() -> Vec<String>

source§

impl OdraItem for Erc721Base

source§

impl StaticInstance for Erc721Base

source§

fn instance<'a>(keys: &'a [&'a str]) -> (Self, &'a [&'a str])

Consumes keys required to create an instance, returns the instance with the remaining keys.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

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

source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.