> 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

[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="/files/t7TXN2r8aq3Xx7Q0fNPu" alt=""><figcaption></figcaption></figure>

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

<figure><img src="/files/BfXWp4FwsV17ysbuXlAZ" alt=""><figcaption></figcaption></figure>

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

<figure><img src="/files/KdZmt1h2dOx2K68VfOX1" alt=""><figcaption></figcaption></figure>

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

<figure><img src="/files/HikpwgIkWarySTecpmhn" alt="" width="563"><figcaption></figcaption></figure>

## การใช้เครื่องมือ 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 dynamically by asking a question.

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

```
GET https://docs.chiliz.com/th/phatthana/phuenthan/verify-smart-contract/verify-block-explorer.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
