semaes111/everything_claude_code/evm-token-decimals
Claude Code and agent skill by semaes111/everything_claude_code
Trust tier 3
- community
Source check pending
Checking that the SKILL.md file is still in the repository.
EVMチェーン全体でサイレントな小数点不一致バグを防ぐ。ランタイムでの小数点照会、チェーン対応キャッシング、ブリッジドトークンの精度ドリフト、ボット・ダッシュボード・DeFiツール向けの安全な正規化をカバーします。
Install
npx vskill@latest install semaes111/everything_claude_code/evm-token-decimalsSKILL.md
The same SKILL.md was published earlier as semaes111/everything_claude_code/evm-token-decimals.
EVMトークン小数点
サイレントな小数点不一致は、エラーを発生させることなく残高やUSD値が桁違いになる最も簡単な方法のひとつです。
使用するタイミング
- Python、TypeScript、またはSolidityでERC-20残高を読み取る場合
- オンチェーン残高から法定通貨の値を計算する場合
- 複数のEVMチェーン間でトークン量を比較する場合
- ブリッジされた資産を扱う場合
- ポートフォリオトラッカー、ボット、またはアグリゲーターを構築する場合
仕組み
ステーブルコインが同じ小数点を使用していると仮定しないでください。ランタイムでdecimals()を照会し、(chain_id, token_address)でキャッシュし、値の計算には小数点安全な数学を使用します。
使用例
ランタイムで小数点を照会する
シンボルが他の場所で通常6小数点を持つからといって1_000_000をハードコードしないでください。
チェーンとトークンでキャッシュする
特殊なトークンを防御的に処理する
フォールバックをログに記録して可視化しておく。古いまたは非標準トークンはまだ存在します。
SolidityでWAD(18小数点)に正規化する
ethersを使ったTypeScript
クイックなオンチェーン確認
ルール
- 常にランタイムで
decimals()を照会する - シンボルではなく、チェーンとトークンアドレスでキャッシュする
- floatではなく
Decimal、BigInt、または同等の正確な数学を使用する - ブリッジングやラッパーの変更後は小数点を再照会する
- 比較や価格計算の前に内部会計を一貫して正規化する
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingdocs/ja-JP/skills/evm-token-decimals/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/semaes111/everything_claude_code/evm-token-decimals)