View Source Ethers.Contract.ERC777 (Ethers v0.0.1-dev)

ERC777 token interface

More info: https://ethereum.org/en/developers/docs/standards/tokens/erc-777/

Link to this section Summary

Functions

Executes allowance(address holder, address spender) on the contract.

Executes approve(address spender, uint256 value) on the contract.

Executes authorizeOperator(address operator) on the contract.

Executes balanceOf(address tokenHolder) on the contract.

Executes burn(uint256 amount, bytes data) on the contract.

Prepares contract constructor values. To deploy contracts use Ethers.deploy/3.

Executes decimals() on the contract.

Executes defaultOperators() on the contract.

Executes granularity() on the contract.

Executes isOperatorFor(address operator, address tokenHolder) on the contract.

Executes name() on the contract.

Executes operatorBurn(address account, uint256 amount, bytes data, bytes operatorData) on the contract.

Executes operatorSend(address sender, address recipient, uint256 amount, bytes data, bytes operatorData) on the contract.

Executes revokeOperator(address operator) on the contract.

Executes send(address recipient, uint256 amount, bytes data) on the contract.

Executes symbol() on the contract.

Executes totalSupply() on the contract.

Executes transfer(address recipient, uint256 amount) on the contract.

Executes transferFrom(address holder, address recipient, uint256 amount) on the contract.

Link to this section Functions

Link to this function

allowance(holder, spender, overrides \\ [])

View Source

Executes allowance(address holder, address spender) on the contract.

parameters

Parameters

  • holder: :address
  • spender: :address
  • overrides: Overrides and options for the call.
    • :to: The address of the recipient contract. (Required)
    • :action: Type of action for this function (:call, :send or :prepare) Default: :call.
    • :rpc_opts: Options to pass to the RCP client e.g. :url.

return-types

Return Types

  • {:uint, 256}
Link to this function

approve(spender, value, overrides \\ [])

View Source

Executes approve(address spender, uint256 value) on the contract.

parameters

Parameters

  • spender: :address
  • value: {:uint, 256}
  • overrides: Overrides and options for the call.
    • :to: The address of the recipient contract. (Required)
    • :action: Type of action for this function (:call, :send or :prepare) Default: :send.
    • :rpc_opts: Options to pass to the RCP client e.g. :url.

return-types

Return Types

  • :bool
Link to this function

authorize_operator(operator, overrides \\ [])

View Source
@spec authorize_operator(Ethers.Types.t_address(), Keyword.t()) ::
  {:ok, []}
  | {:ok, Ethers.Types.t_transaction_hash()}
  | {:ok, Ethers.Contract.t_function_output()}

Executes authorizeOperator(address operator) on the contract.

parameters

Parameters

  • operator: :address
  • overrides: Overrides and options for the call.
    • :to: The address of the recipient contract. (Required)
    • :action: Type of action for this function (:call, :send or :prepare) Default: :send.
    • :rpc_opts: Options to pass to the RCP client e.g. :url.

return-types

Return Types

Link to this function

balance_of(token_holder, overrides \\ [])

View Source

Executes balanceOf(address tokenHolder) on the contract.

parameters

Parameters

  • tokenHolder: :address
  • overrides: Overrides and options for the call.
    • :to: The address of the recipient contract. (Required)
    • :action: Type of action for this function (:call, :send or :prepare) Default: :call.
    • :rpc_opts: Options to pass to the RCP client e.g. :url.

return-types

Return Types

  • {:uint, 256}
Link to this function

burn(amount, data, overrides \\ [])

View Source

Executes burn(uint256 amount, bytes data) on the contract.

parameters

Parameters

  • amount: {:uint, 256}
  • data: :bytes
  • overrides: Overrides and options for the call.
    • :to: The address of the recipient contract. (Required)
    • :action: Type of action for this function (:call, :send or :prepare) Default: :send.
    • :rpc_opts: Options to pass to the RCP client e.g. :url.

return-types

Return Types

Link to this function

