revokecash helps you review and revoke wallet approvals, and revoking an ERC-20 allowance or an ERC-721 operator approval usually costs roughly the same gas: each clears one storage slot, while the token contract’s code determines the difference.
Revoke.cash token approvals helps you identify permissions granted to smart contracts. The revokecash tool lets you review those permissions and revoke approvals you no longer need.
Why are revokecash ERC-20 and NFT revoke costs close?
ERC-20 and ERC-721 revokes usually touch one previously cold storage slot and write zero to it. An ERC-20 call uses approve(spender,0) to replace a spender’s allowance; an ERC-721 call uses setApprovalForAll(operator,false) to disable an operator. Those meanings come from the EIP-20 and EIP-721 token standards. Neither standard fixes the gas used by a token’s implementation.
Start an estimate with the 21,000 gas transaction base, then add calldata and contract execution, including access to the storage slot. EIP-2929 charges more for a slot’s first access in a transaction. A proxy token can also add a delegatecall and cold account accesses; those costs belong to that token’s call, not to ERC-20 revokes generally.
Clearing the slot earns a refund. The EIP-3529 specification sets the refund for clearing a previously nonzero slot at 4,800 gas and limits total refunds to one-fifth of gas used. That rule applies to both revoke calls. A first approval writes zero to nonzero and receives no clearing refund, so a later revoke usually uses less gas than the approval that created the permission. The refund reduces gas charged after execution; it does not make the storage write free.
Say an illustrative wallet has a nonzero token allowance and an enabled NFT operator. Before either revoke, its respective contract can act under that permission. After approve(spender,0), the allowance is zero; after setApprovalForAll(operator,false), operator access is disabled. The wallet and token holdings stay the same. Each transaction still pays its own base cost, and its final gas use depends on the contract path.
Related questions
Why does revoking USDC cost more gas than other tokens?
USDC’s proxy design can make its revoke call use more gas than a simpler token’s call. The proxy forwards execution with delegatecall, and its implementation may perform additional checks and storage accesses. Estimate the specific contract instead of assigning one ERC-20 gas figure to every token.
Does revoke gas differ between Ethereum and Base?
Execution gas can differ with contract deployments and network rules, so estimate on the chain where you will send the revoke. The Ethereum fee is gas units used times its effective gas price. Base also charges an L1 data fee alongside its execution fee; compare total fees separately from execution gas units.
Applying the estimate
Can several revokes be batched into one transaction?
A smart contract wallet can batch calls when it is the approval owner. A separate batch contract cannot simply revoke an ordinary wallet’s ERC-20 allowance: approve changes the caller’s allowance. Estimate the actual batch, since shared transaction costs and the refund cap change its total.
Why does a revoke estimate fail on some tokens?
eth_estimateGas can return an error when a paused token or another contract check makes the revoke call revert. Surface that failure as an error, not a high gas cost. Also inspect ERC-20 return values: a token can return false without reverting, so a successful gas estimate alone does not confirm revocation.