> 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 で 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 固有の実装です。

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

CAP-20

Fan Token、またはそれと同じように動作することを意図した資産を開発する場合は、decimals を明示的に 0 に設定してください。標準的な DeFi トークンでは 18 を使用することがあります。

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

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

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

* Solidity: `0.8.24`。
* EVM: `shanghai` または `paris`。

## 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 コンセンサスとのやり取りを検証する必要があります。

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

[connect-to-chiliz-chain](/jp/kaihatsu/kihon/chiliz-chain-setsuzoku.md)


---

# 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

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

The question should be specific, self-contained, and written in natural language.
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.
