Metadata-Version: 2.4
Name: stablecoin-freeze-check
Version: 0.1.0
Summary: Check if an address is frozen (blacklisted) by Tether or Circle: USDT on Ethereum and Tron, native USDC on six EVM chains. Reads the token contracts directly. Standard library only, no API key.
Author: Veriql
License-Expression: MIT
Project-URL: Homepage, https://veriql.app/usdt-freeze-checker
Project-URL: Documentation, https://dev.to/veriql/how-to-check-if-an-address-is-blacklisted-on-usdt-or-usdc-in-python-six-usdc-chains-plus-tron-no-215b
Project-URL: Bulk checker (Apify), https://apify.com/veriql/usdt-usdc-freeze-checker
Project-URL: Browser checker (Hugging Face), https://huggingface.co/spaces/veriql/usdt-freeze-checker
Keywords: usdt,usdc,tether,circle,stablecoin,blacklist,freeze,frozen,isBlackListed,isBlacklisted,tron,trc20,ethereum,erc20,base,arbitrum,compliance,cli
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Financial and Insurance Industry
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Topic :: Office/Business :: Financial
Classifier: Topic :: Security
Classifier: Topic :: Utilities
Classifier: Typing :: Typed
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: license-file

# stablecoin-freeze-check

Check whether an address is frozen (blacklisted) by Tether or Circle, straight from the token contracts.

| Token | Chains | Contract call |
|---|---|---|
| USDT | Ethereum | `isBlackListed(address)` on `0xdAC17F958D2ee523a2206206994597C13D831ec7` |
| USDT | Tron | `getBlackListStatus(address)` on `TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t` |
| USDC (native) | Ethereum, Base, Arbitrum, Optimism, Polygon, Avalanche | `isBlacklisted(address)` on each chain's Circle USDC contract |

The answer is the contract's own state at the latest block. Python 3.9+, standard library only, no API key.

```bash
pip install stablecoin-freeze-check
```

## CLI

```bash
stablecoin-freeze-check 0xYourAddress...
# {"address": "0x...", "chain": "ethereum", "usdt": false, "usdc": {"ethereum": false}}

stablecoin-freeze-check 0xYourAddress... --usdc-chains all
# {"address": "0x...", "chain": "ethereum", "usdt": false,
#  "usdc": {"ethereum": false, "base": false, "arbitrum": false, "optimism": false, "polygon": false, "avalanche": false}}

stablecoin-freeze-check TYourTronAddress...
# {"address": "T...", "chain": "tron", "usdt": false}
```

Pass several addresses to check them in order; each prints one JSON line. Exit code `0` means every check returned an answer. Exit code `1` means at least one did not (bad address or RPC error); the error is printed to stderr as JSON, or shown as `"error: ..."` for that USDC chain.

| Flag | Default | Use |
|---|---|---|
| `--usdc-chains` | `ethereum` | comma list (`base,arbitrum`) or `all` |
| `--rpc` | `https://ethereum-rpc.publicnode.com` | any Ethereum JSON-RPC URL |
| `--trongrid` | `https://api.trongrid.io` | TronGrid or a compatible node |
| `--tron-api-key` | none | TronGrid key for higher rate limits |
| `--timeout` | `20` | seconds per request |

`python -m stablecoin_freeze_check ...` works too.

## Library

```python
from stablecoin_freeze_check import (
    check_address,
    usdt_frozen_on_ethereum,
    usdt_frozen_on_tron,
    usdc_frozen,
    usdc_frozen_on_chains,
    usdc_frozen_batch,
)

check_address("0x...")                      # USDT + USDC on Ethereum
check_address("0x...", usdc_chains=None)    # USDT + USDC on all six chains
check_address("T...")                       # USDT on Tron

usdc_frozen("0x...", chain="base")          # True / False
usdc_frozen_on_chains("0x...")              # {"ethereum": False, "base": False, ...}
usdc_frozen_batch(["0x...", "0x..."], chain="arbitrum")  # one JSON-RPC batch request
usdt_frozen_on_tron("T...", api_key="...")  # optional TronGrid key
usdt_frozen_on_ethereum("0x...", rpc="https://your-node.example")
```

Also exported: `tron_to_hex20` (base58check decode with checksum check), `is_evm_address`, `is_tron_address`, `CONTRACTS`, `USDC_CHAINS`.

## Things to know

- **Spelling matters.** USDT uses `isBlackListed` (capital L), USDC uses `isBlacklisted`. Calling the wrong one reverts.
- **USDC is a proxy.** Calling the proxy address is correct; the call is forwarded to the current implementation.
- **Tron addresses are base58check.** The checksum is verified before calling TronGrid, so a typo raises an error instead of checking the wrong address.
- **An error is "unknown", never "not frozen".** `usdc_frozen_on_chains` reports a failed chain as `"error: ..."` instead of `False`.
- **Public endpoints rate-limit.** For batch jobs, pass your own RPC URLs and a TronGrid key.
- **`False` only means "not on this freeze list right now".** It says nothing about other chains, other tokens, sanctions lists or where the funds came from, and an address can be added at any time.
- **Not covered:** USDT on chains other than Ethereum and Tron, bridged USDC, and freeze history. For history, read the `AddedBlackList` / `Blacklisted` events.

## How it works

A tested walkthrough of the same code, step by step: [How to check if an address is blacklisted on USDT or USDC in Python (six USDC chains plus Tron)](https://dev.to/veriql/how-to-check-if-an-address-is-blacklisted-on-usdt-or-usdc-in-python-six-usdc-chains-plus-tron-no-215b).

No Python? The same checks run as a no-code bulk tool on Apify ([USDT & USDC Freeze Checker](https://apify.com/veriql/usdt-usdc-freeze-checker)) and in the browser on Hugging Face ([usdt-freeze-checker Space](https://huggingface.co/spaces/veriql/usdt-freeze-checker)).

## Who made this

Built by the Veriql team. [veriql.app](https://veriql.app/usdt-freeze-checker) has a free web checker, and its paid API ([veriql.app/api](https://veriql.app/api)) can watch Ethereum or Tron addresses and send a webhook when Tether freezes one. This package does not call Veriql; it only calls the RPC endpoints you give it (public ones by default).

## License

MIT
