本文へスキップ
Skillpedia
セキュリティ8.0k · #12665

token-integration-analyzer

できること

トークンのコントラクトとその連携について、規格への適合性と、既知の珍しいトークンの振る舞いを分析します。トークンを作る開発者や、任意のトークンを受け入れるプロトコルを作る開発者向けです。

使う場面

  • ✓開発者が、ERC20またはERC721のトークンを作っていて、規格に従っているかを確認したいとき。
  • ✓チームが、任意のトークンを連携または受け入れていて、珍しいトークンを安全に扱いたいとき。
  • ✓監査人が、デプロイ済みのコントラクトについて、オーナーの権限やトークンの希少性を確認したいとき。

スキルのリンク

https://github.com/trailofbits/skills/blob/main/plugins/building-secure-contracts/skills/token-integration-analyzer/SKILL.md

コピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。

使い方

いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。

貼り付け用メッセージ

このスキルを使って手伝ってください:https://github.com/trailofbits/skills/blob/main/plugins/building-secure-contracts/skills/token-integration-analyzer/SKILL.md このリンクのSKILL.mdファイルを読んで、私の作業でその指示に従ってください。
こういうスキルを、AIが自分で見つけてくれたら?無料のSkillpedia MCPをインストール。1行で、作業の前に15,000+のスキルから探してくれます。1分でインストール →

AIへの頼み方の例

“私のプロトコルは任意のERC20トークンを受け入れます。通常のルールを壊す珍しいトークンをどう扱っているか確認してください。”

毎週5つの新しいスキル。1分で読めます。

仕組み

このスキルは、トークンのコードを読み、20を超える既知の珍しいトークンのパターンと照らし合わせます。オーナーの権限も確認します。デプロイ済みのコントラクトに対しては、供給量や設定の詳細を照会することもできます。

技術的な内容(元のSKILL.md)

作者による元のテキスト(英語)をGitHubからそのまま表示しています。

Token Integration Analyzer

Purpose

Systematically analyzes the codebase for token-related security concerns using Trail of Bits' token integration checklist:

  1. Token Implementations: Analyze if your token follows ERC20/ERC721 standards or has non-standard behavior
  2. Token Integrations: Analyze how your protocol handles arbitrary tokens, including weird/non-standard tokens
  3. On-chain Analysis: Query deployed contracts for scarcity, distribution, and configuration
  4. Security Assessment: Identify risks from 20+ known weird token patterns

Framework: Building Secure Contracts - Token Integration Checklist + Weird ERC20 Database


How This Works

Phase 1: Context Discovery

Determines analysis context:

  • Token implementation: Are you building a token contract?
  • Token integration: Does your protocol interact with external tokens?
  • Platform: Ethereum, other EVM chains, or different platform?
  • Token types: ERC20, ERC721, or both?

Phase 2: Slither Analysis (if Solidity)

For Solidity projects, I'll help run:

  • slither-check-erc - ERC conformity checks
  • slither --print human-summary - Complexity and upgrade analysis
  • slither --print contract-summary - Function analysis
  • slither-prop - Property generation for testing

Phase 3: Code Analysis

Analyzes:

  • Contract composition and complexity
  • Owner privileges and centralization risks
  • ERC20/ERC721 conformity
  • Known weird token patterns
  • Integration safety patterns

Phase 4: On-chain Analysis (if deployed)

If you provide a contract address, I'll query:

  • Token scarcity and distribution
  • Total supply and holder concentration
  • Exchange listings
  • On-chain configuration

Phase 5: Risk Assessment

Provides:

  • Identified vulnerabilities
  • Non-standard behaviors
  • Integration risks
  • Prioritized recommendations

Assessment Categories

I check 10 comprehensive categories covering all aspects of token security. For detailed criteria, patterns, and checklists, see ASSESSMENT_CATEGORIES.md.

Quick Reference:

  1. General Considerations - Security reviews, team transparency, security contacts
  2. Contract Composition - Complexity analysis, SafeMath usage, function count, entry points
  3. Owner Privileges - Upgradeability, minting, pausability, blacklisting, team accountability
  4. ERC20 Conformity - Return values, metadata, decimals, race conditions, Slither checks
  5. ERC20 Extension Risks - External calls/hooks, transfer fees, rebasing/yield-bearing tokens
  6. Token Scarcity Analysis - Supply distribution, holder concentration, exchange distribution, flash loan/mint risks
  7. Weird ERC20 Patterns (24 patterns including):
    • Reentrant calls (ERC777 hooks)
    • Missing return values (USDT, BNB, OMG)
    • Fee on transfer (STA, PAXG)
    • Balance modifications outside transfers (Ampleforth, Compound)
    • Upgradable tokens (USDC, USDT)
    • Flash mintable (DAI)
    • Blocklists (USDC, USDT)
    • Pausable tokens (BNB, ZIL)
    • Approval race protections (USDT, KNC)
    • Revert on approval/transfer to zero address
    • Revert on zero value approvals/transfers
    • Multiple token addresses
    • Low decimals (USDC: 6, Gemini: 2)
    • High decimals (YAM-V2: 24)
    • transferFrom with src == msg.sender
    • Non-string metadata (MKR)
    • No revert on failure (ZRX, EURS)
    • Revert on large approvals (UNI, COMP)
    • Code injection via token name
    • Unusual permit function (DAI, RAI, GLM)
    • Transfer less than amount (cUSDCv3)
    • ERC-20 native currency representation (Celo, Polygon, zkSync)
    • And more...
  8. Token Integration Safety - Safe transfer patterns, balance verification, allowlists, wrappers, defensive patterns
  9. ERC721 Conformity - Transfer to 0x0, safeTransferFrom, metadata, ownerOf, approval clearing, token ID immutability
  10. ERC721 Common Risks - onERC721Received reentrancy, safe minting, burning approval clearing

Example Output

When analysis is complete, you'll receive a comprehensive report structured as follows:

=== TOKEN INTEGRATION ANALYSIS REPORT ===

Project: MultiToken DEX
Token Analyzed: Custom Reward Token + Integration Safety
Platform: Solidity 0.8.20
Analysis Date: March 15, 2024

---

## EXECUTIVE SUMMARY

Token Type: ERC20 Implementation + Protocol Integrating External Tokens
Overall Risk Level: MEDIUM
Critical Issue
よくある質問

珍しいトークンとは何ですか?

規格どおりに動かないトークンのことです。例えば、通常と異なる転送ルールを持つものがあります。このスキルは20を超える既知のパターンを確認します。

デプロイ済みのトークンも確認しますか?

はい。オンチェーンの希少性、配布、設定を分析できます。

Solidityだけに対応していますか?

主にEthereumとその他のEVMチェーンを対象としており、Solidityプロジェクトの場合はSlitherツールを使えます。

詳細

作者による元の説明

Token integration and implementation analyzer based on Trail of Bits' token integration checklist. Analyzes token implementations for ERC20/ERC721 conformity, checks for 20+ weird token patterns, assesses contract composition and owner privileges, performs on-chain scarcity analysis, and evaluates how protocols handle non-standard tokens. Use when integrating or accepting arbitrary ERC20/ERC721 tokens, auditing a token implementation for standards conformity, or assessing risk from weird tokens such as fee-on-transfer, rebasing, missing return values, or blocklists.

repo: trailofbits/skills

人気

GitHubのスター
8.0k
ランキング
#12665
ライセンス
CC-BY-SA-4.0
更新日
2026/11/2

このスキルは役に立ちますか?

0

ログイン して投票しましょう。

コメント

  • …

このリポジトリの他のスキル

似ているスキル