UNPKG

token-sniffer-lite

Version:

Advanced configurable token sniffer for EVM chains with safety scoring

57 lines (47 loc) โ€ข 2.04 kB
# token-sniffer-lite (Advanced Developer Version) ๐Ÿง  A flexible, chain-agnostic tool to detect risky EVM token contracts using custom RPC and explorer config. ## ๐Ÿš€ Installation ```bash npm install token-sniffer-lite ``` ## โš™๏ธ usage ``` import { sniffToken } from "token-sniffer-lite"; const config = { rpcUrl: "https://bsc-dataseed.binance.org/", explorerApiKey: "YOUR_BSCSCAN_API_KEY", explorerApiBase: "https://api.bscscan.com/api", chainName: "bsc" // Optional }; const address = "0xabc123..."; // Token contract address const result = await sniffToken(address, config); console.log(result); ``` ## ๐Ÿงช Example Output ``` { "isVerified": true, "hasBlacklist": false, "canMint": true, "hasHiddenFees": true, "honeypotRisk": false, "ownerControlsAll": true, "isRenounced": false, "liquidityLocked": false, "score": 30 } ``` ## What it Checks ``` | Feature | Description | | ------------------ | ------------------------------------------------------------------------- | | `isVerified` | Checks if contract is verified on explorer (Etherscan, BscScan, etc.) | | `canMint` | Flags if the contract has public minting functions | | `hasBlacklist` | Checks for blacklist functions that can restrict users | | `hasHiddenFees` | Flags presence of tax/fee setter functions (`setFee()`, `setTax()`, etc.) | | `honeypotRisk` | Simulates a `transfer()` to detect honeypots (buy-only traps) | | `ownerControlsAll` | Owner has permission to mint, blacklist, tax, etc. | | `isRenounced` | Checks if contract ownership has been renounced | | `liquidityLocked` | ๐Ÿ”ง Not implemented yet โ€” will check LP lock/burn | | `score` | Final score out of 100 (higher = safer) | ```