evm-token-decimals

Retrieve ERC-20 token decimals dynamically and normalize balances across EVM chains.

Updated Mar 15, 2026
One-click install
npx skills add https://github.com/abhishekdutta18/blogspro --skill evm-token-decimals-abhishekdutta18
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: evm-token-decimals
Source: https://github.com/abhishekdutta18/blogspro/tree/main/.claude/skills/evm-token-decimals
Command: npx skills add https://github.com/abhishekdutta18/blogspro --skill evm-token-decimals-abhishekdutta18

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

This Skill addresses the challenge of silent decimal mismatch bugs that cause balance and value inaccuracies in EVM-compatible blockchain applications.

Core Features & Use Cases

  • Runtime Decimal Lookup: Query token decimals dynamically at runtime through Web3 or Ethers, ensuring accuracy in calculations.
  • Chain-Aware Caching: Cache decimal information based on chain ID and token address to optimize performance and prevent redundant calls.
  • Bridged and Non-Standard Token Handling: Provide fallback mechanisms and safe normalization for odd or non-standard tokens to maintain data integrity.
  • Use Case: Developers building DeFi dashboards or bots can reliably fetch and normalize token amounts, avoiding silent bugs that could lead to financial miscalculations.

Quick Start

Use this Skill to retrieve the decimals of an ERC-20 token on a specific chain and normalize the raw token balance for accurate display or computation.

Frequently Asked Questions about evm-token-decimals

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

FAQPage Schema
How do I prevent silent ERC-20 token balance calculation bugs in DeFi applications?

To prevent silent ERC-20 token balance calculation bugs, dynamically retrieve and cache token decimals at runtime to normalize raw values accurately across multiple EVM-compatible chains.

What is the best way to fetch non-standard token decimals across multiple EVM chains?

Fetching non-standard token decimals across EVM chains requires runtime lookups using Web3 or Ethers, combined with chain-aware caching and fallback mechanisms to ensure accurate data normalization.

How do I normalize raw token amounts using dynamically queried decimals in Web3?

To normalize raw token amounts in Web3, query the specific token's decimals dynamically, apply safe normalization for non-standard tokens, and adjust the raw balance for accurate display or computation.

Does this approach handle bridged tokens that fail standard decimal calls on EVM chains?

Yes, handling bridged tokens that fail standard decimal calls involves fallback mechanisms that provide safe normalization for odd or non-standard tokens to maintain data integrity on EVM chains.

Why does my DeFi dashboard show incorrect token values when switching EVM chains?

Incorrect token values in DeFi dashboards often occur due to decimal mismatch bugs, which can be resolved by dynamically retrieving and caching decimals based on chain ID and token address.