{"uid":"cap_4qc2jME1nXQtD47tQ3ttw","slug":"erc-20-approve-calldata-builder-with-unlimited-allowance-flagging-7fd70266","name":"ERC-20 Approve Calldata Builder with Unlimited Allowance Flagging","description":"Build ERC-20 approval calldata, flagging unlimited allowances before anything is signed","url":"https://evm-canon-base.onrender.com/encode/approve","method":"POST","headers":{},"bodySchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","required":["input"],"properties":{"input":{"type":"object","required":["type","method","bodyType","body"],"properties":{"body":{"type":"object","required":["args"],"properties":{"args":{"type":"object","description":"arguments keyed by parameter name"},"chain":{"description":"chain name, alias or numeric chainId"},"token":{"type":"string","description":"symbol or contract address"},"value":{"type":"string","description":"native value in wei"},"function":{"type":"string","description":"name or full signature (generic route only)"}}},"type":{"type":"string","const":"http"},"method":{"enum":["POST","PUT","PATCH"],"type":"string"},"bodyType":{"enum":["json","form-data","text"],"type":"string"}},"additionalProperties":false},"output":{"type":"object","required":["type"],"properties":{"type":{"type":"string"},"example":{"type":"object"}}}}},"responseSchema":null,"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.01","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.01/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.01","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.01","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_37TvVzempleOGZFdd5tTS","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.01","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Encodes ERC-20 approve() calldata for a given spender and amount, automatically flagging unlimited (max uint256) allowances before any transaction is signed","exampleAgentPrompt":"Build me the approve() calldata to let Uniswap's router (0x4752ba5DBc23f44D87826276BF6Fd6b1C372aD24) spend up to 1000 USDC (0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48, 6 decimals) on my behalf, and let me know if it's flagged as an unlimited allowance.","exampleUseCases":[{"title":"DeFi swap pre-approval encoding","prompt":"I need to approve Uniswap V3's swap router (0xE592427A0AEce92De3Edee1F18E0157C05861564) to spend 500 DAI (0x6B175474E89094C44Da98b954EedeAC495271d0F, 18 decimals) on my behalf — give me the calldata and tell me if it triggers an unlimited-allowance warning."},{"title":"Unlimited allowance risk check","prompt":"Encode an ERC-20 approve for the maximum possible amount (unlimited) for spender 0xabc123... on WETH (0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2, 18 decimals), and make sure the response flags that this is an unlimited allowance before I sign anything."},{"title":"Safe allowance for lending protocol","prompt":"Build the approve() calldata to allow Aave's lending pool (0x7d2768dE32b0b80b7a3454c06BdAc94A69DDc7A9) to spend exactly 2500 USDC (0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48, 6 decimals) — I want to confirm it won't be flagged as unlimited."}],"resultDescription":"Returns ABI-encoded hex calldata for the ERC-20 approve(address,uint256) function, along with a risk flag indicating whether the allowance is unlimited (max uint256). The agent can pass this calldata directly into a transaction without further encoding. No transaction is submitted; the endpoint is purely a calldata builder.","failureModes":["Invalid or checksummed token address format returns a 400 error","Invalid spender address returns a 400 error","Amount exceeding uint256 max returns a validation error","Unsupported token or unresolvable decimals may return an error","Network timeout on the render.com host (cold start latency)","Payment failure (x402) if USDC balance is insufficient"],"whenToPreferThis":"Choose this endpoint when you need ERC-20 approve() calldata with a built-in safety check for unlimited allowances before any signing occurs. It is ideal for DeFi agents that must encode approvals deterministically while surfacing risk signals to users. Prefer it over raw ABI encoding when the unlimited-allowance flag matters for user consent flows, or when you want a single canonical calldata builder without setting up a local ABI library.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-15T06:30:35.225Z","isFirstParty":false}