Approve

ERC20 Action Plugin - Approve

Description

Approve owner ERC20 token spending

Method

approve(address, uint256)

Input Parameters

NamePlugin TypeDescription

to

FctAddress

ERC20 Contract Address

Method Parameters

NamePlugin TypeDescription

spender

FctAddress

Allows spender to withdraw from your account multiple times, up to the amount

amount

FctValue

Amount of tokens to allow spender to send

Returned Values

No value returned

Example

Example with initParams

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

Example without initParams

const approve = new ERC20.actions.Approve({ chainId: 1 })

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

Learn more

Learn more about EIP20 token standard here

Last updated