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 });

Parameters

Returns

A promise that resolves to the prepared transaction object.