
Evm token decimals
Guides agents to read ERC-20 decimals at runtime and avoid off-by-magnitude token amounts
Evm token decimals is an open-source agent skill for developer tools. It is available on Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose.
- Scripts
- None
- Platforms
- Claude Code, Codex, Cursor
- GitHub stars
- 73
- Last commit
- License
- MIT
- Listing updated
Similar skills
About Evm token decimals
This skill gives an AI coding agent a set of rules for handling token amounts on EVM chains, where the same symbol can use different decimal places on different networks. It explains why decimals should be read from the token contract with decimals() rather than assumed, and why lookups should be cached by chain ID and token address instead of by symbol.
The guidance covers code patterns in Python with web3.py, TypeScript with ethers, and Solidity for normalizing amounts to 18-decimal WAD values. It also includes a cast command for checking decimals directly from an RPC endpoint, plus a defensive fallback for tokens whose decimals() call reverts, with logging so the fallback stays visible.
The skill expects the agent to work in one of those languages and to have access to an RPC endpoint for the relevant chain. It adds rules around exact math using Decimal or BigInt instead of floats, re-querying decimals after bridging or wrapper changes, and normalizing internal accounting before comparisons or pricing. It ships no scripts; everything is delivered as instructions and examples.
When your agent uses it
Prevent silent decimal mismatch bugs across EVM chains. Covers runtime decimal lookup, chain-aware caching, bridged-token precision drift, and safe normalization for bots, dashboards, and DeFi tools. Use when handling token amounts across EVM chains, or when a balance, price, or transfer amount is off by orders of magnitude.
From the skill's SKILL.md. Your agent reads this description to decide when to load the skill.
What it can access
From a static check of its 2 files (4 KB) on GitHub on 3 December 2026. Nothing was run. Read the files before you install a skill: it can tell your agent to run anything its tools allow.
Check another skill before you install it.
Install
This skill ships in the rea-skills plugin. In Claude Code, add the marketplace and install the plugin (it may include other skills too):
/plugin marketplace add smartworldarafath/REA_Skill
/plugin install rea-skills@smartworldarafathOr copy only this skill to ~/.claude/skills/evm-token-decimals:
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/smartworldarafath/REA_Skill.git "$tmp" &&
mkdir -p ~/.claude/skills &&
rm -rf ~/.claude/skills/evm-token-decimals &&
cp -R "$tmp/.agents/skills/evm-token-decimals" ~/.claude/skills/evm-token-decimals &&
rm -rf "$tmp"For one project only, put the folder in .claude/skills/evm-token-decimals inside it instead.
Copy the skill folder to ~/.agents/skills/evm-token-decimals to use it in every repository:
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/smartworldarafath/REA_Skill.git "$tmp" &&
mkdir -p ~/.agents/skills &&
rm -rf ~/.agents/skills/evm-token-decimals &&
cp -R "$tmp/.agents/skills/evm-token-decimals" ~/.agents/skills/evm-token-decimals &&
rm -rf "$tmp"For one repository only, put the folder in .agents/skills/evm-token-decimals inside it instead.
Copy the skill folder to ~/.cursor/skills/evm-token-decimals to use it in every project:
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/smartworldarafath/REA_Skill.git "$tmp" &&
mkdir -p ~/.cursor/skills &&
rm -rf ~/.cursor/skills/evm-token-decimals &&
cp -R "$tmp/.agents/skills/evm-token-decimals" ~/.cursor/skills/evm-token-decimals &&
rm -rf "$tmp"For one project only, put the folder in .cursor/skills/evm-token-decimals inside it instead.
Run in a terminal (add --scope workspace to install it for the current workspace only):
gemini skills install https://github.com/smartworldarafath/REA_Skill.git --path .agents/skills/evm-token-decimalsOr copy the folder to ~/.gemini/skills/evm-token-decimals yourself.
For GitHub Copilot in VS Code, copy the skill folder to ~/.copilot/skills/evm-token-decimals:
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/smartworldarafath/REA_Skill.git "$tmp" &&
mkdir -p ~/.copilot/skills &&
rm -rf ~/.copilot/skills/evm-token-decimals &&
cp -R "$tmp/.agents/skills/evm-token-decimals" ~/.copilot/skills/evm-token-decimals &&
rm -rf "$tmp"For one project only, put the folder in .github/skills/evm-token-decimals inside it instead.
Get the folder:
git clone --depth 1 https://github.com/smartworldarafath/REA_Skill.gitThen copy REA_Skill/.agents/skills/evm-token-decimals into your agent's skills folder as evm-token-decimals. Agents that support SKILL.md read one folder per skill.
What it does
- Runtime decimal lookup
- Shows how to query decimals() from the token contract instead of hardcoding precision values.
- Chain-aware caching
- Describes caching decimals by chain ID and token address to avoid cross-chain mix-ups.
- Exact amount math
- Recommends Decimal or BigInt arithmetic over floats when converting raw balances.
- Solidity WAD normalization
- Provides a helper that scales token amounts to an 18-decimal internal representation.
- Defensive fallback handling
- Covers tokens whose decimals() call reverts, with logged defaults that stay visible.
- Bridged token awareness
- Advises re-querying decimals after bridging or wrapper changes.
Good for
- Fix a wallet balance that displays off by a factor of a million
- Compute USD values from on-chain token balances across several chains
- Write a bot that compares stablecoin amounts from different networks
- Normalize token amounts to 18 decimals in a Solidity contract
- Check a token's decimals from the command line with cast
Evm token decimals FAQ
What does the skill need to run?
It works through instructions and code examples for Python with web3.py, TypeScript with ethers, and Solidity. It ships no scripts, so you need an RPC endpoint for the chain you are querying.
Does Evm token decimals change any files or contracts?
No. It only guides the agent on how to read decimals and handle token amounts in code it writes or reviews.
What happens when a token's decimals() call fails?
The example falls back to 18 decimals and logs a warning with the token address and chain, so the fallback stays visible.
When does the skill get used?
It is meant for tasks involving token amounts across EVM chains, or when a balance, price or transfer amount is off by orders of magnitude.
How do I install Evm token decimals in Claude Code?
Copy the skill folder from GitHub to ~/.claude/skills/evm-token-decimals to use it in all your projects, or to .claude/skills/evm-token-decimals in one project. Or install the rea-skills plugin, which includes it: /plugin marketplace add smartworldarafath/REA_Skill, then /plugin install rea-skills@smartworldarafath.
Does Evm token decimals run scripts?
No. It is instructions only, with no scripts. This comes from a static check of the files on GitHub; nothing was run. Read the files before you install it.
Which AI agents can use Evm token decimals?
Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose. Each reads skills in the SKILL.md format from its own folder; the install steps on this page list them.
What are the best alternatives to Evm token decimals?
The closest alternatives to Evm token decimals are Viem integration, Use arc, Dimensional analysis check, Trust wallet SDK and Use smart contract platform.
Where this comes from
- Description: from the skill's own SKILL.md.
More from smartworldarafath/REA_Skill

Guides building and auditing UI to WCAG 2.2 AA across web, iOS and Android
- Open source
- 73 GitHub stars
- Developer tools

Diagnoses agent and LLM stacks for hidden failures and ranks the fixes by severity
- Open source
- 73 GitHub stars
- Developer tools

Compare coding agents head-to-head on your own tasks by pass rate, cost and time
- Open source
- 73 GitHub stars
- Developer tools

Guides an agent to design tool sets, observations and error recovery for better completion
- Open source
- 73 GitHub stars
- Developer tools

Gives an agent a structured capture-diagnose-recover loop for failing runs
- Open source
- 73 GitHub stars
- Developer tools

Lets an AI agent make x402 payments within per-task budgets and spending policies
- Open source
- 73 GitHub stars
- Finance and payments





