Skip to content

API ReferenceTransactions, wallets, and signaturesFunction

buildERC20RevokeTransaction()

function buildERC20RevokeTransaction(ctx, params): Promise<AnvilTransactionRequest>;

Creates an unsigned AnvilTransactionRequest payload that revokes an ERC-20 approval by setting the spender’s allowance to zero. A trivial wrapper over buildERC20ApproveTransaction with amount: 0n, provided as its own named, discoverable affordance since revocation is a common, security-relevant action in its own right — and, for race-protected tokens, the required first half of the zero-then-set pair documented on buildERC20ApproveTransaction.

Parameters

ParameterTypeDescription
ctxSDKContextThe SDK context.
paramsERC20RevokeParamsThe token and spender to revoke approval for.

Returns

Promise<AnvilTransactionRequest>

The constructed transaction payload.