View Source Ethers.Contracts.ERC777 (Ethers v0.0.6)

ERC777 token interface

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

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.

Executes decimals() on the contract.

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

Executes defaultOperators() on the contract.

Executes granularity() on the contract.

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

Executes name() on the contract.

Same as name/1 but raises Ethers.ExecutionError on errors.

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.

Functions

Link to this function

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

View Source
@spec allowance(Ethers.Types.t_address(), Ethers.Types.t_address(), Keyword.t()) ::
  {:ok, [non_neg_integer()]}
  | {:ok, Ethers.Types.t_hash()}
  | {:ok, Ethers.Contract.t_function_output()}
  | {:error, term()}

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

Default action for this function is :call. To override default action see Execution Options in Ethers.Contract.

Parameters

  • holder: :address
  • spender: :address
  • overrides: Overrides and options for the call. See Execution Options in Ethers.Contract.

Return Types

  • {:uint, 256}
Link to this function

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

View Source

Same as allowance/3 but raises Ethers.ExecutionError on errors.

Link to this function

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

View Source
@spec approve(Ethers.Types.t_address(), non_neg_integer(), Keyword.t()) ::
  {:ok, [boolean()]}
  | {:ok, Ethers.Types.t_hash()}
  | {:ok, Ethers.Contract.t_function_output()}
  | {:error, term()}

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

Default action for this function is :send. To override default action see Execution Options in Ethers.Contract.

Parameters

  • spender: :address
  • value: {:uint, 256}
  • overrides: Overrides and options for the call. See Execution Options in Ethers.Contract.

Return Types

  • :bool
Link to this function

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

View Source

Same as approve/3 but raises Ethers.ExecutionError on errors.

Link to this function

authorize_operator(operator, overrides \\ [])

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

Executes authorizeOperator(address operator) on the contract.

Default action for this function is :send. To override default action see Execution Options in Ethers.Contract.

Parameters

  • operator: :address
  • overrides: Overrides and options for the call. See Execution Options in Ethers.Contract.

Return Types

Link to this function

authorize_operator!(operator, overrides \\ [])

View Source

Same as authorize_operator/2 but raises Ethers.ExecutionError on errors.

Link to this function

balance_of(token_holder, overrides \\ [])

View Source
@spec balance_of(Ethers.Types.t_address(), Keyword.t()) ::
  {:ok, [non_neg_integer()]}
  | {:ok, Ethers.Types.t_hash()}
  | {:ok, Ethers.Contract.t_function_output()}
  | {:error, term()}

Executes balanceOf(address tokenHolder) on the contract.

Default action for this function is :call. To override default action see Execution Options in Ethers.Contract.

Parameters

  • tokenHolder: :address
  • overrides: Overrides and options for the call. See Execution Options in Ethers.Contract.

Return Types

  • {:uint, 256}
Link to this function

balance_of!(token_holder, overrides \\ [])

View Source

Same as balance_of/2 but raises Ethers.ExecutionError on errors.

Link to this function

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

View Source
@spec burn(non_neg_integer(), binary(), Keyword.t()) ::
  {:ok, [[]]}
  | {:ok, Ethers.Types.t_hash()}
  | {:ok, Ethers.Contract.t_function_output()}
  | {:error, term()}

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

Default action for this function is :send. To override default action see Execution Options in Ethers.Contract.

Parameters

  • amount: {:uint, 256}
  • data: :bytes
  • overrides: Overrides and options for the call. See Execution Options in Ethers.Contract.

Return Types

Link to this function

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

View Source

Same as burn/3 but raises Ethers.ExecutionError on errors.

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 a contracts see Ethers.deploy/3.

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_hash()}
  | {:ok, Ethers.Contract.t_function_output()}
  | {:error, term()}

Executes decimals() on the contract.

Default action for this function is :call. To override default action see Execution Options in Ethers.Contract.

Parameters

  • overrides: Overrides and options for the call. See Execution Options in Ethers.Contract.

Return Types

  • {:uint, 8}
Link to this function

decimals!(overrides \\ [])

View Source

Same as decimals/1 but raises Ethers.ExecutionError on errors.

@spec default_address() :: Ethers.Types.t_address() | nil

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

To specify a default address see Ethers.Contract

Link to this function

default_operators(overrides \\ [])

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

Executes defaultOperators() on the contract.

Default action for this function is :call. To override default action see Execution Options in Ethers.Contract.

Parameters

  • overrides: Overrides and options for the call. See Execution Options in Ethers.Contract.

Return Types

  • address: :array
Link to this function

default_operators!(overrides \\ [])

View Source

Same as default_operators/1 but raises Ethers.ExecutionError on errors.

Link to this function

granularity(overrides \\ [])

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

Executes granularity() on the contract.

Default action for this function is :call. To override default action see Execution Options in Ethers.Contract.

Parameters

  • overrides: Overrides and options for the call. See Execution Options in Ethers.Contract.

Return Types

  • {:uint, 256}
Link to this function

granularity!(overrides \\ [])

View Source

Same as granularity/1 but raises Ethers.ExecutionError on errors.

Link to this function

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

View Source
@spec is_operator_for(Ethers.Types.t_address(), Ethers.Types.t_address(), Keyword.t()) ::
  {:ok, [boolean()]}
  | {:ok, Ethers.Types.t_hash()}
  | {:ok, Ethers.Contract.t_function_output()}
  | {:error, term()}

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

Default action for this function is :call. To override default action see Execution Options in Ethers.Contract.

Parameters

  • operator: :address
  • tokenHolder: :address
  • overrides: Overrides and options for the call. See Execution Options in Ethers.Contract.

