token-integration-safety

Enforce safe ERC-20 interactions in smart contracts handling arbitrary tokens.

120|12|Updated Apr 10, 2026
One-click install
npx skills add https://github.com/ccashwell/evm-cortex --skill token-integration-safety
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: token-integration-safety
Source: https://github.com/ccashwell/evm-cortex/tree/main/skills/token-integration-safety
Command: npx skills add https://github.com/ccashwell/evm-cortex --skill token-integration-safety

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Non-standard ERC-20 token integrations pose safety risks in smart contracts, including unexpected behavior from tokens like USDT, USDC, or rebasing assets. This Skill provides patterns to ensure safe interactions and robust handling across deposits, withdrawals, and approvals.

Core Features & Use Cases

  • SafeERC20 usage with forceApprove to mitigate USDT quirks.
  • Decimals awareness for non-18-decimal tokens and blacklists handling.
  • Handling fee-on-transfer, rebasing tokens, and ERC-777 callbacks.
  • Permit2 integration guidance for gasless approvals.
  • Token quirks reference and integration checklist for production safety.
  • Real-world use cases: vaults, adapters, and cross-token finance modules.

Quick Start

Apply safeERC20 patterns to a non-standard token transfer in a vault example.

Frequently Asked Questions about token-integration-safety

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I handle non-standard ERC-20 token integration safely in smart contracts?

Safe ERC-20 token integration requires using SafeERC20 patterns to handle non-standard return values and tokens like USDT and USDC. This mitigates risks across deposits, withdrawals, and approvals by enforcing robust interactions for arbitrary tokens.

Why does USDT approval fail with standard ERC-20 interfaces and how do I fix it?

USDT approval fails because it lacks a return value, breaking standard interfaces. You fix it by using SafeERC20 with forceApprove, which safely handles non-standard return values and mitigates token quirks during the approval process.

What's the best way to integrate fee-on-transfer and rebasing tokens into a vault?

Integrating fee-on-transfer and rebasing tokens into a vault requires decimals awareness and balance checks after transfers. Using SafeERC20 patterns handles these ERC-20 quirks, ensuring accurate accounting for deposits and withdrawals.

Does Permit2 work with non-standard tokens for gasless approvals?

Permit2 enables gasless approvals for non-standard tokens, but requires awareness of token quirks like blocklists and pause functionality. Safe ERC-20 integration patterns ensure Permit2 interactions remain secure across arbitrary tokens.

When do I need to account for token blacklists and pause features in smart contracts?

You must account for token blacklists and pause features whenever handling arbitrary tokens like USDC. Safe ERC-20 integration requires awareness of these quirks to prevent unexpected transaction failures during deposits and withdrawals.