View Source Ethers.Contracts.ERC777 (Ethers v0.0.2)
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.
Same as allowance/3
but raises Ethers.ExecutionError
on errors.
Executes approve(address spender, uint256 value)
on the contract.
Same as approve/3
but raises Ethers.ExecutionError
on errors.
Executes authorizeOperator(address operator)
on the contract.
Same as authorize_operator/2
but raises Ethers.ExecutionError
on errors.
Executes balanceOf(address tokenHolder)
on the contract.
Same as balance_of/2
but raises Ethers.ExecutionError
on errors.
Executes burn(uint256 amount, bytes data)
on the contract.
Same as burn/3
but raises Ethers.ExecutionError
on errors.
Prepares contract constructor values.
Executes decimals()
on the contract.
Same as decimals/1
but raises Ethers.ExecutionError
on errors.
Default address of the contract. Returns nil
if not specified.
Executes defaultOperators()
on the contract.
Same as default_operators/1
but raises Ethers.ExecutionError
on errors.
Executes granularity()
on the contract.
Same as granularity/1
but raises Ethers.ExecutionError
on errors.
Executes isOperatorFor(address operator, address tokenHolder)
on the contract.
Same as is_operator_for/3
but raises Ethers.ExecutionError
on errors.
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.
Same as operator_burn/5
but raises Ethers.ExecutionError
on errors.
Executes operatorSend(address sender, address recipient, uint256 amount, bytes data, bytes operatorData)
on the contract.
Same as operator_send/6
but raises Ethers.ExecutionError
on errors.
Executes revokeOperator(address operator)
on the contract.
Same as revoke_operator/2
but raises Ethers.ExecutionError
on errors.
Executes send(address recipient, uint256 amount, bytes data)
on the contract.
Same as send/4
but raises Ethers.ExecutionError
on errors.
Executes symbol()
on the contract.
Same as symbol/1
but raises Ethers.ExecutionError
on errors.
Executes totalSupply()
on the contract.
Same as total_supply/1
but raises Ethers.ExecutionError
on errors.
Executes transfer(address recipient, uint256 amount)
on the contract.
Same as transfer/3
but raises Ethers.ExecutionError
on errors.
Executes transferFrom(address holder, address recipient, uint256 amount)
on the contract.
Same as transfer_from/4
but raises Ethers.ExecutionError
on errors.
Link to this section Functions
@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
Parameters
- holder:
:address
- spender:
:address
- overrides: Overrides and options for the call. See Execution Options in
Ethers.Contract
.
return-types
Return Types
{:uint, 256}
@spec allowance!(Ethers.Types.t_address(), Ethers.Types.t_address(), Keyword.t()) :: [non_neg_integer()] | Ethers.Types.t_hash() | Ethers.Contract.t_function_output() | no_return()
Same as allowance/3
but raises Ethers.ExecutionError
on errors.
@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
Parameters
- spender:
:address
- value:
{:uint, 256}
- overrides: Overrides and options for the call. See Execution Options in
Ethers.Contract
.
return-types
Return Types
:bool
@spec approve!(Ethers.Types.t_address(), non_neg_integer(), Keyword.t()) :: [boolean()] | Ethers.Types.t_hash() | Ethers.Contract.t_function_output() | no_return()
Same as approve/3
but raises Ethers.ExecutionError
on errors.
@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
Parameters
- operator:
:address
- overrides: Overrides and options for the call. See Execution Options in
Ethers.Contract
.
return-types
Return Types
@spec authorize_operator!(Ethers.Types.t_address(), Keyword.t()) :: [[]] | Ethers.Types.t_hash() | Ethers.Contract.t_function_output() | no_return()
Same as authorize_operator/2
but raises Ethers.ExecutionError
on errors.
@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
Parameters
- tokenHolder:
:address
- overrides: Overrides and options for the call. See Execution Options in
Ethers.Contract
.
return-types
Return Types
{:uint, 256}
@spec balance_of!(Ethers.Types.t_address(), Keyword.t()) :: [non_neg_integer()] | Ethers.Types.t_hash() | Ethers.Contract.t_function_output() | no_return()
Same as balance_of/2
but raises Ethers.ExecutionError
on errors.
@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
Parameters
- amount:
{:uint, 256}
- data:
:bytes
- overrides: Overrides and options for the call. See Execution Options in
Ethers.Contract
.
return-types
Return Types
@spec burn!(non_neg_integer(), binary(), Keyword.t()) :: [[]] | Ethers.Types.t_hash() | Ethers.Contract.t_function_output() | no_return()
Same as burn/3
but raises Ethers.ExecutionError
on errors.
@spec constructor(String.t(), String.t(), [Ethers.Types.t_address()]) :: binary()
Prepares contract constructor values.
To deploy a contracts see Ethers.deploy/3
.
parameters
Parameters
- name_:
:string
- symbol_:
:string
- defaultOperators_:
{:array, :address}
@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
Parameters
- overrides: Overrides and options for the call. See Execution Options in
Ethers.Contract
.
return-types
Return Types
{:uint, 8}
@spec decimals!(Keyword.t()) :: [non_neg_integer()] | Ethers.Types.t_hash() | Ethers.Contract.t_function_output() | no_return()
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
@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
Parameters
- overrides: Overrides and options for the call. See Execution Options in
Ethers.Contract
.
return-types
Return Types
- address:
:array
@spec default_operators!(Keyword.t()) :: [[Ethers.Types.t_address()]] | Ethers.Types.t_hash() | Ethers.Contract.t_function_output() | no_return()
Same as default_operators/1
but raises Ethers.ExecutionError
on errors.
@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
Parameters
- overrides: Overrides and options for the call. See Execution Options in
Ethers.Contract
.
return-types
Return Types
{:uint, 256}
@spec granularity!(Keyword.t()) :: [non_neg_integer()] | Ethers.Types.t_hash() | Ethers.Contract.t_function_output() | no_return()
Same as granularity/1
but raises Ethers.ExecutionError
on errors.
@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
Parameters
- operator:
:address
- tokenHolder:
:address
- overrides: Overrides and options for the call. See Execution Options in
Ethers.Contract
.
return-types
Return Types
:bool
@spec is_operator_for!( Ethers.Types.t_address(), Ethers.Types.t_address(), Keyword.t() ) :: [boolean()] | Ethers.Types.t_hash() | Ethers.Contract.t_function_output() | no_return()
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
Parameters
- overrides: Overrides and options for the call. See Execution Options in
Ethers.Contract
.
return-types
Return Types
:string
@spec name!(Keyword.t()) :: [String.t()] | Ethers.Types.t_hash() | Ethers.Contract.t_function_output() | no_return()
Same as name/1
but raises Ethers.ExecutionError
on errors.
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
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
Return Types
operator_burn!(account, amount, data, operator_data, overrides \\ [])
View Source@spec operator_burn!( Ethers.Types.t_address(), non_neg_integer(), binary(), binary(), Keyword.t() ) :: [[]] | Ethers.Types.t_hash() | Ethers.Contract.t_function_output() | no_return()
Same as operator_burn/5
but raises Ethers.ExecutionError
on errors.
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
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
Return Types
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() ) :: [[]] | Ethers.Types.t_hash() | Ethers.Contract.t_function_output() | no_return()
Same as operator_send/6
but raises Ethers.ExecutionError
on errors.
@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
Parameters
- operator:
:address
- overrides: Overrides and options for the call. See Execution Options in
Ethers.Contract
.
return-types
Return Types
@spec revoke_operator!(Ethers.Types.t_address(), Keyword.t()) :: [[]] | Ethers.Types.t_hash() | Ethers.Contract.t_function_output() | no_return()
Same as revoke_operator/2
but raises Ethers.ExecutionError
on errors.
@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
Parameters
- recipient:
:address
- amount:
{:uint, 256}
- data:
:bytes
- overrides: Overrides and options for the call. See Execution Options in
Ethers.Contract
.
return-types
Return Types
@spec send!(Ethers.Types.t_address(), non_neg_integer(), binary(), Keyword.t()) :: [[]] | Ethers.Types.t_hash() | Ethers.Contract.t_function_output() | no_return()
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
Parameters
- overrides: Overrides and options for the call. See Execution Options in
Ethers.Contract
.
return-types
Return Types
:string
@spec symbol!(Keyword.t()) :: [String.t()] | Ethers.Types.t_hash() | Ethers.Contract.t_function_output() | no_return()
Same as symbol/1
but raises Ethers.ExecutionError
on errors.
@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
Parameters
- overrides: Overrides and options for the call. See Execution Options in
Ethers.Contract
.
return-types
Return Types
{:uint, 256}
@spec total_supply!(Keyword.t()) :: [non_neg_integer()] | Ethers.Types.t_hash() | Ethers.Contract.t_function_output() | no_return()
Same as total_supply/1
but raises Ethers.ExecutionError
on errors.
@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
Parameters
- recipient:
:address
- amount:
{:uint, 256}
- overrides: Overrides and options for the call. See Execution Options in
Ethers.Contract
.
return-types
Return Types
:bool
@spec transfer!(Ethers.Types.t_address(), non_neg_integer(), Keyword.t()) :: [boolean()] | Ethers.Types.t_hash() | Ethers.Contract.t_function_output() | no_return()
Same as transfer/3
but raises Ethers.ExecutionError
on errors.
@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
Parameters
- holder:
:address
- recipient:
:address
- amount:
{:uint, 256}
- overrides: Overrides and options for the call. See Execution Options in
Ethers.Contract
.
return-types
Return Types
:bool
@spec transfer_from!( Ethers.Types.t_address(), Ethers.Types.t_address(), non_neg_integer(), Keyword.t() ) :: [boolean()] | Ethers.Types.t_hash() | Ethers.Contract.t_function_output() | no_return()
Same as transfer_from/4
but raises Ethers.ExecutionError
on errors.