> 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/sung-khuen/omnichain-tokens/chiliz-to-base.md).

# Bridge จาก Chiliz Chain ไป Base

ในการ bridge token ที่มีอยู่แล้วจาก Chiliz Chain ไปยัง Base คุณต้องเขียนและปรับใช้ smart contract แยกกันสองสัญญา ได้แก่ OFT Adapter บน chain ที่ token นั้นมีอยู่แล้ว (Chiliz Chain) และ Native OFT บน chain ปลายทาง (Base)

{% hint style="info" %}
โปรดทราบว่า LayerZero มี [QuickStart สำหรับ OFT contracts](https://docs.layerzero.network/v2/developers/evm/oft/quickstart) รวมถึงบทเรียนสอนวิธี [mint จาก Chiliz Chain ไปยัง EVM chain อื่น](https://docs.layerzero.network/v2/deployments/evm-chains/chiliz-mainnet-oft-quickstart) เช่น Base โดยบทเรียนนั้นใช้ Optimism เป็น chain เป้าหมาย แต่คุณสามารถแทนที่ด้วย [รายละเอียดของ Base](https://docs.layerzero.network/v2/deployments/chains/base) ได้
{% endhint %}

## สิ่งที่จำเป็นต้องมีก่อนเริ่มต้น

คู่มือนี้ต้องการสิ่งต่อไปนี้:

* ที่อยู่ ERC20 token contract บน Chiliz Chain
* กระเป๋าเงิน Web3 (เช่น MetaMask) ที่ตั้งค่าให้ใช้งานได้กับทั้ง Chiliz Chain และ Base
  * [ดูที่นี่สำหรับการตั้งค่า RPC ของ Chiliz Chain](/th/phatthana/phuenthan/tho-chiliz-chain/tho-rpc.md)
  * [ดูที่นี่สำหรับการตั้งค่า RPC ของ Base Mainnet](https://docs.base.org/base-chain/quickstart/connecting-to-base)
* gas token ที่เพียงพอบนแต่ละ chain เพื่อจ่าย gas ค่าธรรมเนียมในการปรับใช้ smart contract รวมถึง gas สำหรับการส่งข้อความ
  * บน Chiliz Chain: token CHZ
  * บน Base: token ETH

เราจะใช้ [Hardhat](https://hardhat.org/) เป็นสภาพแวดล้อมพัฒนา และ Node/npx

## ขั้นตอนที่ 1: การพัฒนา Contract

### เตรียม `OFTAdapter` บน Chiliz Chain

{% hint style="warning" %}
นี่เป็นขั้นตอนเตรียมการ ยังไม่ต้องปรับใช้ทันที!\
คุณจะปรับใช้ในขั้นตอนที่ 3
{% endhint %}

smart contract `OFTAdapter` ทำหน้าที่เป็นกล่องล็อกสำหรับ token ที่มีอยู่ของคุณ เมื่อผู้ใช้ bridge token ออกจาก Chiliz Chain สัญญานี้จะล็อก ERC20 token ต้นฉบับเอาไว้

สร้างไฟล์ใหม่ชื่อ `ChilizTokenAdapter.sol` ในโฟลเดอร์ contracts ของคุณ:

```solidity
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.30;

import { OFTAdapter } from "@layerzerolabs/lz-evm-oapp-v2/contracts/oft/OFTAdapter.sol";
import { Ownable } from "@openzeppelin/contracts/access/Ownable.sol";

contract ChilizTokenAdapter is OFTAdapter {
    constructor(
        address _token,      // The address of your EXISTING Token on Chiliz Chain
        address _lzEndpoint, // The LayerZero V2 Endpoint address on Chiliz
        address _delegate    // The address capable of making configuration changes (usually your wallet)
    ) OFTAdapter(_token, _lzEndpoint, _delegate) Ownable(_delegate) {}
}
```

{% hint style="info" %}
อย่างที่เห็น smart contract นี้ขยายจาก [LayerZero OFT Adapter contract](https://github.com/LayerZero-Labs/LayerZero-v2/blob/main/packages/layerzero-v2/evm/oapp/contracts/oft/OFTAdapter.sol) รวมถึง smart contract `Ownable.sol` มาตรฐาน เพื่อมอบกุญแจบริหารจัดการ คุณต้องมีทั้งสองเพื่อให้คุณ และเฉพาะคุณเท่านั้น สามารถเชื่อมต่อ chain ต่าง ๆ ได้อย่างปลอดภัย
{% endhint %}

เมื่อปรับใช้สิ่งนี้บน Chiliz Chain Mainnet คุณต้องส่งที่อยู่ contract ของ token ที่มีอยู่เป็น `_token` และ Chiliz Endpoint V2 address (`0x6F475642a6e85809B1c36Fa62763669b1b48DD5B`) เป็น `_lzEndpoint`

ดู endpoint ที่พร้อมใช้งานทั้งหมดสำหรับ Chiliz Chain ได้ที่นี่:

{% embed url="<https://docs.layerzero.network/v2/deployments/chains/chiliz>" %}

### เตรียม `OFT` บน Base

เนื่องจาก token นั้นยังไม่มีอยู่บน Base โดยตรง คุณจึงต้องปรับใช้ smart contract OFT มาตรฐาน smart contract นี้มีสิทธิ์ mint token ใหม่เมื่อได้รับข้อความที่ถูกต้องจาก OFT Adapter ที่ปรับใช้บน Chiliz และเผา (burn) token เมื่อผู้ใช้ bridge กลับ

สร้างไฟล์ใหม่ชื่อ `BaseTokenOFT.sol` ในโฟลเดอร์ contracts ของคุณ:

```solidity
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.30;

import { OFT } from "@layerzerolabs/lz-evm-oapp-v2/contracts/oft/OFT.sol";
import { Ownable } from "@openzeppelin/contracts/access/Ownable.sol";

contract BaseTokenOFT is OFT {
    constructor(
        string memory _name,   // The name of the token (Should match your Chiliz Token)
        string memory _symbol, // The symbol of the token (Should match your Chiliz Token)
        address _lzEndpoint,   // The LayerZero V2 Endpoint address on Base
        address _delegate      // The address capable of making configuration changes
    ) OFT(_name, _symbol, _lzEndpoint, _delegate) Ownable(_delegate) {}
}
```

{% hint style="info" %}
อย่างที่เห็น smart contract นี้ขยายจาก [LayerZero OFT contract](https://github.com/LayerZero-Labs/LayerZero-v2/blob/main/packages/layerzero-v2/evm/oapp/contracts/oft/OFT.sol) รวมถึง smart contract `Ownable.sol` มาตรฐาน ด้วยเหตุผลเดียวกับที่กล่าวไว้ข้างต้น
{% endhint %}

เมื่อปรับใช้บน Base ตรวจสอบให้แน่ใจว่า `_name` และ `_symbol` ตรงกับ token ต้นฉบับของคุณบน Chiliz Chain เพื่อไม่ให้ผู้ใช้สับสน ส่ง Base Endpoint V2 address (`0x1a44076050125825900e736c501f859c50fE728c`) เป็น `_lzEndpoint`

ดู endpoint ที่พร้อมใช้งานทั้งหมดสำหรับ Base ได้ที่นี่:

{% embed url="<https://docs.layerzero.network/v2/deployments/chains/base>" %}

## ขั้นตอนที่ 2: การตั้งค่า LayerZero

เมื่อ smart contract ของคุณพร้อมแล้ว คุณต้องบอกให้ LayerZero tooling ทราบว่าสัญญาเหล่านั้นเชื่อมต่อกันอย่างไร ซึ่งทำได้โดยใช้ไฟล์ `layerzero.config.ts` ที่อยู่ใน root ของโปรเจกต์ Hardhat ของคุณ

ไฟล์ configuration นี้ทำหน้าที่เป็นแผนผังสำหรับสถาปัตยกรรม cross-chain ของคุณ โดยจับคู่ smart contract ที่ปรับใช้แล้วกับ LayerZero Endpoint ID (EID) ที่เกี่ยวข้อง และกำหนดเส้นทาง (connections) ระหว่างสัญญาเหล่านั้น

[Simple Config Generator](https://docs.layerzero.network/v2/tools/simple-config) เป็นวิธีที่แนะนำสำหรับการสร้างการตั้งค่า wiring เนื่องจากทำการ wiring แบบสองทิศทางและใช้การตั้งค่าความปลอดภัยที่แนะนำโดยอัตโนมัติ

สร้างหรืออัปเดตไฟล์ `layerzero.config.ts` ของคุณใน root ของโปรเจกต์ Hardhat:

```typescript
import { ExecutorOptionType } from '@layerzerolabs/lz-v2-utilities';
import { OAppEnforcedOption, OmniPointHardhat } from '@layerzerolabs/toolbox-hardhat';
import { EndpointId } from '@layerzerolabs/lz-definitions';
import { generateConnectionsConfig } from '@layerzerolabs/metadata-tools';

// Define the Contracts
const chilizContract: OmniPointHardhat = {
    eid: EndpointId.CHILIZ_V2_MAINNET,
    contractName: 'ChilizTokenAdapter',
};

const baseContract: OmniPointHardhat = {
    eid: EndpointId.BASE_V2_MAINNET,
    contractName: 'BaseFanTokenOFT',
};

// Define standard EVM Gas Limits (Enforced Options)
const EVM_ENFORCED_OPTIONS: OAppEnforcedOption[] = [
    {
        msgType: 1,  // Standard OFT Transfer
        optionType: ExecutorOptionType.LZ_RECEIVE,
        gas: 200000, // Safe baseline gas limit for minting/unlocking
        value: 0,    
    },
];

// Export the Generated Configuration
export default async function () {
    return {
        contracts: [
            { contract: chilizContract },
            { contract: baseContract },
        ],
        connections: await generateConnectionsConfig([
            [
                chilizContract,  // Source
                baseContract,    // Destination
                [['LayerZero Labs'], []], // Default DVN Configuration
                [1, 1],                   // Block confirmations
                [EVM_ENFORCED_OPTIONS, EVM_ENFORCED_OPTIONS], // Execution Options [To Chiliz, To Base]
            ],
        ]),
    };
}
```

## ขั้นตอนที่ 3: กระบวนการปรับใช้

เมื่อเขียน smart contract เสร็จแล้วและเตรียม `layerzero.config.ts` ไว้แล้ว ถึงเวลาปรับใช้ smart contract ไปยังเครือข่ายที่เกี่ยวข้อง LayerZero V2 toolbox ใช้ plugin `hardhat-deploy` เพื่อจัดการการปรับใช้อย่างมีประสิทธิภาพ

คุณต้องสร้าง deployment script สองไฟล์ในไดเรกทอรี `deploy/` ของโปรเจกต์: หนึ่งไฟล์สำหรับ Chiliz Chain Mainnet และอีกหนึ่งไฟล์สำหรับ Base Mainnet

### Deployment Script สำหรับ Chiliz Adapter

สร้างไฟล์ชื่อ `01_deploy_chiliz_adapter.ts` ในโฟลเดอร์ `deploy/` ของคุณ script นี้ส่งที่อยู่ token ที่มีอยู่และ Chiliz Endpoint V2 address ไปยัง constructor

```typescript
import { DeployFunction } from 'hardhat-deploy/types';

const deployAdapter: DeployFunction = async ({ getNamedAccounts, deployments }) => {
    const { deploy } = deployments;
    const { deployer } = await getNamedAccounts();

    // The address of your existing ERC-20 token on Chiliz
    const TOKEN_ADDRESS = "0xYourTokenAddressHere"; 
    
    // The Chiliz Mainnet Endpoint V2 Address
    const CHILIZ_ENDPOINT_V2 = "0x6F475642a6e85809B1c36Fa62763669b1b48DD5B";

    console.log("Deploying OFTAdapter to Chiliz Mainnet...");

    await deploy('ChilizTokenAdapter', {
        from: deployer,
        args: [
            TOKEN_ADDRESS,   // _token
            CHILIZ_ENDPOINT_V2,  // _lzEndpoint
            deployer             // _delegate (Owner)
        ],
        log: true,
        waitConfirmations: 2,
    });
};

export default deployAdapter;
deployAdapter.tags = ['ChilizTokenAdapter'];
```

### Deployment Script สำหรับ Base OFT

สร้างไฟล์ที่สองชื่อ `02_deploy_base_oft.ts` ในโฟลเดอร์ `deploy/` ของคุณ script นี้เริ่มต้น Native OFT ใหม่บน Base

```typescript
import { DeployFunction } from 'hardhat-deploy/types';

const deployOFT: DeployFunction = async ({ getNamedAccounts, deployments }) => {
    const { deploy } = deployments;
    const { deployer } = await getNamedAccounts();

    // Token Details (Must match your Chiliz Token)
    const TOKEN_NAME = "My Token";
    const TOKEN_SYMBOL = "TKN";

    // The Base Mainnet Endpoint V2 Address 
    const BASE_ENDPOINT_V2 = "0x1a44076050125825900e736c501f859c50fE728c";

    console.log("Deploying Native OFT to Base Mainnet...");

    await deploy('BaseTokenOFT', {
        from: deployer,
        args: [
            TOKEN_NAME,         // _name
            TOKEN_SYMBOL,       // _symbol
            BASE_ENDPOINT_V2,   // _lzEndpoint
            deployer            // _delegate (Owner)
        ],
        log: true,
        waitConfirmations: 2,
    });
};

export default deployOFT;
deployOFT.tags = ['BaseTokenOFT'];
```

### ดำเนินการปรับใช้

ตรวจสอบให้แน่ใจว่า `hardhat.config.ts` ของคุณมี RPC URL และ private key ที่ตั้งค่าไว้อย่างถูกต้องสำหรับทั้ง Chiliz Chain และ Base

{% content-ref url="/pages/v6cwrdVHIbumyt27iKUv" %}
[เชื่อมต่อด้วย RPC](/th/phatthana/phuenthan/tho-chiliz-chain/tho-rpc.md)
{% endcontent-ref %}

{% embed url="<https://docs.base.org/base-chain/quickstart/connecting-to-base>" %}

รันคำสั่งต่อไปนี้ใน terminal เพื่อปรับใช้ smart contract:

```bash
# 1. Deploy the Adapter to Chiliz Chain
npx hardhat deploy --network chiliz --tags ChilizTokenAdapter

# 2. Deploy the Native OFT to Base
npx hardhat deploy --network base --tags BaseTokenOFT
```

เมื่อการปรับใช้เสร็จสมบูรณ์ Hardhat จะบันทึกที่อยู่ contract ในโฟลเดอร์ `deployments/` LayerZero tooling จะอ่านที่อยู่เหล่านี้โดยอัตโนมัติเมื่อเรารันคำสั่ง wiring ในขั้นตอนถัดไป

## ขั้นตอนที่ 4: Wiring และ Peering

ณ ขั้นตอนนี้ smart contract `ChilizTokenAdapter` และ `BaseTokenOFT` ของคุณได้รับการปรับใช้บนแต่ละ chain แล้ว แต่ยังคงแยกออกจากกันโดยสมบูรณ์\
หาก Base contract ได้รับข้อความที่สั่งให้ mint token มันจำเป็นต้องทราบว่าข้อความนั้นมาจาก Adapter ของ *คุณ* บน Chiliz จริง ๆ ไม่ใช่จากผู้ไม่ประสงค์ดี

คุณต้องสร้างความไว้วางใจนี้โดยการ "wiring" smart contract เข้าด้วยกันในฐานะ peer ผ่านการเข้ารหัส

ทำได้โดยการรันคำสั่ง `wire` ซึ่งจะสร้างและดำเนินการธุรกรรมบนทั้ง Chiliz และ Base

{% hint style="info" %}
**สิ่งที่เกิดขึ้นเบื้องหลัง?**

การตั้งค่า pathway ของ LayerZero V2 แบบสมบูรณ์ต้องการธุรกรรม 6 รายการบนแต่ละ chain:

* `setSendLibrary`: กำหนด LayerZero MessageLib ที่รับผิดชอบในการส่งข้อความ (เช่น การตั้งค่าให้ใช้ V2 Send Library)
* `setReceiveLibrary`: กำหนด MessageLib ที่รับผิดชอบในการรับข้อความ (รวม `gracePeriod` ซึ่งมักตั้งไว้ที่ `0`)
* `setConfig` (Send Library): กำหนด Decentralized Verifier Networks (DVN) และ Executor เฉพาะสำหรับข้อความขาออก
* `setConfig` (Receive Library): กำหนด DVN เฉพาะที่จำเป็นในการยืนยันข้อความขาเข้า
* `setEnforcedOptions`: กำหนดขีดจำกัด gas สำหรับการดำเนินการ เมื่อผู้ใช้ส่งข้อความจาก Chiliz Chain พวกเขาจ่าย gas ปลายทางล่วงหน้า การตั้งค่า enforced options ช่วยให้มั่นใจว่าพวกเขาจ่าย gas เพียงพอสำหรับ LayerZero Executor เพื่อประมวลผลธุรกรรมบน Chiliz Chain ได้สำเร็จ
* `setPeer`: เชื่อมโยง destination Endpoint ID (EID) กับที่อยู่ smart contract ที่เชื่อถือได้ คุณต้องบอก smart contract บน Chiliz Chain ให้เชื่อถือ smart contract บน Base และ smart contract บน Base ให้เชื่อถือ smart contract บน Chiliz Chain
  {% endhint %}

### ดำเนินการ Wire Task

รันคำสั่งต่อไปนี้ใน terminal:

```bash
npx hardhat lz:oapp:wire --oapp-config layerzero.config.ts
```

toolchain จะคำนวณพารามิเตอร์ที่จำเป็นโดยอัตโนมัติ แสดงตารางธุรกรรมที่กำลังจะดำเนินการให้คุณดู และส่งธุรกรรมไปยัง Chiliz และ Base โดยใช้กระเป๋าเงิน deployer ของคุณ

เมื่อธุรกรรมได้รับการยืนยันบนทั้งสองเครือข่าย token bridge ของคุณก็พร้อมใช้งานและได้รับการตั้งค่าครบถ้วนอย่างเป็นทางการแล้ว! Chiliz Adapter ได้รับอนุญาตให้ส่งคำสั่ง mint ไปยัง Base และ Base ได้รับอนุญาตให้ส่งคำสั่ง unlock กลับมายัง Chiliz

## ขั้นตอนที่ 5: การใช้งานและการทดสอบ

เมื่อ smart contract ของคุณได้รับการปรับใช้และเชื่อมต่อกันอย่างปลอดภัยแล้ว token ของคุณก็กลายเป็น omnichain แล้ว ขั้นตอนสุดท้ายคือการดำเนินการ cross-chain transfer จาก Chiliz Chain Mainnet ไปยัง Base Mainnet

### 1) ดำเนินการ Cross-Chain Transfer

LayerZero V2 toolbox มี Hardhat task ในตัวเพื่อทดสอบการโอน OFT โดยตรงจาก terminal ของคุณ คำสั่งนี้จะประมาณ gas ค่าธรรมเนียม cross-chain เรียกเก็บเงินจากกระเป๋าเงินของคุณใน $CHZ (native gas token บน source chain) และเริ่มต้นการโอน

{% hint style="info" %}
เนื่องจาก `ChilizTokenAdapter` ต้องการสิทธิ์ในการล็อก Fan Tokens ที่มีอยู่ของคุณ จึงจำเป็นต้องมีธุรกรรม ERC-20 `approve()`

LayerZero CLI ตรวจพบสิ่งนี้และจัดการการอนุมัติโดยอัตโนมัติก่อนส่งข้อความ
{% endhint %}

รันคำสั่งต่อไปนี้:

{% code overflow="wrap" lineNumbers="true" %}

```bash
npx hardhat lz:oft:send --oapp-config layerzero.config.ts --from-eid 30409 --to-eid 30184 --amount 10
```

{% endcode %}

สิ่งที่คำสั่งนี้ทำ:

1. ค้นหา Chiliz Mainnet (`30409`) และ Base Mainnet (`30184`) ใน config ของคุณ
2. ดึงข้อมูลค่าธรรมเนียม cross-chain ที่ LayerZero Executor ต้องการ
3. เรียกฟังก์ชัน `send()` บน Chiliz Adapter ของคุณ
4. Adapter ล็อก token 10 รายการและส่ง packet ไปยัง LayerZero Endpoint

### 2) ติดตาม Packet บน LayerZero Scan

ธุรกรรม cross-chain เป็นแบบ asynchronous ในขณะที่ธุรกรรม Chiliz ของคุณจะได้รับการยืนยันภายในไม่กี่วินาที แต่ข้อความยังต้องได้รับการยืนยันและดำเนินการบน Base

ในการติดตามเส้นทางนี้แบบ real-time ให้คลิกลิงก์ LayerZero Scan ที่ปรากฏใน CLI output

เรียนรู้เพิ่มเติมเกี่ยวกับเครื่องมือนี้ได้ที่นี่:

{% embed url="<https://docs.layerzero.network/v2/developers/evm/tooling/layerzeroscan>" %}

## การตั้งค่าขีดจำกัด Gas

การตั้งค่าขีดจำกัด gas เป็นเรื่องสำคัญอย่างยิ่ง เนื่องจากการไม่ตั้งค่าอาจทำให้ข้อความ cross-chain ของคุณล้มเหลวบนเครือข่ายปลายทาง

เมื่อผู้ใช้ bridge token จาก Chiliz Chain ไปยัง Base พวกเขาจ่าย gas ค่าธรรมเนียมสำหรับ *ทั้งสอง* chain ล่วงหน้าในธุรกรรมเดียวบน Chiliz (โดยใช้ `$CHZ`) จากนั้น LayerZero ใช้ส่วนหนึ่งของค่าธรรมเนียมนั้นเพื่อจ่าย gas ETH จริงที่จำเป็นในการดำเนินการธุรกรรม minting บน Base

เพื่อให้แน่ใจว่า LayerZero มี gas เพียงพอในการประมวลผลฟังก์ชัน `lzReceive` บน chain ปลายทางได้สำเร็จ คุณต้องตั้งค่า Enforced Options หากไม่ตั้งค่าเหล่านี้ ธุรกรรมอาจ revert บน chain ปลายทางเนื่องจากข้อผิดพลาด "Out of Gas"

### **การตั้งค่า Options**

option นี้ตั้งค่าในไฟล์ `layerzero.config.ts` ของคุณ อัปเดต array `connections` เพื่อรวม block `enforcedOptions` สำหรับแต่ละ pathway:

{% code overflow="wrap" %}

```typescript
import { EndpointId } from '@layerzerolabs/lz-definitions';

// ... (contract definitions as before)

connections: [
    {
        from: 'ChilizTokenAdapter',
        to: 'BaseTokenOFT',
        config: {
            enforcedOptions: [
                {
                    msgType: 1,        // 1 = Standard OFT Transfer (SEND)
                    optionType: 1,     // 1 = lzReceive Option
                    gas: 200000,       // Estimated gas limit to mint on Base
                },
                {
                    msgType: 2,        // 2 = OFT Transfer with payload (SEND_AND_CALL)
                    optionType: 1,
                    gas: 250000,       // Slightly higher gas limit for complex calls
                }
            ]
        },
    },
    {
        from: 'BaseTokenOFT',
        to: 'ChilizTokenAdapter',
        config: {
            enforcedOptions: [
                {
                    msgType: 1,
                    optionType: 1,
                    gas: 200000,       // Estimated gas limit to unlock on Chiliz
                }
            ]
        },
    },
],
// ...
```

{% endcode %}

คำอธิบายพารามิเตอร์:

* `msgType: 1`: แทนการโอน token มาตรฐาน `msgType: 2` ใช้สำหรับการเรียกแบบ "composed" (เช่น การ bridge token และ stake ทันทีในคลิกเดียว)
* `optionType: 1`: สั่งให้ Executor ดำเนินการเพียงแค่เรียกฟังก์ชัน `lzReceive`
* `gas: 200000`: ขีดจำกัด gas พื้นฐานที่ปลอดภัยสำหรับ OFT mint และ unlock มาตรฐาน คุณสามารถปรับค่านี้ตามการใช้ gas จริงของ smart contract ที่ปรับใช้ของคุณ

หากคุณตั้งค่า option นี้หลังจาก wiring chain ไปแล้ว คุณสามารถ rewire พร้อมกับ option ที่ตั้งค่าใหม่โดยใช้คำสั่งเดิม:

{% code overflow="wrap" %}

```bash
npx hardhat lz:oapp:wire --oapp-config layerzero.config.ts
```

{% endcode %}

tooling จะตรวจพบการเปลี่ยนแปลงโดยอัตโนมัติและส่งธุรกรรม `setEnforcedOptions()` ไปยัง smart contract ของคุณบนทั้ง Chiliz และ Base ขณะนี้ เมื่อผู้ใช้เริ่มต้น bridge smart contract จะกำหนดให้ผู้ใช้จ่าย gas อย่างน้อย 200,000 หน่วยบน chain ปลายทาง เพื่อให้มั่นใจว่าการส่งมอบเป็นไปได้อย่างน่าเชื่อถือ


---

# 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/sung-khuen/omnichain-tokens/chiliz-to-base.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.
