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

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

__default_address__()

@spec __default_address__() :: nil

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

To specify a default address see Ethers.Contract

balance_of(account, id)

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}

balance_of_batch(accounts, ids)

@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}}

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

is_approved_for_all(account, operator)

@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

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

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

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

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!

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

uri(arg1)

@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