> 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/deploy-smart-contract/deploy-thirdweb.md).

# Deploy ด้วย thirdweb

ปรับใช้ smart contract มาตรฐานหรือแบบกำหนดเองบน Chiliz Chain Mainnet หรือ Spicy Testnet โดยใช้ไลบรารี Explore หรือเครื่องมือ CLI ของ thirdweb

[Thirdweb](https://thirdweb.com/) มอบเครื่องมือ SDK และเทมเพลต smart contract ที่ช่วยให้การสร้างและปรับใช้แอปบน blockchain เป็นเรื่องง่าย

thirdweb ให้บริการสำหรับ chain ที่ใช้ EVM เป็นส่วนใหญ่ รวมถึง [Chiliz Chain Mainnet](https://thirdweb.com/chiliz-chain) และ [Spicy Testnet](https://thirdweb.com/spicy-chain)

มีสองวิธีในการปรับใช้ smart contract บน Chiliz Chain โดยใช้เครื่องมือของ thirdweb:

* ใช้ไลบรารี Explore แบบเว็บ หากคุณต้องการ smart contract มาตรฐาน
* ใช้เครื่องมือ CLI หากคุณต้องการปรับใช้ smart contract แบบกำหนดเอง

เราจะอธิบายทั้งสองวิธีที่นี่

*หมายเหตุ: ทีม thirdweb ได้สร้างวิดีโอที่ยอดเยี่ยมเกี่ยวกับหัวข้อนี้:*

{% embed url="<https://www.youtube.com/watch?v=_fghhiFg870>" %}

## ปรับใช้ smart contract โดยใช้ Explore ของ thirdweb <a href="#deploy-a-smart-contract-using-remix-ide" id="deploy-a-smart-contract-using-remix-ide"></a>

thirdweb มี [Explore](https://thirdweb.com/explore) ซึ่งเป็นไลบรารีของ EVM smart contract ที่ผ่านการตรวจสอบแล้ว พร้อมเครื่องมือออนไลน์ที่ช่วยให้ทุกคนสามารถปรับใช้ smart contract มาตรฐานบน EVM chain ใดก็ได้

{% hint style="info" %}
คุณสามารถอ้างอิง [เอกสารทางการของ thirdweb สำหรับไลบรารี Explore](https://portal.thirdweb.com/tokens/explore/overview) ได้เช่นกัน
{% endhint %}

1. ไปที่ [thirdweb Explore](https://thirdweb.com/explore)
2. คลิก smart contract "Token"

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

{% hint style="info" %}
Fan Tokens ของ Chiliz เป็น CAP-20 token ซึ่งเป็นส่วนขยายเฉพาะของ Chiliz Chain จากมาตรฐาน Ethereum ERC20 token [เรียนรู้เพิ่มเติมเกี่ยวกับ CAP-20 ที่นี่](/th/riang-ru/glossary/cap-20.md)
{% endhint %}

หน้า smart contract จะเปิดขึ้น เราแนะนำให้คุณอ่านข้อมูลที่แสดงอย่างละเอียด

3. คลิกปุ่ม "Deploy Now" (มุมขวาบนของหน้าจอ)

แบบฟอร์มจะเปิดขึ้น:

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

4. กรอกข้อมูลในช่องแบบฟอร์มต่างๆ โดยเริ่มจากส่วน "Contract Metadata"

ส่วนที่เหลือสามารถปล่อยให้ Explore กรอกอัตโนมัติได้ แต่เราแนะนำให้คุณใส่ใจในแต่ละส่วน โดยเฉพาะอย่างยิ่ง:

* Recipient address: หากคุณเข้าสู่ระบบด้วยกระเป๋าเงิน (เช่น MetaMask) ช่องนี้ควรแสดงที่อยู่กระเป๋าเงินของคุณอยู่แล้ว ตรวจสอบให้แน่ใจว่าเป็นของคุณจริงๆ!
* Deploy options: นี่คือที่ที่คุณเลือก chain ที่ต้องการปรับใช้ smart contract ตรวจสอบให้แน่ใจว่าเลือก Chiliz Chain (หรือ Spicy Testnet ตามความต้องการของคุณ)!

5. คลิก "Deploy Now" เพื่อปรับใช้ Token ของคุณบน Chiliz Chain

{% hint style="warning" %}
ตรวจสอบให้แน่ใจว่ากระเป๋าเงินของคุณมี CHZ เพียงพอสำหรับชำระค่าธรรมเนียมธุรกรรม!
{% endhint %}

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

คุณจะต้องลงนามธุรกรรมจากกระเป๋าเงิน โดยจำนวนครั้งอาจแตกต่างกันไป

6. คลิก "View Now" เพื่อเข้าถึง thirdweb dashboard และดู smart contract ที่ปรับใช้แล้ว

## ปรับใช้ smart contract โดยใช้เครื่องมือ CLI ของ thirdweb <a href="#deploy-a-smart-contract-using-remix-ide" id="deploy-a-smart-contract-using-remix-ide"></a>

เครื่องมือ `deploy` ของ thirdweb ช่วยให้การปรับใช้ smart contract บน EVM chain ใดก็ได้ (รวมถึง Chiliz Chain) เป็นเรื่องง่ายด้วยคำสั่งเดียว โดยจัดการรายละเอียดทางเทคนิคที่ซับซ้อนโดยอัตโนมัติ

วิธีนี้แนะนำหากคุณต้องการใช้ smart contract ที่ไม่ใช่มาตรฐาน (เช่น [smart contract OpenZeppelin แบบกำหนดเอง](https://www.openzeppelin.com/solidity-contracts))

{% hint style="info" %}
คุณสามารถอ้างอิง [เอกสารทางการของ thirdweb สำหรับเครื่องมือปรับใช้](https://portal.thirdweb.com/contracts/deploy/overview) ได้เช่นกัน
{% endhint %}

### การติดตั้ง thirdweb CLI

ในการใช้เครื่องมือ deploy ของ thirdweb คุณต้องมี:

* การติดตั้ง Node.js และเครื่องมือ npm ในเครื่องของคุณ
* การติดตั้งเครื่องมือ thirdweb CLI ในเครื่องของคุณ

ในการติดตั้ง Node.js และ npm [ทำตามคำแนะนำที่นี่](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm)

จากนั้นคุณสามารถติดตั้ง thirdweb CLI โดยรันคำสั่งต่อไปนี้ใน terminal:

```bash
npm i -g @thirdweb-dev/cli
```

ทีม thirdweb ได้สร้าง [วิดีโอเจาะลึกสำหรับ thirdweb CLI](https://www.youtube.com/watch?v=8ttGHEQ-Ddo) ซึ่งคุณควรดูอย่างแน่นอน!

### การปรับใช้ smart contract โดยใช้ thirdweb CLI

เมื่อคุณติดตั้ง CLI แล้ว คุณสามารถใช้มันเพื่อปรับใช้ smart contract ของคุณได้

1. จาก terminal ไปยังไดเรกทอรีรากของ repository smart contract ของคุณ
2. รันคำสั่ง deploy:

```bash
npx thirdweb deploy
```

จากนั้นระบบจะแนะนำคุณผ่านกระบวนการปรับใช้ smart contract:

1. ระบบจะเชื่อมต่อกับ thirdweb dashboard ของคุณโดยการเปิดหน้าต่างเบราว์เซอร์
2. จาก dashboard คุณจะต้องอนุมัติอุปกรณ์ของคุณ ซึ่งต้องให้คุณลงนามธุรกรรมโดยใช้กระเป๋าเงินที่คุณใช้กับ thirdweb

ดูการสาธิตจากทีม thirdweb:

{% embed url="<https://www.youtube.com/watch?v=6EqumMCa-E8>" %}


---

# 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/deploy-smart-contract/deploy-thirdweb.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.
