Struct odra_modules::erc721::erc721_base::Erc721Base
source · 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
impl Erc721Base
sourcepub fn is_approved_or_owner(&self, spender: &Address, token_id: &U256) -> bool
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.
sourcepub fn clear_approval(&mut self, token_id: &U256)
pub fn clear_approval(&mut self, token_id: &U256)
Revokes permission to transfer the token_id token.
sourcepub fn assert_exists(&self, token_id: &U256)
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
impl Clone for Erc721Base
source§fn clone(&self) -> Erc721Base
fn clone(&self) -> Erc721Base
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moresource§impl DynamicInstance for Erc721Base
impl DynamicInstance for Erc721Base
source§impl Erc721 for Erc721Base
impl Erc721 for Erc721Base
source§fn balance_of(&self, owner: &Address) -> U256
fn balance_of(&self, owner: &Address) -> U256
Returns the amount of tokens owned by
owner.source§fn safe_transfer_from(&mut self, from: &Address, to: &Address, token_id: &U256)
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 moresource§fn safe_transfer_from_with_data(
&mut self,
from: &Address,
to: &Address,
token_id: &U256,
data: &Bytes
)
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 morefn transfer_from(&mut self, from: &Address, to: &Address, token_id: &U256)
source§fn approve(&mut self, approved: &Option<Address>, token_id: &U256)
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 moresource§fn set_approval_for_all(&mut self, operator: &Address, approved: bool)
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 moresource§impl Node for Erc721Base
impl Node for Erc721Base
source§impl StaticInstance for Erc721Base
impl StaticInstance for Erc721Base
Auto Trait Implementations§
impl Freeze for Erc721Base
impl RefUnwindSafe for Erc721Base
impl Send for Erc721Base
impl Sync for Erc721Base
impl Unpin for Erc721Base
impl UnwindSafe for Erc721Base
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
Mutably borrows from an owned value. Read more