> 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/th/phatthana/phuenthan/verify-smart-contract/verify-block-explorer.md).

# Verify ด้วย Chiliz Block Explorer

ยืนยัน smart contract บน Chiliz Chain ผ่าน Chiliz Block Explorer (Blockscout) โดยใช้แบบฟอร์มเว็บ, Hardhat plugin หรือ Blockscout API

[Chiliz Block Explorer](https://scan.chiliz.com/) เป็นบริการที่สร้างโดย Blockscout ดังนั้นคุณสามารถอ้างอิง [เอกสารของพวกเขา](https://docs.blockscout.com/) สำหรับการใช้งานในชีวิตประจำวันได้

Blockscout มีหลายวิธีในการยืนยัน smart contract ของคุณบน Chiliz Chain:

* สำหรับ smart contract ส่วนใหญ่: ใช้ฟีเจอร์ยืนยันของพวกเขา
* สำหรับ smart contract ที่ซับซ้อนกว่า: ใช้เครื่องมือ command-line เช่น Hardhat
* สำหรับ smart contract ที่เรียบง่าย: ใช้ API ของพวกเขา

ดู [เอกสารการยืนยัน smart contract](https://docs.blockscout.com/devs/verification) ของ Blockscout

## การใช้ฟีเจอร์ยืนยันของ Chiliz Block Explorer

Chiliz Block Explorer มีอินเทอร์เฟซยืนยัน smart contract สำหรับ Chiliz Mainnet ที่\
<https://scan.chiliz.com/contract-verification>\
และมีเอกสารอยู่ที่นี่: <https://docs.blockscout.com/devs/verification/blockscout-ui>

{% hint style="info" %}
คุณยังสามารถยืนยัน smart contract บน Spicy Testnet ด้วยอินเทอร์เฟซนี้:\
<https://spicy-explorer.chiliz.com/>
{% endhint %}

{% hint style="info" %}
สำหรับ smart contract หลายไฟล์ ให้แน่ใจว่าโค้ดของคุณถูก flatten แล้วก่อนอัปโหลด

ตัวอย่างเช่น หากคุณใช้ Remix IDE คุณสามารถคลิกขวาที่ไฟล์ smart contract `contract-XYZ.sol` ที่คอมไพล์แล้วใน File Explorer แล้วเลือกตัวเลือก "Flatten"\
จากนั้น ดาวน์โหลดไฟล์ที่ได้ (ชื่อ `contract-XYZ_flattened.sol`) เพื่ออัปโหลดไปยังแบบฟอร์มยืนยัน
{% endhint %}

ขั้นตอน:

1. ในช่อง "Contract address to verify" ให้ใส่ที่อยู่ของ smart contract
2. เลือกใบอนุญาตที่คุณต้องการนำไปใช้กับ smart contract ของคุณ เนื่องจากอาจไม่ชัดเจนว่าหมายความว่าอะไร [นี่คือคำอธิบายสั้น ๆ](https://choosealicense.com/) เกี่ยวกับใบอนุญาต open-source

<figure><img src="https://3189658150-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLHe6Yk9vM1NjniTq0hPb%2Fuploads%2Fgit-blob-234813ccc0e2f86f25a07ed174801555410d2d5d%2Fimage%20(4).png?alt=media" alt=""><figcaption></figcaption></figure>

3. เลือกวิธียืนยัน\
   วิธีที่ง่ายที่สุดคือการให้ไฟล์ Solidity ที่ถูก flatten แล้ว หรือ "Solidity (Single file)"
4. เลือกเวอร์ชัน compiler (Chiliz Chain รองรับเวอร์ชันถึง v0.8.30) และเวอร์ชัน EVM (Chiliz Chain รองรับเวอร์ชันถึง Prague)

<figure><img src="https://3189658150-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLHe6Yk9vM1NjniTq0hPb%2Fuploads%2Fgit-blob-7d0b51ac412b5f831a826d04fb7fe7f3e9ed7e31%2Fimage%20(6).png?alt=media" alt=""><figcaption></figcaption></figure>

5. สุดท้าย ในช่อง "Contract Code" ให้วางโค้ด smart contract ที่คุณใช้คอมไพล์ smart contract ครั้งแรก แล้วคลิก "Verify & publish"

<figure><img src="https://3189658150-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLHe6Yk9vM1NjniTq0hPb%2Fuploads%2Fgit-blob-51a0270de729b295d3777b69d1d6d5e02e728842%2Fimage%20(7).png?alt=media" alt=""><figcaption></figcaption></figure>

หากสำเร็จ smart contract ของคุณจะถูกระบุอย่างชัดเจนว่าได้รับการยืนยันแล้ว โดยมีเครื่องหมายถูกสีเขียว Block explorer จะแสดงซอร์สโค้ดและเปิดใช้งานฟีเจอร์โต้ตอบทั้งหมด

<figure><img src="https://3189658150-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLHe6Yk9vM1NjniTq0hPb%2Fuploads%2Fgit-blob-f4f8edb117d9a7b935329f07534668ee5a534aa0%2Fimage%20(8).png?alt=media" alt="" width="563"><figcaption></figcaption></figure>

ตัวอย่างเช่น $PSG Fan Token ถูก deploy เป็น proxy contract ซึ่ง implementation contract ที่ verified แล้วจะแสดงบน Chiliz Block Explorer ที่นี่ (สังเกตเครื่องหมายถูกสีเขียว):

{% embed url="<https://scan.chiliz.com/address/0xeC991a3FA1bfB4835A1D22f3df05c2CED5B7bF6d?tab=contract>" %}

## การใช้เครื่องมือ command-line

เอกสารของ Blockscout มี [คู่มือโดยละเอียด](https://docs.blockscout.com/devs/verification) เกี่ยวกับวิธีใช้เครื่องมือ command-line สำหรับการยืนยัน ซึ่งมีประโยชน์อย่างยิ่งหากคุณต้องการทำให้การยืนยัน smart contract เป็นแบบอัตโนมัติในสภาพแวดล้อมการพัฒนาของคุณ

คุณสามารถอ่านคู่มือการปรับใช้และยืนยันด้วย:

* [Hardhat](https://docs.blockscout.com/devs/verification/hardhat-verification-plugin)
* [Foundry](https://docs.blockscout.com/devs/verification/foundry-verification)
* [Sourcify](https://docs.blockscout.com/devs/verification/contracts-verification-via-sourcify)
* [Remix](https://docs.blockscout.com/devs/verification/remix-verification)
* ... และอื่น ๆ อีกมาก!

## การใช้ API ของ Blockscout

Blockscout มี API ยืนยัน smart contract โดยเฉพาะ:

{% embed url="<https://docs.blockscout.com/devs/verification/blockscout-smart-contract-verification-api>" %}

API endpoints คือ:

* Chiliz Mainnet: <https://scan-api.chiliz.com/api/v2/>
* Spicy Testnet: <https://spicy-explorer-api.chiliz.com/api/v2/>


---

# 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/th/phatthana/phuenthan/verify-smart-contract/verify-block-explorer.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.
