Approve Token Spending logo

Catalog action EVM Onchain wallet Gas

Allow a smart contract (DEX, protocol, etc.) to spend your tokens. Required before swaps, staking, or DeFi interactions. Set amount to 0 to revoke an existing approval.

This action can require a wallet connector, gas, token movement, or an external side effect. Test with simulation or a controlled amount before using it in a live workflow.

At a Glance

FieldValue
Action IDapprove-erc20
CategoryEVM Onchain
Connectorwallet
Requires gasYes
Funds movementNone declared
Tagsblockchain, evm, erc20, token, approve, allowance, defi, permission, swap

Payload Schema

FieldTypeRequiredDescription
tokenAddressstringYesERC20 token contract address
spenderAddressstringYesAddress being approved to spend tokens (e.g., DEX router)
amountstringYesAmount to approve in token smallest units (e.g., "1000000" for 1 USDC). Use max uint256 for unlimited approval.
chainIdnumberYesChain ID (1=Ethereum, 137=Polygon, 56=BSC, 8453=Base, etc.)
gasLimitstringNoOptional gas limit override
confirmUnlimitedApprovalbooleanNoRequired confirmation flag when approving unlimited (max uint256) amounts. Set to true to acknowledge the security risk.

Result Schema

FieldTypeRequiredDescription
statusstringYes-
transactionHashstringYes-
approvedAmountstringNoThe amount that was approved
isUnlimitedApprovalbooleanNoWhether this was an unlimited approval (max uint256)
blockNumbernumberNoBlock number the transaction was included in

Examples

json
{ "type": "approve-erc20", "payload": { "tokenAddress": "0x0000000000000000000000000000000000000000", "spenderAddress": "0x0000000000000000000000000000000000000000", "amount": "1000000", "chainId": 8453 }, "children": [], "connector": { "type": "wallet", "id": "conn_wallet" }}

Payload fields can use workflow expressions such as {{$trigger.body.amount}}, {{$nodes.fetch.result.price}}, and {{$props.asset}} when the value should come from a trigger, prior node, or reusable workflow prop.

Ask a question... ⌘I