pub struct Erc721Token { /* private fields */ }Expand description
The ERC721 token implementation.
It uses the ERC721 base implementation, the ERC721 metadata extension and the Ownable module.
Trait Implementations§
Source§impl HasEntrypoints for Erc721Token
impl HasEntrypoints for Erc721Token
Source§fn entrypoints() -> Vec<Entrypoint>
fn entrypoints() -> Vec<Entrypoint>
Returns the list of contract’s entrypoints.
Source§impl HasEvents for Erc721Token
impl HasEvents for Erc721Token
Source§impl Module for Erc721Token
impl Module for Erc721Token
Source§fn new(env: Rc<ContractEnv>) -> Self
fn new(env: Rc<ContractEnv>) -> Self
Creates a new instance of the module with the given contract environment.
Source§fn env(&self) -> Rc<ContractEnv>
fn env(&self) -> Rc<ContractEnv>
Returns the contract environment associated with the module.
Source§impl OdraContract for Erc721Token
impl OdraContract for Erc721Token
Source§type HostRef = Erc721TokenHostRef
type HostRef = Erc721TokenHostRef
The host reference type.
Source§type ContractRef = Erc721TokenContractRef
type ContractRef = Erc721TokenContractRef
The contract reference type.
Source§type InitArgs = Erc721TokenInitArgs
type InitArgs = Erc721TokenInitArgs
The init args type.
Source§type UpgradeArgs = NoArgs
type UpgradeArgs = NoArgs
The upgrade args type.
Source§impl OwnedErc721WithMetadata for Erc721Token
impl OwnedErc721WithMetadata for Erc721Token
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 moreSource§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§fn get_approved(&self, token_id: &U256) -> Option<Address>
fn get_approved(&self, token_id: &U256) -> Option<Address>
Returns the address approved for
token_id token. Read moreSource§fn is_approved_for_all(&self, owner: &Address, operator: &Address) -> bool
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§fn renounce_ownership(&mut self)
fn renounce_ownership(&mut self)
If the contract’s owner chooses to renounce their ownership, the contract
will no longer have an owner. This means that any functions that can only
be accessed by the owner will no longer be available. Read more
Source§fn transfer_ownership(&mut self, new_owner: &Address)
fn transfer_ownership(&mut self, new_owner: &Address)
Transfers ownership of the module to
new_owner. This function can only
be accessed by the current contract owner. Read moreSource§impl SchemaCustomTypes for Erc721Token
Available on non-WebAssembly only.
impl SchemaCustomTypes for Erc721Token
Available on non-WebAssembly only.
Source§fn schema_types() -> Vec<Option<CustomType>>
fn schema_types() -> Vec<Option<CustomType>>
Returns a vector of optional CustomTypes.
Source§impl SchemaEntrypoints for Erc721Token
Available on non-WebAssembly only.
impl SchemaEntrypoints for Erc721Token
Available on non-WebAssembly only.
Source§fn schema_entrypoints() -> Vec<Entrypoint>
fn schema_entrypoints() -> Vec<Entrypoint>
Returns a vector of Entrypoints.
Source§impl SchemaErrors for Erc721Token
Available on non-WebAssembly only.
impl SchemaErrors for Erc721Token
Available on non-WebAssembly only.
Source§impl SchemaEvents for Erc721Token
Available on non-WebAssembly only.
impl SchemaEvents for Erc721Token
Available on non-WebAssembly only.
Source§fn custom_types() -> Vec<Option<CustomType>>
fn custom_types() -> Vec<Option<CustomType>>
Returns a vector of CustomTypes. Read more
Auto Trait Implementations§
impl !Freeze for Erc721Token
impl !RefUnwindSafe for Erc721Token
impl !Send for Erc721Token
impl !Sync for Erc721Token
impl Unpin for Erc721Token
impl !UnwindSafe for Erc721Token
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
Source§impl<R> Deployer<R> for Rwhere
R: OdraContract,
impl<R> Deployer<R> for Rwhere
R: OdraContract,
Source§fn deploy(
env: &HostEnv,
init_args: <R as OdraContract>::InitArgs,
) -> <R as OdraContract>::HostRef
fn deploy( env: &HostEnv, init_args: <R as OdraContract>::InitArgs, ) -> <R as OdraContract>::HostRef
Deploys a contract with given init args. Read more
Source§fn try_deploy(
env: &HostEnv,
init_args: <R as OdraContract>::InitArgs,
) -> Result<<R as OdraContract>::HostRef, OdraError>
fn try_deploy( env: &HostEnv, init_args: <R as OdraContract>::InitArgs, ) -> Result<<R as OdraContract>::HostRef, OdraError>
Tries to deploy a contract with given init args. Read more
Source§fn deploy_with_cfg(
env: &HostEnv,
init_args: <R as OdraContract>::InitArgs,
cfg: InstallConfig,
) -> <R as OdraContract>::HostRef
fn deploy_with_cfg( env: &HostEnv, init_args: <R as OdraContract>::InitArgs, cfg: InstallConfig, ) -> <R as OdraContract>::HostRef
Deploys a contract with given init args and configuration. Read more
Source§fn try_deploy_with_cfg(
env: &HostEnv,
init_args: <R as OdraContract>::InitArgs,
cfg: InstallConfig,
) -> Result<<R as OdraContract>::HostRef, OdraError>
fn try_deploy_with_cfg( env: &HostEnv, init_args: <R as OdraContract>::InitArgs, cfg: InstallConfig, ) -> Result<<R as OdraContract>::HostRef, OdraError>
Tries to deploy a contract with given init args and configuration. Read more
Source§fn try_upgrade(
env: &HostEnv,
contract_to_upgrade: Address,
upgrade_args: <R as OdraContract>::UpgradeArgs,
) -> Result<<R as OdraContract>::HostRef, OdraError>
fn try_upgrade( env: &HostEnv, contract_to_upgrade: Address, upgrade_args: <R as OdraContract>::UpgradeArgs, ) -> Result<<R as OdraContract>::HostRef, OdraError>
Tries to upgrade a contract with given init args.
Source§fn try_upgrade_with_cfg(
env: &HostEnv,
contract_to_upgrade: Address,
upgrade_args: <R as OdraContract>::UpgradeArgs,
cfg: UpgradeConfig,
) -> Result<<R as OdraContract>::HostRef, OdraError>
fn try_upgrade_with_cfg( env: &HostEnv, contract_to_upgrade: Address, upgrade_args: <R as OdraContract>::UpgradeArgs, cfg: UpgradeConfig, ) -> Result<<R as OdraContract>::HostRef, OdraError>
Tries to upgrade a contract with given init args and configuration
Source§impl<T> HostRefLoader<<T as OdraContract>::HostRef> for Twhere
T: OdraContract,
impl<T> HostRefLoader<<T as OdraContract>::HostRef> for Twhere
T: OdraContract,
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>
Converts
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>
Converts
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