Module to encode calldata for given adaptor operations.
API Functions
| Function | Arity | Description | Param Kinds |
|---|---|---|---|
transfer | 2 | Encode ERC-20 transfer(address,uint256) calldata. | destination: value, amount_wei: value |
balance_of | 1 | Encode ERC-20 balanceOf(address) calldata. | address: value |
Summary
Functions
Encodes the call data for a balanceOf operation.
Encodes the call data for a transfer operation.
Functions
@spec balance_of(Cartouche.address()) :: binary()
Encodes the call data for a balanceOf operation.
Examples
iex> Cartouche.Erc20.CallData.balance_of(<<0xDD>>) |> Cartouche.Hex.encode_hex()
"0x"
@spec transfer(Cartouche.address(), non_neg_integer()) :: binary()
Encodes the call data for a transfer operation.
Examples
iex> Cartouche.Erc20.CallData.transfer(<<0xDD>>, 100_000)
...> |> Cartouche.Hex.encode_hex()
"0x8035f0ce"