Does Setting an Allowance to Zero (Revoking) Cost the Same as Setting It to a Non-Zero Value?

Yes, the gas cost is generally very similar. Both actions involve changing a value in the blockchain's storage, which is the primary driver of the transaction cost.

In some cases on Ethereum, changing a storage value from non-zero to zero can result in a small gas refund due to the way Ethereum incentivizes clearing up the state, but the base cost of the transaction itself remains and is subject to network fees. The difference is usually negligible.

In a Derivatives Contract, Does the Allowance Apply to the Notional Value or the Margin Deposited?
What Is the “Approve-and-Pull” Race Condition Vulnerability and How Can It Be Mitigated?
What Are the Security Risks Associated with Setting an Unlimited Token Allowance?
What Happens to a Token Allowance If the Dapp’s Smart Contract Is Upgraded or Changed?
How Can a User Revoke or Modify a Token Allowance for a Specific Dapp?
How Can Users Revoke or Reset a Token Allowance?
Could a Token Allowance Be Used to Automate Margin Calls in a Decentralized Perpetual Futures Contract?
Is It Safer to Set a New Allowance or to First Revoke and Then Set a New One?

Glossar