> 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

[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="/files/JNrGzTLvOWAQEn1BziUY" 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="/files/rFhVrNtdgAeM79PSkQ0B" 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="/files/DIyiaqU7GllHa2Zm7Jdf" 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 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/deploy-smart-contract/deploy-thirdweb.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.
