DeFi

DeFi token approvals and Spender Access After Revocation

DeFi token approvals give a spender permission to move specified wallet tokens within an allowance recorded by the token contract. Shield in the DeFi platform helps review these permissions and revoke supported approvals. For standard ERC-20 allowances, revoking means setting a selected spender’s allowance to zero on the relevant network. While that allowance stays zero, the spender can’t use it to transfer the token. Revocation doesn’t undo earlier transfers or remove permissions held by other spenders.

Updated
Disconnecting a wallet leaves token allowances unchanged, so an approved spender can retain access without an active application connection.

Allowance size and the spender’s reach

An ERC-20 allowance limits how much of a particular token a spender can transfer from its owner’s account. The token contract records this permission for that owner and spender on its network, so a matching token symbol elsewhere doesn’t share the same allowance. Approval changes the permission record; an allowance-based transfer moves the tokens. Approving an amount doesn’t itself send that amount to the spender.

The remaining allowance and available balance both constrain a standard allowance-based transfer. A limited allowance usually falls as the spender uses it. Some implementations leave an unlimited allowance unchanged during spending, keeping it available after earlier activity. A larger allowance reduces the need for repeated approvals, while leaving more of that token accessible if someone can misuse the spender’s permissions.

What does revoking an approval change?

For a standard ERC-20 approval, successful revocation sets the selected spender’s allowance to zero. The owner keeps the tokens that remain in the wallet. Revoking an allowance doesn’t freeze the token or prevent the owner from transferring it directly. Another spender’s separate approval remains outside this change.

Revocation can’t reverse a completed transfer. An approval update changes spending permission from that point onward; it doesn’t recall assets from a recipient. A pending revocation also leaves an interval in which the earlier allowance may still apply. If a spender transfers tokens before the revocation executes, a later zero allowance doesn’t cancel that transfer.

Shield’s approval findings and amount controls

Shield identifies outstanding approvals and flags detected risks in the spender contracts linked to them. Its High Risk Contracts section pairs flagged approvals with explanations of the underlying issue. Its High Risk Tokens section concerns vulnerabilities in the tokens themselves. Removing a spender’s permission doesn’t repair those vulnerabilities. Scanner examines contract risks, while Shield connects wallet approvals with the spenders that can use them.

Advanced Mode expands Shield’s visible severity levels and supports adjusting approval amounts. Lowering a cap preserves a limited allowance for continued use. The default view focuses on some of the highest-risk concerns. An empty filtered view therefore doesn’t establish that every allowance is zero. Severity filters change which findings appear, and the feature’s network support limits where its controls apply.


Connection changes, spending caps, and revocation

Wallet disconnection ends a connection to an application without changing the token contract’s stored allowance. The spender can retain on-chain access without another visit to the application. Changing the allowance determines how much access remains. The options differ in both immediate permission and the authorization needed for later use.

Breakdown: Connection changes, spending caps, and revocation
Choice Effect on spending permission Access afterward
Leave the allowance unchanged The spender retains the recorded allowance. Allowance-based spending can continue within its remaining limits.
Disconnect the application The wallet connection ends; the on-chain allowance remains. Spending permission can persist without reconnecting the application.
Reduce the allowance The spender retains a smaller permission after the update succeeds. Transfers above the remaining allowance require an allowance increase.
Revoke the allowance The selected ERC-20 allowance becomes zero once the token contract applies the update. Allowance-based spending requires an allowance to be granted again.

Network fees and confirmation of the change

A revocation changes access only after successful execution on the network that stores the approval. A wallet confirmation authorizes submission; it doesn’t establish that the token contract has applied the change. Pending transactions haven’t completed that update. A transaction that executes and reverts leaves the allowance unchanged, even though execution can consume gas.

Gas pays for network execution, including an update that sets an allowance to zero. The fee depends on the network’s charging rules and the transaction’s execution requirements. It isn’t a percentage of the approved token balance. For a self-paid transaction, the submitting account needs enough of the network’s gas-paying asset. A wallet’s fee estimate concerns that proposed transaction, not a permanent revocation price.

DeFi token approvals - Network fees and confirmation of the change
Diagram: Network fees and confirmation of the change.

Open full-size image

The resulting allowance is meaningful only for the matching owner, token contract, spender, and network. An update for another account or network leaves the original allowance unchanged. Current allowance data describes the permission that remains, while a transaction can report success even if the approval call returns false and leaves the allowance unchanged.

NFT operators and signed approvals

NFT approvals use different permission structures from an ERC-20 spending cap. Shield includes approval checks for ERC-721 and ERC-1155 holdings, including permissions granted to marketplace or trading contracts flagged as vulnerable. ERC-721 supports approval for an individual NFT and operator approval across the owner’s NFTs within that contract. Removing a collection operator doesn’t automatically erase a separate approval for an individual NFT.

ERC-1155 operator approval covers the owner’s tokens within that contract. Switching it off removes that operator’s collection-level permission.

Tokens that implement ERC-2612 can accept a signed permit that sets an allowance upon successful on-chain execution. The signature specifies the owner, spender, and value, alongside a nonce and deadline. The permit must execute on-chain no later than its deadline. The allowance that it establishes can remain after the permit deadline passes.

An unused, valid ERC-2612 permit can establish an allowance after ordinary revocation if its nonce remains current and its deadline hasn’t passed. A cap reduction has the same limitation: editing the current allowance doesn’t invalidate an otherwise usable permit.

Quick answers about DeFi token approvals

Does an empty token balance erase an old allowance?

An empty balance doesn’t automatically erase a standard ERC-20 allowance. The balance and allowance are separate records. A spender can’t transfer tokens that the account doesn’t hold, but an existing allowance can apply to tokens that later arrive. Its remaining amount and the token’s implementation determine the access that persists.

Can Shield revoke approvals from an address that I only watch?

Watching an address doesn’t give you authority to revoke its approvals. A standard approval update requires authorization from the account that owns the tokens. Viewing an address’s public records doesn’t provide that authorization, even when its permissions appear in a tracking interface. Revocation doesn’t require disclosure of the account’s recovery phrase.

What happens to an existing deposit when I revoke its token allowance?

Revoking a wallet token allowance doesn’t withdraw assets that are already deposited in a protocol. The deposit remains subject to that protocol’s position and withdrawal rules. An allowance governs a spender’s access to specified tokens held by the owner. Removing it doesn’t repay borrowing or settle an existing debt.

Will revoking permissions secure a wallet with an exposed recovery phrase?

Revoking token approvals doesn’t remove the control that an exposed recovery phrase gives an attacker over accounts derived from it. Someone with the account’s signing keys can authorize transfers or create new approvals. A zero allowance addresses a particular spender’s access; it doesn’t change those keys or make them secret again.

Why can changing a spending cap require resetting it first?

Replacing a nonzero ERC-20 allowance with another nonzero allowance can create a transaction-ordering risk. A spender may consume the old allowance before the replacement executes, then use the new allowance afterward. Setting the allowance to zero before granting a new cap helps mitigate that pattern. It can’t reverse spending that occurs before the reset.