Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
155 changes: 155 additions & 0 deletions skills/query-token-audit/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,155 @@
---
id: query-token-audit
name: Query Token Audit
description: Query token security audit details to detect scams, honeypots, malicious contract risks, and dangerous trading conditions before swapping.
category: Blockchain

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Invalid category value

The category field is set to Blockchain, which is not one of the valid values defined in CONTRIBUTING.md. The allowed values are: productivity, development, communication, writing, research, or other.

Despite the PR checklist marking this box as ✅, the value used does not conform to the schema. The PR checklist review system also flags this automatically per the repository's CI description.

The correct value for this skill would be other (or development, given it's an API integration skill).

Suggested change
category: Blockchain
category: other

author: binance-web3-team
version: 1.4.0
requires: []
examples:
- Check if this BSC token is safe before I buy it.
- Audit this Base token contract for honeypot and scam risk.
- Run a token security check on this Solana contract and summarize the risk items.
---
Comment on lines +1 to +13

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 External URLs in instructions (unchecked checklist item)

The PR checklist item "No external URLs referenced in instructions" is explicitly unchecked, and the skill does embed the live Binance endpoint URL directly in the instructions:

https://web3.binance.com/bapi/defi/v1/public/wallet-direct/security/token/audit

Per CONTRIBUTING.md guideline #3: "Don't reference external URLs — Skills should be self-contained."

For an API-integration skill this is somewhat unavoidable, but it's worth noting this is a deliberate deviation from the guidelines that may need explicit maintainer approval.


# Query Token Audit Skill

## Overview

| API | Function | Use Case |
|-----|----------|----------|
| Token Security Audit | Token security scan | Detect honeypot, rug pull, scam, malicious functions |

## Use Cases

1. **Pre-Trade Safety Check**: Verify token security before buying or swapping
2. **Scam Detection**: Identify honeypots, fake tokens, and malicious contracts
3. **Contract Analysis**: Check for dangerous ownership functions and hidden risks
4. **Tax Verification**: Detect unusual buy/sell taxes before trading

## Supported Chains

| Chain Name | chainId |
|------------|---------|
| BSC | 56 |
| Base | 8453 |
| Solana | CT_501 |
| Ethereum | 1 |

---

## API: Token Security Audit

### Method: POST

**URL**:
`https://web3.binance.com/bapi/defi/v1/public/wallet-direct/security/token/audit`

**Request Parameters**:

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| binanceChainId | string | Yes | Chain ID: `CT_501` (Solana), `56` (BSC), `8453` (Base), `1` (Ethereum) |
| contractAddress | string | Yes | Token contract address |
| requestId | string | Yes | Unique request ID (UUID v4 format) |

**Request Headers**:
```text
Content-Type: application/json
Accept-Encoding: identity
```
Comment on lines +56 to +60

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 source: agent header missing from documented headers

The "Request Headers" section (lines 56–60) only documents Content-Type and Accept-Encoding, but the example curl command on line 66 also sends a third header:

--header 'source: agent'

If source: agent is required or meaningful for the API to behave correctly, omitting it from the headers table is a documentation gap that will cause agents following only the table to send requests without it. Conversely, if it is optional or has no effect, it should be removed from the example to avoid confusion.

Please either add it to the headers table with a description of what it does, or remove it from the example request.


**Example Request**:
```bash
curl --location 'https://web3.binance.com/bapi/defi/v1/public/wallet-direct/security/token/audit' \
--header 'Content-Type: application/json' \
--header 'source: agent' \
--header 'Accept-Encoding: identity' \
--data '{
"binanceChainId": "56",
"contractAddress": "0x55d398326f99059ff775485246999027b3197955",
"requestId": "'$(uuidgen)'"
}'
```

**Response Example**:
```json
{
"code": "000000",
"data": {
"requestId": "d6727c70-de6c-4fad-b1d7-c05422d5f26b",
"hasResult": true,
"isSupported": true,
"riskLevelEnum": "LOW",
"riskLevel": 1,
"extraInfo": {
"buyTax": "0",
"sellTax": "0",
"isVerified": true
},
"riskItems": [
{
"id": "CONTRACT_RISK",
"name": "Contract Risk",
"details": [
{
"title": "Honeypot Risk Not Found",
"description": "A honeypot is a token that can be bought but not sold",
"isHit": false,
"riskType": "RISK"
}
]
}
]
},
"success": true
}
```

**Response Fields**:

| Field | Type | Description |
|-------|------|-------------|
| hasResult | boolean | Whether audit data is available |
| isSupported | boolean | Whether the token is supported for audit |
| riskLevelEnum | string | Risk level: `LOW`, `MEDIUM`, `HIGH` |
| riskLevel | number | Risk level number (1-5) |

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 riskLevel range description is inconsistent

The response field table documents riskLevel as number (1-5), but the Risk Level Reference table directly below it shows 0-1 as a valid range, implying riskLevel can be 0. An agent interpreting the field description literally would not handle a riskLevel: 0 response correctly (e.g., might treat it as an out-of-range/unexpected value).

Suggested change
| riskLevel | number | Risk level number (1-5) |
| riskLevel | number | Risk level number (0-5) |

| extraInfo.buyTax | string | Buy tax percentage (null if unknown) |
| extraInfo.sellTax | string | Sell tax percentage (null if unknown) |
| extraInfo.isVerified | boolean | Whether contract code is verified |
| riskItems[].id | string | Risk category: `CONTRACT_RISK`, `TRADE_RISK`, `SCAM_RISK` |
| riskItems[].details[].title | string | Risk check title |
| riskItems[].details[].description | string | Risk check description |
| riskItems[].details[].isHit | boolean | true = risk detected |
| riskItems[].details[].riskType | string | `RISK` (critical) or `CAUTION` (warning) |

**Risk Level Reference**:

| riskLevel | riskLevelEnum | Action | Description |
|-----------|---------------|--------|-------------|
| 0-1 | LOW | Proceed with caution | Lower risk detected, but not guaranteed safe. DYOR. |
| 2-3 | MEDIUM | Exercise caution | Moderate risks detected, review risk items carefully |
| 4 | HIGH | Avoid trading | Critical risks detected, high probability of loss |
| 5 | HIGH | Block transaction | Severe risks confirmed, do not proceed |

**IMPORTANT**: LOW risk does not mean "safe." Audit results are point-in-time snapshots. Project teams can modify contracts or restrict liquidity after purchase. These risks cannot be predicted in advance.

**Result Validity**:

Audit results are valid only when both conditions are met:
- `hasResult: true` - Audit data is available
- `isSupported: true` - Token is supported for audit

When invalid, do not display risk level or security checks.

---

## Notes

1. All numeric fields may be returned in string format; convert when needed
2. Audit results are valid only when `hasResult: true` and `isSupported: true`
3. `riskLevel: 5` means transaction should be blocked; `riskLevel: 4` is high risk
4. Tax thresholds: above 10% is critical, 5-10% is warning, below 5% is acceptable
5. Generate a unique UUID v4 for each audit request
6. Output only security check risk flags; do not provide investment advice
7. Always end with this disclaimer: `This audit result is for reference only and does not constitute investment advice. Always conduct your own research.`
Loading