> 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/vi/phat-trien/co-ban/xac-minh-smart-contract/xac-minh-voi-block-explorer.md).

# Xác minh với Chiliz Block Explorer

[Chiliz Block Explorer](https://scan.chiliz.com/) là dịch vụ được xây dựng bởi Blockscout. Do đó, bạn có thể tham khảo [tài liệu của họ](https://docs.blockscout.com/) cho việc sử dụng hàng ngày.

Blockscout cung cấp nhiều cách để xác minh smart contract của bạn trên Chiliz Chain:

* Đối với hầu hết các hợp đồng: sử dụng tính năng xác minh của họ.
* Đối với các hợp đồng phức tạp hơn: sử dụng công cụ dòng lệnh, chẳng hạn như Hardhat.
* Đối với các hợp đồng đơn giản: sử dụng API của họ.

Xem [tài liệu về xác minh hợp đồng](https://docs.blockscout.com/devs/verification) của Blockscout.

## Sử dụng tính năng xác minh của Chiliz Block Explorer

Chiliz Block Explorer cung cấp giao diện xác minh hợp đồng cho Chiliz Mainnet tại\
<https://scan.chiliz.com/contract-verification>.\
Tài liệu cũng được ghi lại tại đây: <https://docs.blockscout.com/devs/verification/blockscout-ui>

{% hint style="info" %}
Bạn cũng có thể xác minh hợp đồng trên Spicy Testnet với giao diện này:\
<https://spicy-explorer.chiliz.com/>
{% endhint %}

{% hint style="info" %}
Đối với các hợp đồng nhiều tệp, hãy đảm bảo mã của bạn đã được làm phẳng (flatten) trước khi tải lên.

Ví dụ: nếu bạn dùng Remix IDE, bạn có thể nhấp chuột phải vào tệp hợp đồng `contract-XYZ.sol` đã biên dịch trong File Explorer, rồi chọn tùy chọn "Flatten".\
Sau đó, tải xuống tệp kết quả (có tên `contract-XYZ_flattened.sol`) để tải lên biểu mẫu xác minh.
{% endhint %}

Các bước thực hiện:

1. Trong trường "Contract address to verify", nhập địa chỉ của smart contract.
2. Chọn giấy phép bạn muốn áp dụng cho hợp đồng của mình. Vì điều này không phải lúc nào cũng rõ ràng, [đây là phần giải thích ngắn gọn](https://choosealicense.com/) về các giấy phép mã nguồn mở.

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

3. Chọn phương thức xác minh.\
   Phương thức đơn giản nhất là cung cấp phiên bản đã làm phẳng của hợp đồng Solidity, tức là "Solidity (Single file)".
4. Chọn phiên bản trình biên dịch (Chiliz Chain hỗ trợ các phiên bản đến v0.8.30) và phiên bản EVM (Chiliz Chain hỗ trợ các phiên bản đến phiên bản Prague).

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

5. Cuối cùng, trong trường "Contract Code", dán mã smart contract mà bạn đã dùng để biên dịch hợp đồng ban đầu, rồi nhấp "Verify & publish".

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

Nếu thành công, hợp đồng của bạn sẽ được đánh dấu rõ ràng là đã xác minh, với dấu kiểm màu xanh lá. Block explorer sẽ hiển thị mã nguồn và kích hoạt tất cả các tính năng tương tác.

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

## Sử dụng công cụ dòng lệnh

Tài liệu của Blockscout cung cấp [hướng dẫn chi tiết](https://docs.blockscout.com/devs/verification) về cách sử dụng công cụ dòng lệnh để xác minh. Điều này đặc biệt hữu ích nếu bạn muốn tự động hóa việc xác minh hợp đồng trong môi trường phát triển của mình.

Bạn có thể đọc hướng dẫn triển khai và xác minh với:

* [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)
* ... và nhiều hơn nữa!

## Sử dụng Blockscout API

Blockscout có một API xác minh hợp đồng chuyên dụng:

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

Các endpoint API là:

* 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/vi/phat-trien/co-ban/xac-minh-smart-contract/xac-minh-voi-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.
