Set the spender allowance to zero

To revoke an ERC-20 token approval, send an on-chain transaction that sets the spender allowance to zero on the token contract. Use the wallet that granted the approval on the same network, then read the allowance again after the transaction confirms. The account paying for the revocation needs funds for the network fee.

Revoke and verify in four steps

1. Open an approval checker from a trusted source, such as the Ethereum developer guide linked below. Select the network where you granted the approval and connect the wallet that owns the tokens. Keep the recovery phrase and private key offline.

2. Match the token contract address and the spender address to the approval you intend to remove. The same token can have separate approvals for multiple spenders. Use allowance(owner, spender) on the token contract to read the current amount.

3. Select Revoke and review the wallet prompt. For a direct ERC-20 revocation, the transaction goes to the token contract and calls approve(spender, 0). Confirm the spender argument and the zero allowance, and check the estimated network fee before signing.

4. Wait for a successful receipt, then read allowance(owner, spender) again on the same chain. A reading of zero confirms that the selected spender has no remaining standard allowance for that token at the time of the check.

Match the revocation to the approval type

An ERC-20 allowance is scoped to the network, owner, token contract and spender. ERC-721 and ERC-1155 operator permissions have their own methods. For those permissions, verify the operator status for the specific collection or token contract.

Approval typeDirect revocation callRead back
ERC-20 spender allowanceapprove(spender, 0)allowance(owner, spender) returns 0
ERC-721 or ERC-1155 operatorsetApprovalForAll(operator, false)isApprovedForAll(owner, operator) returns false
ERC-721 approval for one tokenapprove(zero address, tokenId)getApproved(tokenId) returns the zero address

Frequently asked questions

Does disconnecting my wallet revoke token approvals? Disconnecting ends the website session. The allowance stays on-chain until it is changed or used up.

Do I pay gas to revoke an approval? Yes. Revoking changes contract state, so the revocation transaction incurs a network fee. Reading an allowance can be done without sending a transaction.

Does revoking an approval recover tokens already moved? Revoking changes the remaining permission for future transfers. Past transfers stay in the transaction history.

Does revoking one spender cover every network and token? It updates one allowance for one owner, token contract and spender on the selected network. Check the other approvals individually.

Sources

  1. ethereum.org:如何撤销智能合约对你的加密资金的访问权限
  2. EIP-20: Token Standard
  3. ethereum.org: Common misconceptions about Ethereum
  4. Ethereum user guide — How to revoke token access
  5. ERC-721 — Single-token and operator approvals
  6. ERC-1155 — Operator approvals

Prepared with AI assistance. This guide explains protocol behavior for educational use.

This content is for learning and risk education only and does not constitute investment advice.

Editorial policy (Chinese)