View Source Ethers.Contracts.ERC1155 (Ethers v0.5.4)

ERC1155 token interface

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

Summary

Functions

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

Prepares balanceOf(address account, uint256 id) call parameters on the contract.

Prepares balanceOfBatch(address[] accounts, uint256[] ids) call parameters on the contract.

Prepares contract constructor values for deployment.

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

Prepares safeBatchTransferFrom(address from, address to, uint256[] ids, uint256[] values, bytes data) call parameters on the contract.

Prepares safeTransferFrom(address from, address to, uint256 id, uint256 value, 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 uri(uint256) call parameters on the contract.

Functions

@spec __default_address__() :: nil

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

To specify a default address see Ethers.Contract

Prepares balanceOf(address account, uint256 id) 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

  • account: :address
  • id: {:uint, 256}

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

  • {:uint, 256}
Link to this function

balance_of_batch(accounts, ids)

View Source
@spec balance_of_batch([Ethers.Types.t_address()], [non_neg_integer()]) ::
  Ethers.TxData.t()

Prepares balanceOfBatch(address[] accounts, uint256[] ids) 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

  • accounts: {:array, :address}
  • ids: {:array, {:uint, 256}}

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

  • {:array, {:uint, 256}}
@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

Link to this function

is_approved_for_all(account, operator)

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

Prepares isApprovedForAll(address account, 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

  • account: :address
  • operator: :address

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

  • :bool
Link to this function

safe_batch_transfer_from(from, to, ids, values, data)

View Source
@spec safe_batch_transfer_from(
  Ethers.Types.t_address(),
  Ethers.Types.t_address(),
  [non_neg_integer()],
  [non_neg_integer()],
  binary()
) :: Ethers.TxData.t()

Prepares safeBatchTransferFrom(address from, address to, uint256[] ids, uint256[] values, 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
  • ids: {:array, {:uint, 256}}
  • values: {:array, {:uint, 256}}
  • data: :bytes

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

This function does not return any values!

Link to this function

safe_transfer_from(from, to, id, value, data)

View Source

Prepares safeTransferFrom(address from, address to, uint256 id, uint256 value, 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
  • id: {:uint, 256}
  • value: {:uint, 256}
  • data: :bytes

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

This function does not return any values!

Link to this function

set_approval_for_all(operator, approved)

View Source
@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!

Link to this function

supports_interface(interface_id)

View Source
@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
@spec uri(non_neg_integer()) :: Ethers.TxData.t()

Prepares uri(uint256) 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

  • {:uint, 256}

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

  • :string