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
| Parameter | Type | Description |
|---|---|---|
ctx | SDKContext | The SDK context. |
params | ERC20RevokeParams | The token and spender to revoke approval for. |
Returns
Promise<AnvilTransactionRequest>
The constructed transaction payload.