encodeERC20TransferCall static method

Uint8List encodeERC20TransferCall(
  1. EthereumAddress address,
  2. EthereumAddress recipient,
  3. EtherAmount amount
)

Encodes the calldata for ERC20 transfer.

  • address: The 4337 wallet address.
  • recipient: The address of the recipient.
  • amount: The amount to transfer.

Returns a Uint8List representing the calldata.

Implementation

static Uint8List encodeERC20TransferCall(
  EthereumAddress address,
  EthereumAddress recipient,
  EtherAmount amount,
) {
  return encodeFunctionCall(
    'transfer',
    address,
    ContractAbis.get('ERC20'),
    [recipient, amount.getInWei],
  );
}