constructor(name_, symbol_, default_operators_)

View Source
@spec constructor(String.t(), String.t(), [Ethers.Types.t_address()]) :: binary()

Prepares contract constructor values. To deploy contracts use Ethers.deploy/3.

parameters

Parameters

  • name_: :string
  • symbol_: :string
  • defaultOperators_: {:array, :address}
Link to this function

decimals(overrides \\ [])

View Source
@spec decimals(Keyword.t()) ::
  {:ok, [non_neg_integer()]}
  | {:ok, Ethers.Types.t_transaction_hash()}
  | {:ok, Ethers.Contract.t_function_output()}

Executes decimals() on the contract.

parameters

Parameters

  • overrides: Overrides and options for the call.
    • :to: The address of the recipient contract. (Required)
    • :action: Type of action for this function (:call, :send or :prepare) Default: :call.
    • :rpc_opts: Options to pass to the RCP client e.g. :url.

return-types

Return Types

  • {:uint, 8}
Link to this function

default_operators(overrides \\ [])

View Source
@spec default_operators(Keyword.t()) ::
  {:ok, [[Ethers.Types.t_address()]]}
  | {:ok, Ethers.Types.t_transaction_hash()}
  | {:ok, Ethers.Contract.t_function_output()}

Executes defaultOperators() on the contract.

parameters

Parameters

  • overrides: Overrides and options for the call.
    • :to: The address of the recipient contract. (Required)
    • :action: Type of action for this function (:call, :send or :prepare) Default: :call.
    • :rpc_opts: Options to pass to the RCP client e.g. :url.

return-types

Return Types

  • {:array, :address}
Link to this function

granularity(overrides \\ [])

View Source
@spec granularity(Keyword.t()) ::
  {:ok, [non_neg_integer()]}
  | {:ok, Ethers.Types.t_transaction_hash()}
  | {:ok, Ethers.Contract.t_function_output()}

Executes granularity() on the contract.

parameters

Parameters

  • overrides: Overrides and options for the call.
    • :to: The address of the recipient contract. (Required)
    • :action: Type of action for this function (:call, :send or :prepare) Default: :call.
    • :rpc_opts: Options to pass to the RCP client e.g. :url.

return-types

Return Types

  • {:uint, 256}
Link to this function

is_operator_for(operator, token_holder, overrides \\ [])

View Source

Executes isOperatorFor(address operator, address tokenHolder) on the contract.

parameters

Parameters

  • operator: :address
  • tokenHolder: :address
  • overrides: Overrides and options for the call.
    • :to: The address of the recipient contract. (Required)
    • :action: Type of action for this function (:call, :send or :prepare) Default: :call.
    • :rpc_opts: Options to pass to the RCP client e.g. :url.

return-types

Return Types

  • :bool
@spec name(Keyword.t()) ::
  {:ok, [String.t()]}
  | {:ok, Ethers.Types.t_transaction_hash()}
  | {:ok, Ethers.Contract.t_function_output()}

Executes name() on the contract.

parameters

Parameters

  • overrides: Overrides and options for the call.
    • :to: The address of the recipient contract. (Required)
    • :action: Type of action for this function (:call, :send or :prepare) Default: :call.
    • :rpc_opts: Options to pass to the RCP client e.g. :url.

return-types

Return Types

  • :string
Link to this function

operator_burn(account, amount, data, operator_data, overrides \\ [])

View Source

Executes operatorBurn(address account, uint256 amount, bytes data, bytes operatorData) on the contract.

parameters

Parameters

  • account: :address
  • amount: {:uint, 256}
  • data: :bytes
  • operatorData: :bytes
  • overrides: Overrides and options for the call.
    • :to: The address of the recipient contract. (Required)
    • :action: Type of action for this function (:call, :send or :prepare) Default: :send.
    • :rpc_opts: Options to pass to the RCP client e.g. :url.

return-types

Return Types

Link to this function

operator_send(sender, recipient, amount, data, operator_data, overrides \\ [])

