transferFrom

Transfers a specified amount of tokens from one address to another address on the ERC20 contract.

Example

import { transferFrom } from "thirdweb/extensions/erc20";
import { sendTransaction } from "thirdweb";
const transaction = transferFrom({
contract: USDC_CONTRACT,
from: "0x1234...",
to: "0x5678...",
amount: 100,
});
await sendTransaction({ transaction, account });
function transferFrom(

Parameters

The transaction options including from, to, amount, and gas price.

Type

Returns

let returnType: PreparedTransaction<
any,
AbiFunction,
>;

A promise that resolves to the prepared transaction object.