TransferFrom

ERC20 Action Plugin - TransferFrom

Description

Transfer ERC20 Tokens from account to account. This function is mostly used for contracts, who have been approved with Approve function

Method

transferFrom(address, address, uint256)

Input Parameters

NamePlugin TypeDescription

to

FctAddress

ERC20 Contract Address

Method Parameters

NamePlugin TypeDescription

from

FctAddress

Sender address

to

FctAddress

Receiver address

amount

FctValue

Amount of tokens

Returned Values

No value returned

Example

Example with initParams

const transferFrom = new ERC20.actions.TransferFrom({
 chainId: 1,
 initParams: {
   to: "0xB1191F691A355b43542Bea9B8847bc73e7Abb137" // KIRO Address
   methodParams: {
     from: "0x...",
     to: "0x...",
     amount: "100000000"
   }
 }
})

Example without initParams

const transferFrom = new ERC20.actions.TransferFrom({ chainId: 1 })

transferFrom.input.set({
    to: "0xB1191F691A355b43542Bea9B8847bc73e7Abb137" // KIRO Address
    methodParams: {
        from: "0x...",
        to: "0x...",
        amount: "100000000"
    }
})

Learn more

Learn more about EIP20 token standard here

Last updated