View Source Signet.Erc20 (Signet v1.3.8)
A wrapper for an ERC-20 contract, allowing the code to interact by pulling data from the contract, or sending transaction to it.
Summary
Functions
Returns a list of known error codes (ABI signatures), which can be used when parsing error messages from contract calls.
Executes a transfer
transaction.
Types
@type call_opts() :: nil
Functions
@spec call_trx(Signet.contract(), binary(), [call_opts()]) :: term()
@spec errors() :: [String.t()]
Returns a list of known error codes (ABI signatures), which can be used when parsing error messages from contract calls.
@spec exec_trx(Signet.contract(), binary(), [exec_opts()]) :: term()
@spec transfer(Signet.contract(), Signet.address(), non_neg_integer(), [exec_opts()]) :: {:ok, binary()} | {:error, term()}
Executes a transfer
transaction.
Arguments:
destination
: The destination addressamount_wei
: The amount, in token wei, to transfer.exec_opts
: Execution options, such as the gas price for the transaction.
Examples
iex> {:ok, _trx_id} = Signet.Erc20.transfer(<<0xCC>>, <<0xDD>>, 100_000)