evm-token-decimals

evm-token-decimals is a skill for Claude Code, Codex from gongyijie85/dsh-ecc. It costs 71 tokens per session (971 once invoked), scanned A, a copy of evm-token-decimals, MIT.

A guide for reading and converting ERC-20 token amounts safely across EVM blockchains. ERC-20 is a common standard for tokens on Ethereum-compatible networks, and decimals define how raw token units become displayed amounts.

In plain words
What is it for?
Use it in wallets, bots, dashboards, portfolio trackers, aggregators, and DeFi tools that compare token amounts across networks.
Why use it?
It prevents balances, transfers, or dollar values from being wrong by large factors when tokens use different decimal settings on different chains.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it in wallets, bots, dashboards, portfolio trackers, aggregators, and DeFi tools that compare token amounts across networks.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/gongyijie85/dsh-ecc/evm-token-decimals
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add gongyijie85/dsh-ecc --skill evm-token-decimals
Clone the repo
git clone --depth 1 https://github.com/gongyijie85/dsh-ecc

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for evm-token-decimals

README.md
[![agentmods](https://agentmods.dev/badge/skills/gongyijie85/dsh-ecc/evm-token-decimals/github.svg)](https://agentmods.dev/skills/gongyijie85/dsh-ecc/evm-token-decimals)
Your own site
<a href="https://agentmods.dev/skills/gongyijie85/dsh-ecc/evm-token-decimals"><img src="https://agentmods.dev/badge/skills/gongyijie85/dsh-ecc/evm-token-decimals/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for evm-token-decimals

Your own site · 80×15
<a href="https://agentmods.dev/skills/gongyijie85/dsh-ecc/evm-token-decimals"><img src="https://agentmods.dev/badge/skills/gongyijie85/dsh-ecc/evm-token-decimals.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 71 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 971 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin 89% copy Near-identical to another mod in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00071 $0.00971
Opus 5 $0.00036 $0.00485
Sonnet 5 $0.00014 $0.00194
Haiku 4.5 $0.00007 $0.00097

Measured 7d ago against content hash 4e3fd13794f5, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, from the pricing page.

Security

Grade A, and why

evm-token-decimals scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 7d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

Origin

This is a copy

89% identical to evm-token-decimals — 29 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

skills/evm-token-decimals/SKILL.md · 132 lines

How it starts

The opening of the file, as written. The whole thing — 132 lines — stays where its author put it; the contents beside it link to each section on GitHub.

EVM Token Decimals

Silent decimal mismatches are one of the easiest ways to ship balances or USD values that are off by orders of magnitude without throwing an error.

When to Use

  • Reading ERC-20 balances in Python, TypeScript, or Solidity
  • Calculating fiat values from on-chain balances
  • Comparing token amounts across multiple EVM chains
  • Handling bridged assets
  • Building portfolio trackers, bots, or aggregators

How It Works

Never assume stablecoins use the same decimals everywhere. Query decimals() at runtime, cache by (chain_id, token_address), and use decimal-safe math for value calculations.

Examples

Query decimals at runtime

from decimal import Decimal
from web3 import Web3

ERC20_ABI = [
    {"name": "decimals", "type": "function", "inputs": [],
     "outputs": [{"type": "uint8"}], "stateMutability": "view"},
    {"name": "balanceOf", "type": "function",
     "inputs": [{"name": "account", "type": "address"}],
     "outputs": [{"type": "uint256"}], "stateMutability": "view"},
]

def get_token_balance(w3: Web3, token_address: str, wallet: str) -> Decimal:
    contract = w3.eth.contract(
        address=Web3.to_checksum_address(token_address),
        abi=ERC20_ABI,
    )
    decimals = contract.functions.decimals().call()
    raw = contract.functions.balanceOf(Web3.to_checksum_address(wallet)).call()
    return Decimal(raw) / Decimal(10 ** decimals)

Do not hardcode 1_000_000 because a symbol usually has 6 decimals somewhere else.

Cache by chain and token

from functools import lru_cache

@lru_cache(maxsize=512)
def get_decimals(chain_id: int, token_address: str) -> int:
    w3 = get_web3_for_chain(chain_id)
    contract = w3.eth.contract(
        address=Web3.to_checksum_address(token_address),
        abi=ERC20_ABI,
    )
    return contract.functions.decimals().call()

Handle odd tokens defensively

try:
    decimals = contract.functions.decimals().call()
except Exception:
    logging.warning(
        "decimals() reverted on %s (chain %s), defaulting to 18",
        token_address,
        chain_id,
    )
    decimals = 18

Read the full file on GitHub · 132 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 7d ago First seen · 132 lines · 71 tokens per session scan A 4e3fd13794f5

Subscribe to this mod's changes

evm-token-decimals is a skill published in the GitHub repository gongyijie85/dsh-ecc (7 stars, last pushed 3d ago), licensed MIT. It adds 71 tokens to every session and 971 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it A with 0 findings. It is 89% identical to evm-token-decimals, differing in 29 lines, and is treated as a copy.

Related

Other skills, from other repositories

manage-taskboard

Manage work in the native DeepSeek Harness Taskboard with exact task ids and optimistic versions. Use when an Agent must inspect project work, claim an eligible todo, record progress or blockers, verify an implementation, submit it for human review, or release its own claim; also use when a human asks how to accept…

shengsheng90/DSH-taskboard · 88 tokens

dsh-plugin-guide

Use when developing, reviewing, packaging, debugging, or answering questions about DeepSeek Harness (DSH) plugins — the plugin-based agent harness on vendored Cordis. Applies the official plugin-development constraints (plugin contract, cordis.yml layers, services/events/effects, tool DSL, bundles/profiles) backed by…

PerryLink/dsh-plugin-guide · 76 tokens

investor-distiller

An analysis tool for studying investment bloggers on WeChat, a Chinese messaging and publishing platform. It collects their articles and builds a structured profile of their trading methods, market views, writing style, topics and audience interaction.

redfox-data/redfox-community-dsh · 113 tokens

playlet-douyin-feed

A tool that tracks popular short dramas on Douyin, a Chinese short-video platform, and creates a daily HTML report with covers, engagement data, links, topic groups, and writing observations.

redfox-data/redfox-community-dsh · 264 tokens

playlet-xhs-feed

A daily tracker for popular short-drama posts on Xiaohongshu, a Chinese social-media platform. It groups posts by story themes and creates an HTML report with covers, interaction data, links, and writing insights.

redfox-data/redfox-community-dsh · 184 tokens

account-video-downloader

A command-line tool that lists and downloads videos and image posts from a creator’s account on Douyin, Kuaishou, Bilibili, or YouTube.

redfox-data/redfox-community-dsh · 187 tokens