View Source

Executes operatorSend(address sender, address recipient, uint256 amount, bytes data, bytes operatorData) on the contract.

parameters

Parameters

  • sender: :address
  • recipient: :address
  • amount: {:uint, 256}
  • data: :bytes
  • operatorData: :bytes
  • overrides: Overrides and options for the call.
    • :to: The address of the recipient contract. (Required)
    • :action: Type of action for this function (:call, :send or :prepare) Default: :send.
    • :rpc_opts: Options to pass to the RCP client e.g. :url.

return-types

Return Types

Link to this function

revoke_operator(operator, overrides \\ [])

View Source
@spec revoke_operator(Ethers.Types.t_address(), Keyword.t()) ::
  {:ok, []}
  | {:ok, Ethers.Types.t_transaction_hash()}
  | {:ok, Ethers.Contract.t_function_output()}

Executes revokeOperator(address operator) on the contract.

parameters

Parameters

  • operator: :address
  • overrides: Overrides and options for the call.
    • :to: The address of the recipient contract. (Required)
    • :action: Type of action for this function (:call, :send or :prepare) Default: :send.
    • :rpc_opts: Options to pass to the RCP client e.g. :url.

return-types

Return Types

Link to this function

send(recipient, amount, data, overrides \\ [])

View Source

Executes send(address recipient, uint256 amount, bytes data) on the contract.

parameters

Parameters

  • recipient: :address
  • amount: {:uint, 256}
  • data: :bytes
  • overrides: Overrides and options for the call.
    • :to: The address of the recipient contract. (Required)
    • :action: Type of action for this function (:call, :send or :prepare) Default: :send.
    • :rpc_opts: Options to pass to the RCP client e.g. :url.

return-types

Return Types

@spec symbol(Keyword.t()) ::
  {:ok, [String.t()]}
  | {:ok, Ethers.Types.t_transaction_hash()}
  | {:ok, Ethers.Contract.t_function_output()}

Executes symbol() on the contract.

parameters

Parameters

  • overrides: Overrides and options for the call.
    • :to: The address of the recipient contract. (Required)
    • :action: Type of action for this function (:call, :send or :prepare) Default: :call.
    • :rpc_opts: Options to pass to the RCP client e.g. :url.

return-types

Return Types

  • :string
Link to this function

total_supply(overrides \\ [])

View Source
@spec total_supply(Keyword.t()) ::
  {:ok, [non_neg_integer()]}
  | {:ok, Ethers.Types.t_transaction_hash()}
  | {:ok, Ethers.Contract.t_function_output()}

Executes totalSupply() on the contract.

parameters

Parameters

  • overrides: Overrides and options for the call.
    • :to: The address of the recipient contract. (Required)
    • :action: Type of action for this function (:call, :send or :prepare) Default: :call.
    • :rpc_opts: Options to pass to the RCP client e.g. :url.

return-types

Return Types

  • {:uint, 256}
Link to this function

transfer(recipient, amount, overrides \\ [])

View Source

Executes transfer(address recipient, uint256 amount) on the contract.

parameters

Parameters

  • recipient: :address
  • amount: {:uint, 256}
  • overrides: Overrides and options for the call.
    • :to: The address of the recipient contract. (Required)
    • :action: Type of action for this function (:call, :send or :prepare) Default: :send.
    • :rpc_opts: Options to pass to the RCP client e.g. :url.

return-types

Return Types

  • :bool
Link to this function

transfer_from(holder, recipient, amount, overrides \\ [])

View Source

Executes transferFrom(address holder, address recipient, uint256 amount) on the contract.

parameters

Parameters

  • holder: :address
  • recipient: :address
  • amount: {:uint, 256}
  • overrides: Overrides and options for the call.
    • :to: The address of the recipient contract. (Required)
    • :action: Type of action for this function (:call, :send or :prepare) Default: :send.
    • :rpc_opts: Options to pass to the RCP client e.g. :url.

return-types

Return Types

  • :bool