Agent skill · Audited from source
Evm Token Decimals
skill · affaan-m/ECCMIT licenceAudited 20 Sep 2026 · source bd656e3e97c4
Is it safe? Yes — SAFE, grade B (89/100). We read this skill's source at commit bd656e3e97c4 and found no filesystem, network or shell access and no hard-coded secrets. What it does: EVMチェーン全体でサイレントな小数点不一致バグを防ぐ。ランタイムでの小数点照会、チェーン対応キャッシング、ブリッジドトークンの精度ドリフト、ボット・ダッシュボード・DeFiツール向けの安全な正規化をカバーします。
Cite
Cite this page
ModelsAtlas. “Evm Token Decimals (affaan-m/ECC)”. Retrieved 20 Sep 2026. https://modelsatlas.com/skills/affaan-m/evm-token-decimals
Trust audit
Audit 0.4.1 · source read 20 Sep 2026
SAFE means nothing in the source contradicts what the skill says it does. Grade B is shared by 17,406 of 18,389 audited skills.
What the source does
- FilesystemNone observedNo reads or writes in the source
- NetworkNone observedNo outbound calls in the source
- ShellNone observedNo commands run in the source
- DependenciesPinnedNothing floats
- SecretsNone foundNo keys in source
Five audit layers
| Layer | What we check | Result | Findings |
|---|---|---|---|
L0 Provenance | Repo owner, licence, archive status, activity | PASS | 0 |
L1 Static source | Secrets, path traversal, supply chain, hidden code | NA | 0 |
L2 Instructions | Prompt injection, authority framing, hidden directives | PASS | 0 |
L3 Inventory | The files and declarations match the source | PASS | 0 |
L4 Sandbox | Run in isolation and watch behaviour | SKIPPED why | 0 |
Gates applied: no behavioural pass.
Findings (0)
No findings at any severity. We re-audit when the source changes.
Audit 0.4.1 · source sha bd656e3e97c4 · 20 Sep 2026Report an issue or request a re-scan
Provenance
Who published it, and what the verdict is pinned to
- Publisheraffaan-m GitHub userOwner of the repository this skill is read from
- Source folderaffaan-m/ECC/docs/ja-JP/skills/evm-token-decimalsThe exact folder we audited
- LicenceMITAs the repository states it
- Commit pinned for this verdictbd656e3e97c4A new audit runs when the source changes
- Repository statusNot archivedPushed today
- Sandboxed runNot runSkills are read, not executed; layer L4 is skipped
What it tells the agent
Full source on GitHub ↗Its description: EVMチェーン全体でサイレントな小数点不一致バグを防ぐ。ランタイムでの小数点照会、チェーン対応キャッシング、ブリッジドトークンの精度ドリフト、ボット・ダッシュボード・DeFiツール向けの安全な正規化をカバーします。
---
name: evm-token-decimals
description: EVMチェーン全体でサイレントな小数点不一致バグを防ぐ。ランタイムでの小数点照会、チェーン対応キャッシング、ブリッジドトークンの精度ドリフト、ボット・ダッシュボード・DeFiツール向けの安全な正規化をカバーします。
origin: ECC direct-port adaptation
version: "1.0.0"
---
# EVMトークン小数点
サイレントな小数点不一致は、エラーを発生させることなく残高やUSD値が桁違いになる最も簡単な方法のひとつです。
## 使用するタイミング
- Python、TypeScript、またはSolidityでERC-20残高を読み取る場合
- オンチェーン残高から法定通貨の値を計算する場合
- 複数のEVMチェーン間でトークン量を比較する場合
- ブリッジされた資産を扱う場合
- ポートフォリオトラッカー、ボット、またはアグリゲーターを構築する場合
## 仕組み
ステーブルコインが同じ小数点を使用していると仮定しないでください。ランタイムで`decimals()`を照会し、`(chain_id, token_address)`でキャッシュし、値の計算には小数点安全な数学を使用します。
## 使用例
### ランタイムで小数点を照会する
```python
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)
```
シンボルが他の場所で通常6小数点を持つからといって`1_000_000`をハードコードしないでください。
### チェーンとトークンでキャッシュする
```python
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()
```
### 特殊なトークンを防御的に処理する
```python
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
```
フォールバックをログに記録して可視化しておく。古いまたは非標準トークンはまだ存在します。
### SolidityでWAD(18小数点)に正規化する
```solidity
interface IERC20Metadata {
function decimals() external view returns (uint8);
}
function normalizeToWad(address token, uint256 amount) internal view returns (uint256) {
uint8 d = IERC20Metadata(token).decimals();
if (d == 18) return amount;
if (d < 18) return amount * 10 ** (18 - d);
return amount / 10 ** (d - 18);
}
```
### ethersを使ったTypeScript
```typescript
import { Contract, formatUnits } from 'ethers';
const ERC20_ABI = [
'function decimals() view returns (uint8)',
'function balanceOf(address) view returns (uint256)',
];
async function getBalance(provider: any, tokenAddress: string, wallet: string): Promise<string> {
const token = new Contract(tokenAddress, ERC20_ABI, provider);
const [decimals, raw] = await Promise.all([
token.decimals(),
token.balanceOf(wallet),
]);
return formatUnits(raw, decimals);
}
```
### クイックなオンチェーン確認
```bash
cast call <token_address> "decimals()(uint8)" --rpc-url <rpc>
```
## ルール
- 常にランタイムで`decimals()`を照会する
- シンボルではなく、チェーンとトークンアドレスでキャッシュする
- floatではなく`Decimal`、`BigInt`、または同等の正確な数学を使用する
- ブリッジングやラッパーの変更後は小数点を再照会する
- 比較や価格計算の前に内部会計を一貫して正規化するExcerpt, first 3,252 characters of SKILL.md, verbatim from the audited commit. It is text from someone else’s repository, quoted so you can judge it before your agent reads it.
Install
Pinned to the audited commit bd656e3
git clone https://github.com/affaan-m/ECC git -C ECC checkout bd656e3e97c4
The author documents no install command, so this uses the repository directly. Our verdict covers commit bd656e3e97c4 only.
Works in
The author has not said which agents this skill supports, and we have not tested it in any.
Audit history
Every audit, every source change
- ✓SAFE B 89 / 100
first audit · source
bd656e3e97c4
README badge
For maintainers · shows the latest audit
[](https://modelsatlas.com/skills/affaan-m/evm-token-decimals/)
The badge shows our verdict and grade for this skill, and links back to this page. It changes when the audit does.
Similar skills
affaan-m/everything-claude-code
Eval-driven development (EDD) framework for AI coding sessions — define capability and regression evals before coding, grade with code-based, model-based, rule, or human graders, and track pass@k and pass^k reliability.…
affaan-m/everything-claude-code
Map a described workflow to the right ECC command group with run-order and stop condition, or browse all command-group recipe families read live from the commands directory. Advisory only — never executes. Use when…
affaan-m/everything-claude-code
Design task-local harnesses, eval gates, and reusable skill extraction for Claude dynamic workflow mode and other adaptive agent harnesses. Use when building a task-local harness, adding eval gates, or extracting a…
affaan-m/everything-claude-code
Run the full Django verification loop — environment check, mypy/ruff/black linting, migration safety, pytest with coverage targets, pip-audit and bandit security scans, settings and logging review, and diff review —…
affaan-m/everything-claude-code
Django architecture patterns, REST API design with DRF, ORM best practices, caching, signals, middleware, and production-grade Django apps. Use when building or reviewing Django apps, DRF APIs, ORM queries, or caching.
affaan-m/everything-claude-code
Django security best practices, authentication, authorization, CSRF protection, SQL injection prevention, XSS prevention, and secure deployment configurations. Use when reviewing Django authentication, authorization,…
Add this badge to your README
[](https://modelsatlas.com/skills/affaan-m/evm-token-decimals/)
<a href="https://modelsatlas.com/skills/affaan-m/evm-token-decimals/"><img src="https://modelsatlas.com/skills/affaan-m/evm-token-decimals/badge.svg" alt="ModelsAtlas: SAFE B"></a>
Questions about Evm Token Decimals
What does the Evm Token Decimals skill do?
Is Evm Token Decimals safe to install?
What can Evm Token Decimals access on my machine?
How current is this page?
Sources
- github.com/affaan-m/ECC/tree/main/docs/ja-JP/skills/evm-token-de — the audited source at commit bd656e3e97c4 and every finding aboveObserved · 20 Sep 2026
Spotted something wrong? Report a correction · Methodology
Keep going in your AI
Opens with this page as the source. We add nothing else to the prompt.
- What does the Evm Token Decimals skill do?
- Is Evm Token Decimals safe to install?
- What can Evm Token Decimals access on my machine?