Return Types

  • :bool
Link to this function

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

View Source

Same as is_operator_for/3 but raises Ethers.ExecutionError on errors.

@spec name(Keyword.t()) ::
  {:ok, [String.t()]}
  | {:ok, Ethers.Types.t_hash()}
  | {:ok, Ethers.Contract.t_function_output()}
  | {:error, term()}

Executes name() on the contract.

Default action for this function is :call. To override default action see Execution Options in Ethers.Contract.

Parameters

  • overrides: Overrides and options for the call. See Execution Options in Ethers.Contract.

Return Types

  • :string

Same as name/1 but raises Ethers.ExecutionError on errors.

Link to this function

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

View Source
@spec operator_burn(
  Ethers.Types.t_address(),
  non_neg_integer(),
  binary(),
  binary(),
  Keyword.t()
) ::
  {:ok, [[]]}
  | {:ok, Ethers.Types.t_hash()}
  | {:ok, Ethers.Contract.t_function_output()}
  | {:error, term()}

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

Default action for this function is :send. To override default action see Execution Options in Ethers.Contract.

Parameters

  • account: :address
  • amount: {:uint, 256}
  • data: :bytes
  • operatorData: :bytes
  • overrides: Overrides and options for the call. See Execution Options in Ethers.Contract.

Return Types

Link to this function

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

View Source

Same as operator_burn/5 but raises Ethers.ExecutionError on errors.

Link to this function

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

View Source
@spec operator_send(
  Ethers.Types.t_address(),
  Ethers.Types.t_address(),
  non_neg_integer(),
  binary(),
  binary(),
  Keyword.t()
) ::
  {:ok, [[]]}
  | {:ok, Ethers.Types.t_hash()}
  | {:ok, Ethers.Contract.t_function_output()}
  | {:error, term()}

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

Default action for this function is :send. To override default action see Execution Options in Ethers.Contract.

Parameters

  • sender: :address
  • recipient: :address
  • amount: {:uint, 256}
  • data: :bytes
  • operatorData: :bytes
  • overrides: Overrides and options for the call. See Execution Options in Ethers.Contract.

Return Types

Link to this function

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

View Source

Same as operator_send/6 but raises Ethers.ExecutionError on errors.

Link to this function

revoke_operator(operator, overrides \\ [])

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

Executes revokeOperator(address operator) on the contract.

Default action for this function is :send. To override default action see Execution Options in Ethers.Contract.

Parameters

  • operator: :address
  • overrides: Overrides and options for the call. See Execution Options in Ethers.Contract.

Return Types

Link to this function

revoke_operator!(operator, overrides \\ [])

View Source

Same as revoke_operator/2 but raises Ethers.ExecutionError on errors.

Link to this function

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

View Source
@spec send(Ethers.Types.t_address(), non_neg_integer(), binary(), Keyword.t()) ::
  {:ok, [[]]}
  | {:ok, Ethers.Types.t_hash()}
  | {:ok, Ethers.Contract.t_function_output()}
  | {:error, term()}

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

Default action for this function is :send. To override default action see Execution Options in Ethers.Contract.

Parameters

  • recipient: :address
  • amount: {:uint, 256}
  • data: :bytes
  • overrides: Overrides and options for the call. See Execution Options in Ethers.Contract.

Return Types

Link to this function

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

View Source

Same as send/4 but raises Ethers.ExecutionError on errors.

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

Executes symbol() on the contract.

Default action for this function is :call. To override default action see Execution Options in Ethers.Contract.

Parameters

  • overrides: Overrides and options for the call. See Execution Options in Ethers.Contract.

Return Types

  • :string
Link to this function

symbol!(overrides \\ [])

View Source

Same as symbol/1 but raises Ethers.ExecutionError on errors.

Link to this function

total_supply(overrides \\ [])

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

Executes totalSupply() on the contract.

Default action for this function is :call. To override default action see Execution Options in Ethers.Contract.

Parameters

  • overrides: Overrides and options for the call. See Execution Options in Ethers.Contract.

Return Types

  • {:uint, 256}
Link to this function

total_supply!(overrides \\ [])

View Source

Same as total_supply/1 but raises Ethers.ExecutionError on errors.

Link to this function

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

View Source
@spec transfer(Ethers.Types.t_address(), non_neg_integer(), Keyword.t()) ::
  {:ok, [boolean()]}
  | {:ok, Ethers.Types.t_hash()}
  | {:ok, Ethers.Contract.t_function_output()}
  | {:error, term()}

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

Default action for this function is :send. To override default action see Execution Options in Ethers.Contract.

Parameters

  • recipient: :address
  • amount: {:uint, 256}
  • overrides: Overrides and options for the call. See Execution Options in Ethers.Contract.

Return Types

  • :bool
Link to this function

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

View Source

Same as transfer/3 but raises Ethers.ExecutionError on errors.

Link to this function

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

View Source
@spec transfer_from(
  Ethers.Types.t_address(),
  Ethers.Types.t_address(),
  non_neg_integer(),
  Keyword.t()
) ::
  {:ok, [boolean()]}
  | {:ok, Ethers.Types.t_hash()}
  | {:ok, Ethers.Contract.t_function_output()}
  | {:error, term()}

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

Default action for this function is :send. To override default action see Execution Options in Ethers.Contract.

Parameters

  • holder: :address
  • recipient: :address
  • amount: {:uint, 256}
  • overrides: Overrides and options for the call. See Execution Options in Ethers.Contract.

Return Types

  • :bool
Link to this function

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

View Source

Same as transfer_from/4 but raises Ethers.ExecutionError on errors.