Back to The Scan

How to Check and Revoke Token Approvals on XDC

by OpenScan

Guides

Every time you use a DEX or DeFi app on the XDC Network, you sign an approval — permission for that app’s contract to spend your tokens. Approvals don’t expire on their own, and unlimited approvals stay valid forever. If a contract you approved is ever exploited, the attacker can drain the approved tokens from your wallet. Checking and revoking stale approvals is basic wallet hygiene.

Here’s how to do it with xdcscan.io and your wallet. One thing up front: the explorer doesn’t have a dedicated approvals dashboard today, so this guide uses the explorer’s contract read/write tools directly — everything below links to the real pages.

1. Find your past approvals

Approvals are on-chain events, so your address history shows them:

  1. Open your address page: https://xdcscan.io/address/<your-address> (or paste your address into the search bar on xdcscan.io).
  2. Open the Token Transfers tab and look for Approval / ApprovalForAll transactions — each one records which token you approved and which spender contract you approved it for.

Make a list of (token contract, spender contract) pairs you want to check.

2. Check the current allowance

For each token on your list, confirm what’s still approved:

  1. Open the token contract’s page: https://xdcscan.io/token/<token-contract-address> — for example via the token list.
  2. Go to the Contract → Read Contract tab. (If the contract isn’t verified, encourage the team to verify it — reads and writes only work on verified contracts.)
  3. Call the allowance method with:
    • owner = your wallet address
    • spender = the contract you approved
  4. The result is the amount the spender can still move, in the token’s smallest unit. A huge number (dozens of digits) means an unlimited approval.

If the result is 0, there’s nothing to revoke for that pair.

3. Revoke the approval

Revoking is just setting the allowance back to zero — a normal transaction you sign with your wallet:

  1. On the same token contract page, open the Contract → Write Contract tab.
  2. Connect the wallet that granted the approval.
  3. Call the approve method with:
    • spender = the contract you’re revoking
    • amount = 0
  4. Confirm the transaction in your wallet. It costs a small gas fee in XDC.

For NFT collections, use setApprovalForAll(operator, false) instead of zeroing an allowance.

4. Verify the revocation

Once the transaction confirms, re-run the allowance check from step 2 — it should now return 0. You can also confirm the revocation transaction itself at https://xdcscan.io/tx/<tx-hash>; the logs show an Approval event with a zero value.

Habits that reduce the risk

  • Prefer exact-amount approvals over unlimited ones when a dapp offers the choice.
  • Revoke approvals for apps you no longer use.
  • Before approving, look up the spender contract on the explorer — a verified contract with a recognizable name is a much better sign than an unverified one.

Share this Post

See it on the live explorer

Everything we write about here is running today on XDCScan, our explorer for XDC Network.

More from The Scan

By OpenScan

How to Read a Transaction on XDCScan

By OpenScan

How to Verify Your Contract on XDCScan

By OpenScan Engineering

XDCScan Upgraded to Indexer v2.1

Start exploring.