View Source Ethers.Contracts.ERC721 (Ethers v0.5.5)

ERC721 token interface

More info: https://eips.ethereum.org/EIPS/eip-721

Summary

Functions

Default address of the contract. Returns nil if not specified.

Prepares approve(address to, uint256 tokenId) call parameters on the contract.

Prepares balanceOf(address owner) call parameters on the contract.

Prepares contract constructor values for deployment.

Prepares getApproved(uint256 tokenId) call parameters on the contract.

Prepares isApprovedForAll(address owner, address operator) call parameters on the contract.

Prepares name() call parameters on the contract.

Prepares ownerOf(uint256 tokenId) call parameters on the contract.

Prepares safeTransferFrom(address from, address to, uint256 tokenId) call parameters on the contract.

Prepares safeTransferFrom(address from, address to, uint256 tokenId, bytes data) call parameters on the contract.

Prepares setApprovalForAll(address operator, bool approved) call parameters on the contract.

Prepares supportsInterface(bytes4 interfaceId) call parameters on the contract.

Prepares symbol() call parameters on the contract.

Prepares tokenURI(uint256 tokenId) call parameters on the contract.

Prepares transferFrom(address from, address to, uint256 tokenId) call parameters on the contract.

Functions

__default_address__()

@spec __default_address__() :: nil

Default address of the contract. Returns nil if not specified.

To specify a default address see Ethers.Contract

approve(to, token_id)

Prepares approve(address to, uint256 tokenId) call parameters on the contract.

This function can be used for a transaction or additionally called for results (Use Ethers.send/2). No amount of Ether can be sent with this function.

State mutability: non_payable

Function Parameter Types

  • to: :address
  • tokenId: {:uint, 256}

Return Types (when called with Ethers.call/2)

This function does not return any values!

balance_of(owner)

@spec balance_of(Ethers.Types.t_address()) :: Ethers.TxData.t()

Prepares balanceOf(address owner) call parameters on the contract.

This function should only be called for result and never in a transaction on its own. (Use Ethers.call/2)

State mutability: view

Function Parameter Types

  • owner: :address

Return Types (when called with Ethers.call/2)

  • {:uint, 256}

constructor()

@spec constructor() :: binary()

Prepares contract constructor values for deployment.

To deploy a contracts use Ethers.deploy/2 and pass the result of this function as :encoded_constructor option.

Parameters

get_approved(token_id)

@spec get_approved(non_neg_integer()) :: Ethers.TxData.t()

Prepares getApproved(uint256 tokenId) call parameters on the contract.

This function should only be called for result and never in a transaction on its own. (Use Ethers.call/2)

State mutability: view

Function Parameter Types

  • tokenId: {:uint, 256}

Return Types (when called with Ethers.call/2)

  • :address

is_approved_for_all(owner, operator)

@spec is_approved_for_all(Ethers.Types.t_address(), Ethers.Types.t_address()) ::
  Ethers.TxData.t()

Prepares isApprovedForAll(address owner, address operator) call parameters on the contract.

This function should only be called for result and never in a transaction on its own. (Use Ethers.call/2)

State mutability: view

Function Parameter Types

  • owner: :address
  • operator: :address

Return Types (when called with Ethers.call/2)

  • :bool

name()

@spec name() :: Ethers.TxData.t()

Prepares name() call parameters on the contract.

This function should only be called for result and never in a transaction on its own. (Use Ethers.call/2)

State mutability: view

Return Types (when called with Ethers.call/2)

  • :string

owner_of(token_id)

@spec owner_of(non_neg_integer()) :: Ethers.TxData.t()

Prepares ownerOf(uint256 tokenId) call parameters on the contract.

This function should only be called for result and never in a transaction on its own. (Use Ethers.call/2)

State mutability: view

Function Parameter Types

  • tokenId: {:uint, 256}

Return Types (when called with Ethers.call/2)

  • :address

safe_transfer_from(from, to, token_id)

Prepares safeTransferFrom(address from, address to, uint256 tokenId) call parameters on the contract.

This function can be used for a transaction or additionally called for results (Use Ethers.send/2). No amount of Ether can be sent with this function.

State mutability: non_payable

Function Parameter Types

  • from: :address
  • to: :address
  • tokenId: {:uint, 256}

Return Types (when called with Ethers.call/2)

This function does not return any values!

safe_transfer_from(from, to, token_id, data)

Prepares safeTransferFrom(address from, address to, uint256 tokenId, bytes data) call parameters on the contract.

This function can be used for a transaction or additionally called for results (Use Ethers.send/2). No amount of Ether can be sent with this function.

State mutability: non_payable

Function Parameter Types

  • from: :address
  • to: :address
  • tokenId: {:uint, 256}
  • data: :bytes

Return Types (when called with Ethers.call/2)

This function does not return any values!

set_approval_for_all(operator, approved)

@spec set_approval_for_all(Ethers.Types.t_address(), boolean()) :: Ethers.TxData.t()

Prepares setApprovalForAll(address operator, bool approved) call parameters on the contract.

This function can be used for a transaction or additionally called for results (Use Ethers.send/2). No amount of Ether can be sent with this function.

State mutability: non_payable

Function Parameter Types

  • operator: :address
  • approved: :bool

Return Types (when called with Ethers.call/2)

This function does not return any values!

supports_interface(interface_id)

@spec supports_interface(<<_::32>>) :: Ethers.TxData.t()

Prepares supportsInterface(bytes4 interfaceId) call parameters on the contract.

This function should only be called for result and never in a transaction on its own. (Use Ethers.call/2)

State mutability: view

Function Parameter Types

  • interfaceId: {:bytes, 4}

Return Types (when called with Ethers.call/2)

  • :bool

symbol()

@spec symbol() :: Ethers.TxData.t()

Prepares symbol() call parameters on the contract.

This function should only be called for result and never in a transaction on its own. (Use Ethers.call/2)

State mutability: view

Return Types (when called with Ethers.call/2)

  • :string

token_uri(token_id)

@spec token_uri(non_neg_integer()) :: Ethers.TxData.t()

Prepares tokenURI(uint256 tokenId) call parameters on the contract.

This function should only be called for result and never in a transaction on its own. (Use Ethers.call/2)

State mutability: view

Function Parameter Types

  • tokenId: {:uint, 256}

Return Types (when called with Ethers.call/2)

  • :string

transfer_from(from, to, token_id)

Prepares transferFrom(address from, address to, uint256 tokenId) call parameters on the contract.

This function can be used for a transaction or additionally called for results (Use Ethers.send/2). No amount of Ether can be sent with this function.

State mutability: non_payable

Function Parameter Types

  • from: :address
  • to: :address
  • tokenId: {:uint, 256}

Return Types (when called with Ethers.call/2)

This function does not return any values!