> For the complete documentation index, see [llms.txt](https://docs.chiliz.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.chiliz.com/jp/kaihatsu/kihon/smart-contract-verify/verify-best-practices.md).

# Verify のベストプラクティス

Chiliz Chain のコントラクトを verify する際のベストプラクティス: CAP-20 トークンの特性、推奨される Solidity および EVM バージョンの設定、そして Ethereum を前提としたコードでよくある落とし穴。

Chiliz Chain で smart contract を verify するには、標準的な EVM のプラクティスと、チェーン固有の詳細への注意を組み合わせる必要があります。

実際、Chiliz Chain は Proof of Staked Authority (PoSA) コンセンサスメカニズムで動作し、CAP-20 のような固有の標準や特定の EVM バージョン管理を採用しているため、Ethereum からコードを単純に移植しても動作しないことがあります。

## CAP-20 標準を理解する

Chiliz Chain は EVM 互換ですが、このエコシステムはトークンについて CAP-20 標準に依存しています。これは ERC-20 の Chiliz 固有の実装です。

トークンの詳細はこちらを参照してください:

{% content-ref url="/pages/ucoKc7IxTVmkSiDvirXL" %}
[CAP-20](/jp/gakushu/yogo-shu/cap-20.md)
{% endcontent-ref %}

Fan Token、またはそれと同じように動作することを意図した資産を開発する場合は、2026 年の Decimal Fan Token 移行以降の CAP-20 標準に合わせて、decimals を 18 に設定してください。

{% hint style="info" %}
Fan Token は[2026年の小数対応Fan Tokenへの移行](/jp/gakushu/fan-tokens/2026-fan-token-iko.md)までは 0 桁小数を使用していましたが、この移行によって 18 桁小数精度にアップグレードされました。新しい Fan Token コントラクトは 18 decimals に設定してください。
{% endhint %}

## コンパイラと EVM を設定する

Chiliz Chain の validator は特定の EVM バージョンに最適化されています。「最先端 (bleeding edge)」の設定を使用すると、deploy の失敗や予期しない挙動につながる可能性があります。

以下のバージョンに依拠してください:

{% hint style="info" %}
**Chiliz Chain で推奨される Solidity および EVM のバージョン:**

* **Solidity コンパイラのバージョン:** `0.8.30`（またはそれ以下）
* **ターゲット EVM バージョン:** `prague`
  {% endhint %}

## gas を最適化する

Chiliz Chain は、スパムを防ぎ validator の持続可能性を確保するために「高 Gwei」の最低 gas 価格を強制しています。

Dragon8 ハードフォーク以降、Chiliz Chain は EIP-1559 を実装していますが、**最低 base fee が 2500 gwei** となっています。これは、最適化されていないコードがここでは他のチェーンよりもユーザーにとって大幅に高コストになることを意味します。

そのため、コントラクトをストレージ使用量（最も高コストな操作）について最適化すべきです:

* `uint128`、`uint64`、または `bool` の変数を隣り合わせにパックし、単一の 32 バイトストレージスロットに収まるようにします。
* 読み取り専用の関数引数（external 関数）には `memory` の代わりに `calldata` を使用し、実行時の gas を節約します。

{% hint style="success" %}
`hardhat-gas-reporter` をインストールし、Chiliz 固有の gas 価格設定で構成することで、deploy する前に CHZ での実際のコストを確認できます。
{% endhint %}

## 必ず Spicy でテストする

Ethereum での経験に基づいて Mainnet が同等であると決して仮定しないでください。Chiliz Chain Mainnet に移行する前に、Spicy Testnet で Chiliz PoSA コンセンサスとのやり取りを検証する必要があります。

接続の詳細はこちらを参照してください:

{% content-ref url="/pages/Df6543fAh5XB3pmgrJfU" %}
[Chiliz Chain に接続する](/jp/kaihatsu/kihon/chiliz-chain-setsuzoku.md)
{% endcontent-ref %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.chiliz.com/jp/kaihatsu/kihon/smart-contract-verify/verify-best-practices.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
