View Source Ethers.Contract.ERC20 (Ethers v0.0.1-dev)
ERC20 token interface
More info: https://ethereum.org/en/developers/docs/standards/tokens/erc-20/
Link to this section Summary
Functions
Executes allowance(address _owner, address _spender)
on the contract.
Executes approve(address _spender, uint256 _value)
on the contract.
Executes balanceOf(address _owner)
on the contract.
Executes decimals()
on the contract.
Executes name()
on the contract.
Executes symbol()
on the contract.
Executes totalSupply()
on the contract.
Executes transfer(address _to, uint256 _value)
on the contract.
Executes transferFrom(address _from, address _to, uint256 _value)
on the contract.
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_transaction_hash()} | {:ok, Ethers.Contract.t_function_output()}
Executes allowance(address _owner, address _spender)
on the contract.
parameters
Parameters
- _owner:
: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}
@spec approve(Ethers.Types.t_address(), non_neg_integer(), Keyword.t()) :: {:ok, [boolean()]} | {:ok, Ethers.Types.t_transaction_hash()} | {:ok, Ethers.Contract.t_function_output()}
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
@spec balance_of(Ethers.Types.t_address(), Keyword.t()) :: {:ok, [non_neg_integer()]} | {:ok, Ethers.Types.t_transaction_hash()} | {:ok, Ethers.Contract.t_function_output()}
Executes balanceOf(address _owner)
on the contract.
parameters
Parameters
- _owner:
: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}
@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}
@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
@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
@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}
@spec transfer(Ethers.Types.t_address(), non_neg_integer(), Keyword.t()) :: {:ok, [boolean()]} | {:ok, Ethers.Types.t_transaction_hash()} | {:ok, Ethers.Contract.t_function_output()}
Executes transfer(address _to, uint256 _value)
on the contract.
parameters
Parameters
- _to:
: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
@spec transfer_from( Ethers.Types.t_address(), Ethers.Types.t_address(), non_neg_integer(), Keyword.t() ) :: {:ok, [boolean()]} | {:ok, Ethers.Types.t_transaction_hash()} | {:ok, Ethers.Contract.t_function_output()}
Executes transferFrom(address _from, address _to, uint256 _value)
on the contract.
parameters
Parameters
- _from:
:address
- _to:
: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