SKILL

evm-token-decimals

EVMチェーン全体でサイレントな小数点不一致バグを防ぐ。ランタイムでの小数点照会、チェーン対応キャッシング、ブリッジドトークンの精度ドリフト、ボット・ダッシュボード・DeFiツール向けの安全な正規化をカバーします。

Original · translation did not pass checks

Target: Target not categorized. Automatically collected · unverified.

Excerpt from the author’s documentation

Extracted from a fixed version of SKILL.md in its original language. This is the author’s documentation; installation, compatibility and runtime results have not been verified by this site.

Read the original Japanese text

Topics in the source

  • EVMトークン小数点
  • 使用するタイミング
  • 仕組み
  • 使用例
  • ランタイムで小数点を照会する
  • チェーンとトークンでキャッシュする
  • 特殊なトークンを防御的に処理する
  • SolidityでWAD(18小数点)に正規化する

サイレントな小数点不一致は、エラーを発生させることなく残高やUSD値が桁違いになる最も簡単な方法のひとつです。 Python、TypeScript、またはSolidityでERC-20残高を読み取る場合 オンチェーン残高から法定通貨の値を計算する場合 複数のEVMチェーン間でトークン量を比較する場合 ブリッジされた資産を扱う場合 ポートフォリオトラッカー、ボット、またはアグリゲーターを構築する場合 ステーブルコインが同じ小数点を使用していると仮定しないでください。ランタイムでdecimals()を照会し、(chainid, tokenaddress)でキャッシュし、値の計算には小数点安全な数学を使用します。 シンボルが他の場所で通常6小数点を持つからといって1000000をハードコードしないでください。 フォールバックをログに記録して可視化しておく。古いまたは非標準トークンはまだ存在します。 常にランタイムでdecimals()を照会する シンボルではなく、チェーンとトークンアドレスでキャッシュする floatではなくDecimal、BigInt、または同等の正確な数学を使用する ブリッジングやラッパーの変更後は小数点を再照会する 比較や価格計算の前に内部会計を一貫して正規化する

Source repository
affaan-m/ECC
Source file
docs/ja-JP/skills/evm-token-decimals/SKILL.md
Fixed revision
d2ef2680594f9a17526a6e1a2e18b3d242c5d17b
Read the complete original documentation ↗

Sources and evidence

This record was collected automatically. Its documentation, suitability and runtime behavior have not been manually verified.

Author: affaan-m/ECC · original repository metadata. Documentation review: Not reviewed. Last source check: 2026-11-09T14:01:49.205Z.

Categories are inferred from names, descriptions and paths. They do not establish compatibility.

License and attribution

MIT. Third-party content and copyright remain with their authors. Refer to the original license and terms.

Original license ↗

Synchronization, copying and user-reported success do not mark a resource as runtime-tested.

Limitations and notes

  • Collecting metadata does not mean this site has installed, adapted, runtime-tested or security-reviewed the resource.