[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M75K75S590T4M2G775Q73WCY":3,"skill-same:01M75K75S590T4M2G775Q73WCY":56},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":18,"linkOnly":19,"markdownContent":20,"markdownBody":21,"frontMatter":22,"refName":23,"commitSha":24,"skillDirectory":25,"forksCount":26,"repositoryHtmlUrl":27,"repositoryHomepageUrl":28,"ownerHtmlUrl":29,"ownerBlogUrl":30,"ownerDescription":6,"updatedAt":31,"install":32,"resources":45},"01M75K75S590T4M2G775Q73WCY","token-integration-analyzer",null,"Token integration and implementation analyzer based on Trail of Bits' token integration checklist. Analyzes token implementations for ERC20\u002FERC721 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. Context-aware for both token implementations and token integrations.","agisota\u002Fold-one","agisota","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F121413592?v=4","01M75B4BRNT67EC1NDRT8QZEP2","01M75B4BS7QR9VP580MSCPTS3X",3,"MIT","https:\u002F\u002Fgithub.com\u002Fagisota\u002Fold-one\u002Fblob\u002Fmain\u002Fskills\u002Ftoken-integration-analyzer\u002FSKILL.md",[],[],"2026-11-12 13:55:43",false,"---\nname: token-integration-analyzer\ndescription: Token integration and implementation analyzer based on Trail of Bits' token integration checklist. Analyzes token implementations for ERC20\u002FERC721 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. Context-aware for both token implementations and token integrations.\n---\n\n# Token Integration Analyzer\n\n## Purpose\n\nSystematically analyzes the codebase for token-related security concerns using Trail of Bits' token integration checklist:\n\n1. **Token Implementations**: Analyze if your token follows ERC20\u002FERC721 standards or has non-standard behavior\n2. **Token Integrations**: Analyze how your protocol handles arbitrary tokens, including weird\u002Fnon-standard tokens\n3. **On-chain Analysis**: Query deployed contracts for scarcity, distribution, and configuration\n4. **Security Assessment**: Identify risks from 20+ known weird token patterns\n\n**Framework**: Building Secure Contracts - Token Integration Checklist + Weird ERC20 Database\n\n---\n\n## How This Works\n\n### Phase 1: Context Discovery\nDetermines analysis context:\n- **Token implementation**: Are you building a token contract?\n- **Token integration**: Does your protocol interact with external tokens?\n- **Platform**: Ethereum, other EVM chains, or different platform?\n- **Token types**: ERC20, ERC721, or both?\n\n### Phase 2: Slither Analysis (if Solidity)\nFor Solidity projects, I'll help run:\n- `slither-check-erc` - ERC conformity checks\n- `slither --print human-summary` - Complexity and upgrade analysis\n- `slither --print contract-summary` - Function analysis\n- `slither-prop` - Property generation for testing\n\n### Phase 3: Code Analysis\nAnalyzes:\n- Contract composition and complexity\n- Owner privileges and centralization risks\n- ERC20\u002FERC721 conformity\n- Known weird token patterns\n- Integration safety patterns\n\n### Phase 4: On-chain Analysis (if deployed)\nIf you provide a contract address, I'll query:\n- Token scarcity and distribution\n- Total supply and holder concentration\n- Exchange listings\n- On-chain configuration\n\n### Phase 5: Risk Assessment\nProvides:\n- Identified vulnerabilities\n- Non-standard behaviors\n- Integration risks\n- Prioritized recommendations\n\n---\n\n## Assessment Categories\n\nI check 10 comprehensive categories covering all aspects of token security. For detailed criteria, patterns, and checklists, see [ASSESSMENT_CATEGORIES.md](resources\u002FASSESSMENT_CATEGORIES.md).\n\n### Quick Reference:\n\n1. **General Considerations** - Security reviews, team transparency, security contacts\n2. **Contract Composition** - Complexity analysis, SafeMath usage, function count, entry points\n3. **Owner Privileges** - Upgradeability, minting, pausability, blacklisting, team accountability\n4. **ERC20 Conformity** - Return values, metadata, decimals, race conditions, Slither checks\n5. **ERC20 Extension Risks** - External calls\u002Fhooks, transfer fees, rebasing\u002Fyield-bearing tokens\n6. **Token Scarcity Analysis** - Supply distribution, holder concentration, exchange distribution, flash loan\u002Fmint risks\n7. **Weird ERC20 Patterns** (24 patterns including):\n   - Reentrant calls (ERC777 hooks)\n   - Missing return values (USDT, BNB, OMG)\n   - Fee on transfer (STA, PAXG)\n   - Balance modifications outside transfers (Ampleforth, Compound)\n   - Upgradable tokens (USDC, USDT)\n   - Flash mintable (DAI)\n   - Blocklists (USDC, USDT)\n   - Pausable tokens (BNB, ZIL)\n   - Approval race protections (USDT, KNC)\n   - Revert on approval\u002Ftransfer to zero address\n   - Revert on zero value approvals\u002Ftransfers\n   - Multiple token addresses\n   - Low decimals (USDC: 6, Gemini: 2)\n   - High decimals (YAM-V2: 24)\n   - transferFrom with src == msg.sender\n   - Non-string metadata (MKR)\n   - No revert on failure (ZRX, EURS)\n   - Revert on large approvals (UNI, COMP)\n   - Code injection via token name\n   - Unusual permit function (DAI, RAI, GLM)\n   - Transfer less than amount (cUSDCv3)\n   - ERC-20 native currency representation (Celo, Polygon, zkSync)\n   - [And more...](resources\u002FASSESSMENT_CATEGORIES.md#7-weird-erc20-patterns)\n8. **Token Integration Safety** - Safe transfer patterns, balance verification, allowlists, wrappers, defensive patterns\n9. **ERC721 Conformity** - Transfer to 0x0, safeTransferFrom, metadata, ownerOf, approval clearing, token ID immutability\n10. **ERC721 Common Risks** - onERC721Received reentrancy, safe minting, burning approval clearing\n\n---\n\n## Example Output\n\nWhen analysis is complete, you'll receive a comprehensive report structured as follows:\n\n```\n=== TOKEN INTEGRATION ANALYSIS REPORT ===\n\nProject: MultiToken DEX\nToken Analyzed: Custom Reward Token + Integration Safety\nPlatform: Solidity 0.8.20\nAnalysis Date: March 15, 2024\n\n---\n\n## EXECUTIVE SUMMARY\n\nToken Type: ERC20 Implementation + Protocol Integrating External Tokens\nOverall Risk Level: MEDIUM\nCritical Issues: 2\nHigh Issues: 3\nMedium Issues: 4\n\n**Top Concerns:**\n⚠ Fee-on-transfer tokens not handled correctly\n⚠ No validation for missing return values (USDT compatibility)\n⚠ Owner can mint unlimited tokens without cap\n\n**Recommendation:** Address critical\u002Fhigh issues before mainnet launch.\n\n---\n\n## 1. GENERAL CONSIDERATIONS\n\n✓ Contract audited by CertiK (June 2023)\n✓ Team contactable via security@project.com\n✗ No security mailing list for critical announcements\n\n**Risk:** Users won't be notified of critical issues\n**Action:** Set up security@project.com mailing list\n\n---\n\n## 2. CONTRACT COMPOSITION\n\n### Complexity Analysis\n\n**Slither human-summary Results:**\n- 456 lines of code\n- Cyclomatic complexity: Average 6, Max 14 (transferWithFee())\n- 12 functions, 8 state variables\n- Inheritance depth: 3 (moderate)\n\n✓ Contract complexity is reasonable\n⚠ transferWithFee() complexity high (14) - consider splitting\n\n### SafeMath Usage\n\n✓ Using Solidity 0.8.20 (built-in overflow protection)\n✓ No unchecked blocks found\n✓ All arithmetic operations protected\n\n### Non-Token Functions\n\n**Functions Beyond ERC20:**\n- setFeeCollector() - Admin function ✓\n- setTransferFee() - Admin function ✓\n- withdrawFees() - Admin function ✓\n- pause()\u002Funpause() - Emergency functions ✓\n\n⚠ 4 non-token functions (acceptable but adds complexity)\n\n### Address Entry Points\n\n✓ Single contract address\n✓ No proxy with multiple entry points\n✓ No token migration creating address confusion\n\n**Status:** PASS\n\n---\n\n## 3. OWNER PRIVILEGES\n\n### Upgradeability\n\n⚠ Contract uses TransparentUpgradeableProxy\n**Risk:** Owner can change contract logic at any time\n\n**Current Implementation:**\n- ProxyAdmin: 0x1234... (2\u002F3 multisig) ✓\n- Timelock: None ✗\n\n**Recommendation:** Add 48-hour timelock to all upgrades\n\n### Minting Capabilities\n\n❌ CRITICAL: Unlimited minting\nFile: contracts\u002FRewardToken.sol:89\n```solidity\nfunction mint(address to, uint256 amount) external onlyOwner {\n    _mint(to, amount);  \u002F\u002F No cap!\n}\n```\n\n**Risk:** Owner can inflate supply arbitrarily\n**Fix:** Add maximum supply cap or rate-limited minting\n\n### Pausability\n\n✓ Pausable pattern implemented (OpenZeppelin)\n✓ Only owner can pause\n⚠ Paused state affects all transfers (including existing holders)\n\n**Risk:** Owner can trap all user funds\n**Mitigation:** Use multi-sig for pause function (already implemented ✓)\n\n### Blacklisting\n\n✗ No blacklist functionality\n**Assessment:** Good - no centralized censorship risk\n\n### Team Transparency\n\n✓ Team members public (team.md)\n✓ Company registered in Switzerland\n✓ Accountable and contactable\n\n**Status:** ACCEPTABLE\n\n---\n\n## 4. ERC20 CONFORMITY\n\n### Slither-check-erc Results\n\nCommand: slither-check-erc . RewardToken --erc erc20\n\n✓ transfer returns bool\n✓ transferFrom returns bool\n✓ name, decimals, symbol present\n✓ decimals returns uint8 (value: 18)\n✓ Race condition mitigated (increaseAllowance\u002FdecreaseAllowance)\n\n**Status:** FULLY COMPLIANT\n\n### slither-prop Test Results\n\nCommand: slither-prop . --contract RewardToken\n\n**Generated 12 properties, all passed:**\n✓ Transfer doesn't change total supply\n✓ Allowance correctly updates\n✓ Balance updates match transfer amounts\n✓ No balance manipulation possible\n[... 8 more properties ...]\n\n**Echidna fuzzing:** 50,000 runs, no violations ✓\n\n**Status:** EXCELLENT\n\n---\n\n## 5. WEIRD TOKEN PATTERN ANALYSIS\n\n### Integration Safety Check\n\n**Your Protocol Integrates 5 External Tokens:**\n1. USDT (0xdac17f9...)\n2. USDC (0xa0b86991...)\n3. DAI (0x6b175474...)\n4. WETH (0xc02aaa39...)\n5. UNI (0x1f9840a8...)\n\n### Critical Issues Found\n\n❌ **Pattern 7.2: Missing Return Values**\n**Found in:** USDT integration\nFile: contracts\u002FVault.sol:156\n```solidity\nIERC20(usdt).transferFrom(msg.sender, address(this), amount);\n\u002F\u002F No return value check! USDT doesn't return bool\n```\n\n**Risk:** Silent failures on USDT transfers\n**Exploit:** User appears to deposit, but no tokens moved\n**Fix:** Use OpenZeppelin SafeERC20 wrapper\n\n---\n\n❌ **Pattern 7.3: Fee on Transfer**\n**Risk for:** Any token with transfer fees\nFile: contracts\u002FVault.sol:170\n```solidity\nuint256 balanceBefore = IERC20(token).balanceOf(address(this));\ntoken.transferFrom(msg.sender, address(this), amount);\nshares = amount * exchangeRate;  \u002F\u002F WRONG! Should use actual received amount\n```\n\n**Risk:** Accounting mismatch if token takes fees\n**Exploit:** User credited more shares than tokens deposited\n**Fix:** Calculate shares from `balanceAfter - balanceBefore`\n\n---\n\n### Known Non-Standard Token Handling\n\n✓ **USDC:** Properly handled (SafeERC20, 6 decimals accounted for)\n⚠ **DAI:** permit() function not used (opportunity for gas savings)\n✗ **USDT:** Missing return value not handled (CRITICAL)\n✓ **WETH:** Standard wrapper, properly handled\n⚠ **UNI:** Large approval handling not checked (reverts >= 2^96)\n\n---\n\n[... Additional sections for remaining analysis categories ...]\n```\n\nFor complete report template and deliverables format, see [REPORT_TEMPLATES.md](resources\u002FREPORT_TEMPLATES.md).\n\n---\n\n## Rationalizations (Do Not Skip)\n\n| Rationalization | Why It's Wrong | Required Action |\n|-----------------|----------------|-----------------|\n| \"Token looks standard, ERC20 checks pass\" | 20+ weird token patterns exist beyond ERC20 compliance | Check ALL weird token patterns from database (missing return, revert on zero, hooks, etc.) |\n| \"Slither shows no issues, integration is safe\" | Slither detects some patterns, misses integration logic | Complete manual analysis of all 5 token integration criteria |\n| \"No fee-on-transfer detected, skip that check\" | Fee-on-transfer can be owner-controlled or conditional | Test all transfer scenarios, check for conditional fee logic |\n| \"Balance checks exist, handling is safe\" | Balance checks alone don't protect against all weird tokens | Verify safe transfer wrappers, revert handling, approval patterns |\n| \"Token is deployed by reputable team, assume standard\" | Reputation doesn't guarantee standard behavior | Analyze actual code and on-chain behavior, don't trust assumptions |\n| \"Integration uses OpenZeppelin, must be safe\" | OpenZeppelin libraries don't protect against weird external tokens | Verify defensive patterns around all external token calls |\n| \"Can't run Slither, skipping automated analysis\" | Slither provides critical ERC conformance checks | Manually verify all slither-check-erc criteria or document why blocked |\n| \"This pattern seems fine\" | Intuition misses subtle token integration bugs | Systematically check all 20+ weird token patterns with code evidence |\n\n---\n\n## Deliverables\n\nWhen analysis is complete, I'll provide:\n\n1. **Compliance Checklist** - Checkboxes for all assessment categories\n2. **Weird Token Pattern Analysis** - Presence\u002Fabsence of all 24 patterns with risk levels and evidence\n3. **On-chain Analysis Report** (if applicable) - Holder distribution, exchange listings, configuration\n4. **Integration Safety Assessment** (if applicable) - Safe transfer usage, defensive patterns, weird token handling\n5. **Prioritized Recommendations** - CRITICAL\u002FHIGH\u002FMEDIUM\u002FLOW issues with specific fixes\n\nComplete deliverable templates available in [REPORT_TEMPLATES.md](resources\u002FREPORT_TEMPLATES.md).\n\n---\n\n## Ready to Begin\n\n**What I'll need**:\n- Your codebase\n- Context: Token implementation or integration?\n- Token type: ERC20, ERC721, or both?\n- Contract address (if deployed and want on-chain analysis)\n- RPC endpoint (if querying on-chain)\n\nLet's analyze your token implementation or integration for security risks!\n","# Token Integration Analyzer\n\n## Purpose\n\nSystematically analyzes the codebase for token-related security concerns using Trail of Bits' token integration checklist:\n\n1. **Token Implementations**: Analyze if your token follows ERC20\u002FERC721 standards or has non-standard behavior\n2. **Token Integrations**: Analyze how your protocol handles arbitrary tokens, including weird\u002Fnon-standard tokens\n3. **On-chain Analysis**: Query deployed contracts for scarcity, distribution, and configuration\n4. **Security Assessment**: Identify risks from 20+ known weird token patterns\n\n**Framework**: Building Secure Contracts - Token Integration Checklist + Weird ERC20 Database\n\n---\n\n## How This Works\n\n### Phase 1: Context Discovery\nDetermines analysis context:\n- **Token implementation**: Are you building a token contract?\n- **Token integration**: Does your protocol interact with external tokens?\n- **Platform**: Ethereum, other EVM chains, or different platform?\n- **Token types**: ERC20, ERC721, or both?\n\n### Phase 2: Slither Analysis (if Solidity)\nFor Solidity projects, I'll help run:\n- `slither-check-erc` - ERC conformity checks\n- `slither --print human-summary` - Complexity and upgrade analysis\n- `slither --print contract-summary` - Function analysis\n- `slither-prop` - Property generation for testing\n\n### Phase 3: Code Analysis\nAnalyzes:\n- Contract composition and complexity\n- Owner privileges and centralization risks\n- ERC20\u002FERC721 conformity\n- Known weird token patterns\n- Integration safety patterns\n\n### Phase 4: On-chain Analysis (if deployed)\nIf you provide a contract address, I'll query:\n- Token scarcity and distribution\n- Total supply and holder concentration\n- Exchange listings\n- On-chain configuration\n\n### Phase 5: Risk Assessment\nProvides:\n- Identified vulnerabilities\n- Non-standard behaviors\n- Integration risks\n- Prioritized recommendations\n\n---\n\n## Assessment Categories\n\nI check 10 comprehensive categories covering all aspects of token security. For detailed criteria, patterns, and checklists, see [ASSESSMENT_CATEGORIES.md](resources\u002FASSESSMENT_CATEGORIES.md).\n\n### Quick Reference:\n\n1. **General Considerations** - Security reviews, team transparency, security contacts\n2. **Contract Composition** - Complexity analysis, SafeMath usage, function count, entry points\n3. **Owner Privileges** - Upgradeability, minting, pausability, blacklisting, team accountability\n4. **ERC20 Conformity** - Return values, metadata, decimals, race conditions, Slither checks\n5. **ERC20 Extension Risks** - External calls\u002Fhooks, transfer fees, rebasing\u002Fyield-bearing tokens\n6. **Token Scarcity Analysis** - Supply distribution, holder concentration, exchange distribution, flash loan\u002Fmint risks\n7. **Weird ERC20 Patterns** (24 patterns including):\n   - Reentrant calls (ERC777 hooks)\n   - Missing return values (USDT, BNB, OMG)\n   - Fee on transfer (STA, PAXG)\n   - Balance modifications outside transfers (Ampleforth, Compound)\n   - Upgradable tokens (USDC, USDT)\n   - Flash mintable (DAI)\n   - Blocklists (USDC, USDT)\n   - Pausable tokens (BNB, ZIL)\n   - Approval race protections (USDT, KNC)\n   - Revert on approval\u002Ftransfer to zero address\n   - Revert on zero value approvals\u002Ftransfers\n   - Multiple token addresses\n   - Low decimals (USDC: 6, Gemini: 2)\n   - High decimals (YAM-V2: 24)\n   - transferFrom with src == msg.sender\n   - Non-string metadata (MKR)\n   - No revert on failure (ZRX, EURS)\n   - Revert on large approvals (UNI, COMP)\n   - Code injection via token name\n   - Unusual permit function (DAI, RAI, GLM)\n   - Transfer less than amount (cUSDCv3)\n   - ERC-20 native currency representation (Celo, Polygon, zkSync)\n   - [And more...](resources\u002FASSESSMENT_CATEGORIES.md#7-weird-erc20-patterns)\n8. **Token Integration Safety** - Safe transfer patterns, balance verification, allowlists, wrappers, defensive patterns\n9. **ERC721 Conformity** - Transfer to 0x0, safeTransferFrom, metadata, ownerOf, approval clearing, token ID immutability\n10. **ERC721 Common Risks** - onERC721Received reentrancy, safe minting, burning approval clearing\n\n---\n\n## Example Output\n\nWhen analysis is complete, you'll receive a comprehensive report structured as follows:\n\n```\n=== TOKEN INTEGRATION ANALYSIS REPORT ===\n\nProject: MultiToken DEX\nToken Analyzed: Custom Reward Token + Integration Safety\nPlatform: Solidity 0.8.20\nAnalysis Date: March 15, 2024\n\n---\n\n## EXECUTIVE SUMMARY\n\nToken Type: ERC20 Implementation + Protocol Integrating External Tokens\nOverall Risk Level: MEDIUM\nCritical Issues: 2\nHigh Issues: 3\nMedium Issues: 4\n\n**Top Concerns:**\n⚠ Fee-on-transfer tokens not handled correctly\n⚠ No validation for missing return values (USDT compatibility)\n⚠ Owner can mint unlimited tokens without cap\n\n**Recommendation:** Address critical\u002Fhigh issues before mainnet launch.\n\n---\n\n## 1. GENERAL CONSIDERATIONS\n\n✓ Contract audited by CertiK (June 2023)\n✓ Team contactable via security@project.com\n✗ No security mailing list for critical announcements\n\n**Risk:** Users won't be notified of critical issues\n**Action:** Set up security@project.com mailing list\n\n---\n\n## 2. CONTRACT COMPOSITION\n\n### Complexity Analysis\n\n**Slither human-summary Results:**\n- 456 lines of code\n- Cyclomatic complexity: Average 6, Max 14 (transferWithFee())\n- 12 functions, 8 state variables\n- Inheritance depth: 3 (moderate)\n\n✓ Contract complexity is reasonable\n⚠ transferWithFee() complexity high (14) - consider splitting\n\n### SafeMath Usage\n\n✓ Using Solidity 0.8.20 (built-in overflow protection)\n✓ No unchecked blocks found\n✓ All arithmetic operations protected\n\n### Non-Token Functions\n\n**Functions Beyond ERC20:**\n- setFeeCollector() - Admin function ✓\n- setTransferFee() - Admin function ✓\n- withdrawFees() - Admin function ✓\n- pause()\u002Funpause() - Emergency functions ✓\n\n⚠ 4 non-token functions (acceptable but adds complexity)\n\n### Address Entry Points\n\n✓ Single contract address\n✓ No proxy with multiple entry points\n✓ No token migration creating address confusion\n\n**Status:** PASS\n\n---\n\n## 3. OWNER PRIVILEGES\n\n### Upgradeability\n\n⚠ Contract uses TransparentUpgradeableProxy\n**Risk:** Owner can change contract logic at any time\n\n**Current Implementation:**\n- ProxyAdmin: 0x1234... (2\u002F3 multisig) ✓\n- Timelock: None ✗\n\n**Recommendation:** Add 48-hour timelock to all upgrades\n\n### Minting Capabilities\n\n❌ CRITICAL: Unlimited minting\nFile: contracts\u002FRewardToken.sol:89\n```solidity\nfunction mint(address to, uint256 amount) external onlyOwner {\n    _mint(to, amount);  \u002F\u002F No cap!\n}\n```\n\n**Risk:** Owner can inflate supply arbitrarily\n**Fix:** Add maximum supply cap or rate-limited minting\n\n### Pausability\n\n✓ Pausable pattern implemented (OpenZeppelin)\n✓ Only owner can pause\n⚠ Paused state affects all transfers (including existing holders)\n\n**Risk:** Owner can trap all user funds\n**Mitigation:** Use multi-sig for pause function (already implemented ✓)\n\n### Blacklisting\n\n✗ No blacklist functionality\n**Assessment:** Good - no centralized censorship risk\n\n### Team Transparency\n\n✓ Team members public (team.md)\n✓ Company registered in Switzerland\n✓ Accountable and contactable\n\n**Status:** ACCEPTABLE\n\n---\n\n## 4. ERC20 CONFORMITY\n\n### Slither-check-erc Results\n\nCommand: slither-check-erc . RewardToken --erc erc20\n\n✓ transfer returns bool\n✓ transferFrom returns bool\n✓ name, decimals, symbol present\n✓ decimals returns uint8 (value: 18)\n✓ Race condition mitigated (increaseAllowance\u002FdecreaseAllowance)\n\n**Status:** FULLY COMPLIANT\n\n### slither-prop Test Results\n\nCommand: slither-prop . --contract RewardToken\n\n**Generated 12 properties, all passed:**\n✓ Transfer doesn't change total supply\n✓ Allowance correctly updates\n✓ Balance updates match transfer amounts\n✓ No balance manipulation possible\n[... 8 more properties ...]\n\n**Echidna fuzzing:** 50,000 runs, no violations ✓\n\n**Status:** EXCELLENT\n\n---\n\n## 5. WEIRD TOKEN PATTERN ANALYSIS\n\n### Integration Safety Check\n\n**Your Protocol Integrates 5 External Tokens:**\n1. USDT (0xdac17f9...)\n2. USDC (0xa0b86991...)\n3. DAI (0x6b175474...)\n4. WETH (0xc02aaa39...)\n5. UNI (0x1f9840a8...)\n\n### Critical Issues Found\n\n❌ **Pattern 7.2: Missing Return Values**\n**Found in:** USDT integration\nFile: contracts\u002FVault.sol:156\n```solidity\nIERC20(usdt).transferFrom(msg.sender, address(this), amount);\n\u002F\u002F No return value check! USDT doesn't return bool\n```\n\n**Risk:** Silent failures on USDT transfers\n**Exploit:** User appears to deposit, but no tokens moved\n**Fix:** Use OpenZeppelin SafeERC20 wrapper\n\n---\n\n❌ **Pattern 7.3: Fee on Transfer**\n**Risk for:** Any token with transfer fees\nFile: contracts\u002FVault.sol:170\n```solidity\nuint256 balanceBefore = IERC20(token).balanceOf(address(this));\ntoken.transferFrom(msg.sender, address(this), amount);\nshares = amount * exchangeRate;  \u002F\u002F WRONG! Should use actual received amount\n```\n\n**Risk:** Accounting mismatch if token takes fees\n**Exploit:** User credited more shares than tokens deposited\n**Fix:** Calculate shares from `balanceAfter - balanceBefore`\n\n---\n\n### Known Non-Standard Token Handling\n\n✓ **USDC:** Properly handled (SafeERC20, 6 decimals accounted for)\n⚠ **DAI:** permit() function not used (opportunity for gas savings)\n✗ **USDT:** Missing return value not handled (CRITICAL)\n✓ **WETH:** Standard wrapper, properly handled\n⚠ **UNI:** Large approval handling not checked (reverts >= 2^96)\n\n---\n\n[... Additional sections for remaining analysis categories ...]\n```\n\nFor complete report template and deliverables format, see [REPORT_TEMPLATES.md](resources\u002FREPORT_TEMPLATES.md).\n\n---\n\n## Rationalizations (Do Not Skip)\n\n| Rationalization | Why It's Wrong | Required Action |\n|-----------------|----------------|-----------------|\n| \"Token looks standard, ERC20 checks pass\" | 20+ weird token patterns exist beyond ERC20 compliance | Check ALL weird token patterns from database (missing return, revert on zero, hooks, etc.) |\n| \"Slither shows no issues, integration is safe\" | Slither detects some patterns, misses integration logic | Complete manual analysis of all 5 token integration criteria |\n| \"No fee-on-transfer detected, skip that check\" | Fee-on-transfer can be owner-controlled or conditional | Test all transfer scenarios, check for conditional fee logic |\n| \"Balance checks exist, handling is safe\" | Balance checks alone don't protect against all weird tokens | Verify safe transfer wrappers, revert handling, approval patterns |\n| \"Token is deployed by reputable team, assume standard\" | Reputation doesn't guarantee standard behavior | Analyze actual code and on-chain behavior, don't trust assumptions |\n| \"Integration uses OpenZeppelin, must be safe\" | OpenZeppelin libraries don't protect against weird external tokens | Verify defensive patterns around all external token calls |\n| \"Can't run Slither, skipping automated analysis\" | Slither provides critical ERC conformance checks | Manually verify all slither-check-erc criteria or document why blocked |\n| \"This pattern seems fine\" | Intuition misses subtle token integration bugs | Systematically check all 20+ weird token patterns with code evidence |\n\n---\n\n## Deliverables\n\nWhen analysis is complete, I'll provide:\n\n1. **Compliance Checklist** - Checkboxes for all assessment categories\n2. **Weird Token Pattern Analysis** - Presence\u002Fabsence of all 24 patterns with risk levels and evidence\n3. **On-chain Analysis Report** (if applicable) - Holder distribution, exchange listings, configuration\n4. **Integration Safety Assessment** (if applicable) - Safe transfer usage, defensive patterns, weird token handling\n5. **Prioritized Recommendations** - CRITICAL\u002FHIGH\u002FMEDIUM\u002FLOW issues with specific fixes\n\nComplete deliverable templates available in [REPORT_TEMPLATES.md](resources\u002FREPORT_TEMPLATES.md).\n\n---\n\n## Ready to Begin\n\n**What I'll need**:\n- Your codebase\n- Context: Token implementation or integration?\n- Token type: ERC20, ERC721, or both?\n- Contract address (if deployed and want on-chain analysis)\n- RPC endpoint (if querying on-chain)\n\nLet's analyze your token implementation or integration for security risks!\n",{"name":5,"description":7},"main","f37de8f681f0c0ca0e0ebab6e5fddf764ca7553d","skills\u002Ftoken-integration-analyzer",1,"https:\u002F\u002Fgithub.com\u002Fagisota\u002Fold-one","https:\u002F\u002Fagisota.github.io\u002Fold-one\u002F","https:\u002F\u002Fgithub.com\u002Fagisota","pzd.world","2026-07-04 22:32:06",{"source":8,"skillName":5,"commands":33,"prompt":43,"zipAvailable":44},[34,37,40],{"tool":35,"command":36},"npx","npx skills add agisota\u002Fold-one --skill token-integration-analyzer",{"tool":38,"command":39},"bunx","bunx skills add agisota\u002Fold-one --skill token-integration-analyzer",{"tool":41,"command":42},"pnpm","pnpm dlx skills add agisota\u002Fold-one --skill token-integration-analyzer","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fagisota\u002Fold-one\u002Fblob\u002Fmain\u002Fskills\u002Ftoken-integration-analyzer\u002FSKILL.md",true,[46,52],{"path":47,"resourceType":48,"resourceTypeDesc":49,"sizeBytes":50,"sourceHtmlUrl":51},"resources\u002FASSESSMENT_CATEGORIES.md","REFERENCE","参考文档",12990,"https:\u002F\u002Fgithub.com\u002Fagisota\u002Fold-one\u002Fblob\u002Fmain\u002Fskills\u002Ftoken-integration-analyzer\u002Fresources\u002FASSESSMENT_CATEGORIES.md",{"path":53,"resourceType":48,"resourceTypeDesc":49,"sizeBytes":54,"sourceHtmlUrl":55},"resources\u002FREPORT_TEMPLATES.md",3289,"https:\u002F\u002Fgithub.com\u002Fagisota\u002Fold-one\u002Fblob\u002Fmain\u002Fskills\u002Ftoken-integration-analyzer\u002Fresources\u002FREPORT_TEMPLATES.md",[57,64,71,80,87,94],{"skillNo":58,"name":59,"nameZh":6,"description":60,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":61,"categories":62,"keywords":63,"publishedAt":18},"01M75KRGZWQWE9JDBS6RX42NWV","zoom-out","Tell the agent to zoom out and give broader context or a higher-level perspective. Use when you're unfamiliar with a section of code or need to understand how it fits into the bigger picture.","https:\u002F\u002Fgithub.com\u002Fagisota\u002Fold-one\u002Fblob\u002Fmain\u002Fskills\u002Fzoom-out\u002FSKILL.md",[],[],{"skillNo":65,"name":66,"nameZh":6,"description":67,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":68,"categories":69,"keywords":70,"publishedAt":18},"01M75KRCZHKE0ZYAQFFYHS0YNP","zeroize-audit","Detects missing zeroization of sensitive data in source code and identifies zeroization removed by compiler optimizations, with assembly-level analysis, and control-flow verification. Use for auditing C\u002FC++\u002FRust code handling secrets, keys, passwords, or other sensitive data.","https:\u002F\u002Fgithub.com\u002Fagisota\u002Fold-one\u002Fblob\u002Fmain\u002Fskills\u002Fzeroize-audit\u002FSKILL.md",[],[],{"skillNo":72,"name":73,"nameZh":6,"description":74,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":75,"licenseFileUrl":76,"sourceHtmlUrl":77,"categories":78,"keywords":79,"publishedAt":18},"01M75KR94KYQ30DTE1P9WNDAE0","yeet","Use only when the user explicitly asks to stage, commit, push, and open a GitHub pull request in one flow using the GitHub CLI (`gh`).","Apache-2.0","https:\u002F\u002Fgithub.com\u002Fagisota\u002Fold-one\u002Fblob\u002Fmain\u002Fskills\u002Fyeet\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002Fagisota\u002Fold-one\u002Fblob\u002Fmain\u002Fskills\u002Fyeet\u002FSKILL.md",[],[],{"skillNo":81,"name":82,"nameZh":6,"description":83,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":84,"categories":85,"keywords":86,"publishedAt":18},"01M75KR3H13YJ9QHMD49818FA1","yara-rule-authoring","Guides authoring of high-quality YARA-X detection rules for malware identification. Use when writing, reviewing, or optimizing YARA rules. Covers naming conventions, string selection, performance optimization, migration from legacy YARA, and false positive reduction. Triggers on: YARA, YARA-X, malware detection, threat hunting, IOC, signature, crx module, dex module.","https:\u002F\u002Fgithub.com\u002Fagisota\u002Fold-one\u002Fblob\u002Fmain\u002Fskills\u002Fyara-rule-authoring\u002FSKILL.md",[],[],{"skillNo":88,"name":89,"nameZh":6,"description":90,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":91,"categories":92,"keywords":93,"publishedAt":18},"01M75KQMPY8A4Y8XTDD2DT0M9T","x-twitter-growth","X\u002FTwitter growth engine for building audience, crafting viral content, and analyzing engagement. Use when the user wants to grow on X\u002FTwitter, write tweets or threads, analyze their X profile, research competitors on X, plan a posting strategy, or optimize engagement. Complements social-content (generic multi-platform) with X-specific depth: algorithm mechanics, thread engineering, reply strategy, profile optimization, and competitive intelligence via web search.","https:\u002F\u002Fgithub.com\u002Fagisota\u002Fold-one\u002Fblob\u002Fmain\u002Fskills\u002Fx-twitter-growth\u002FSKILL.md",[],[],{"skillNo":95,"name":96,"nameZh":6,"description":97,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":98,"categories":99,"keywords":100,"publishedAt":18},"01M75KQHNZ0ANZNJGZY6M8MDAK","x-api","X\u002FTwitter API integration for posting tweets, threads, reading timelines, search, and analytics. Covers OAuth auth patterns, rate limits, and platform-native content posting. Use when the user wants to interact with X programmatically.","https:\u002F\u002Fgithub.com\u002Fagisota\u002Fold-one\u002Fblob\u002Fmain\u002Fskills\u002Fx-api\u002FSKILL.md",[],[]]