ccip

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Chainlink CCIP (Hedera)

Chainlink CCIP(Hedera)

CCT burn-and-mint pattern: deploy a burn-mint token + token pool on each chain, register the token with CCIP, wire remote pools with chain selectors, then
ccipSend
paying native fees.
text
BurnMint token + TokenPool (source)
        → Router.ccipSend(destSelector, message)
             → TokenPool lockOrBurn / releaseOrMint (dest)
On Hedera you can use a vanilla ERC-20 CCT or an HTS-backed wrapper. CCIP always registers the ERC-20 the pool sees — for HTS that is the wrapper, while users hold the native HTS token.
This skill is cross-chain tokens/messages, not Chainlink Data Feeds.
CCT burn-and-mint 模式: 在每条链上部署燃烧铸造代币 + 代币池,将代币注册至 CCIP,通过 chain selectors 连接远程池,随后调用
ccipSend
并支付原生费用。
text
BurnMint token + TokenPool (source)
        → Router.ccipSend(destSelector, message)
             → TokenPool lockOrBurn / releaseOrMint (dest)
在 Hedera 上,你可以使用标准 ERC-20 CCT 或者 HTS 支撑的包装器。CCIP 始终注册池所能识别的 ERC-20 代币——对于 HTS 来说,这个代币就是包装器,而用户持有的是原生 HTS 代币。
本技能涉及跨链代币/消息,不包含 Chainlink Data Feeds 相关内容。

Quick Reference

快速参考

PieceRole
Router
getFee
+
ccipSend{value}
Chain selector
uint64
CCIP id — not EVM chain ID
Token + poolBurn-mint ERC-20 +
BurnMintTokenPool
(or Hedera HTS variants)
Admin registry
RegistryModuleOwnerCustom
→
TokenAdminRegistry.acceptAdminRole
→
setPool
Lane config
TokenPool.applyChainUpdates
both directions
FeeNative gas (
feeToken = address(0)
); attach
msg.value
Receiver
abi.encode(address)
in
EVM2AnyMessage.receiver
See references/hedera-ccip.md for where to source selectors and registry addresses. See references/examples.md for register / wire / send sketches.
组件作用
Router
getFee
+
ccipSend{value}
Chain selector
uint64
类型的 CCIP ID —— 不是 EVM 链 ID
代币 + 资金池燃烧铸造 ERC-20 +
BurnMintTokenPool
(或 Hedera HTS 变体)
管理员注册表
RegistryModuleOwnerCustom
→
TokenAdminRegistry.acceptAdminRole
→
setPool
通道配置双向调用
TokenPool.applyChainUpdates
费用原生 gas(
feeToken = address(0)
);需附带
msg.value
接收方
EVM2AnyMessage.receiver
字段中的
abi.encode(address)
关于选择器和注册表地址的获取方式,请参阅 references/hedera-ccip.md。关于注册/连接/发送的示例代码,请参阅 references/examples.md。

Critical: Selectors, Not Chain IDs

关键注意事项:使用 selectors,而非链 ID

ccipSend
and pool
remoteChainSelector
take CCIP chain selectors. Hedera testnet (
296
) and Sepolia (
11155111
) have different selector values than their EVM chain IDs. Look them up in the CCIP directory; do not pass
296
as a selector.
Do not reuse Axelar GMP names or LayerZero EIDs here.
ccipSend
和池的
remoteChainSelector
参数接收的是 CCIP chain selectors。Hedera 测试网(
296
)和 Sepolia(
11155111
)的 selector 值与其 EVM 链 ID 不同。请在 CCIP 目录中查询对应值;不要直接将
296
作为 selector 传入。
请勿在此处复用 Axelar GMP 名称或 LayerZero EID。

Critical: Register Then Wire Both Lanes

关键注意事项:先注册,再双向连接通道

Incomplete registry/pool config bricks the token. Per chain:
  1. Deploy token + pool
  2. Grant the pool mint/burn roles on the token
  3. registerAdminViaGetCCIPAdmin(token)
    then
    acceptAdminRole(token)
  4. TokenAdminRegistry.setPool(token, pool)
  5. After both chains have token+pool addresses:
    applyChainUpdates
    on each pool (remote selector, remote pool, remote token)
Then send a small test amount and track it on CCIP Explorer.
注册表/资金池配置不完整会导致代币无法使用。每条链的操作步骤如下:
  1. 部署代币 + 资金池
  2. 为资金池授予代币的铸造/燃烧权限
  3. 调用
    registerAdminViaGetCCIPAdmin(token)
    ,然后调用
    acceptAdminRole(token)
  4. 调用
    TokenAdminRegistry.setPool(token, pool)
  5. 两条链都部署好代币和资金池并获取地址后:在每个资金池上调用
    applyChainUpdates
    (传入远程 selector、远程资金池地址、远程代币地址)
随后发送小额测试代币,并在 CCIP Explorer 上追踪交易状态。

Critical: Hedera HTS-Backed CCT

关键注意事项:Hedera HTS 支撑的 CCT

Vanilla path:
BurnMintERC20
+
BurnMintTokenPool
on Hedera EVM, same as Sepolia.
HTS-backed path:
  • Users hold a native HTS token created via precompile
    0x167
  • CCIP registers the wrapper (
    HtsBurnMintERC20
    ), not the HTS token id/address users see in wallets
  • Pool (
    HtsBurnMintTokenPool
    ) must associate itself with the native HTS token and approve the wrapper
  • Hedera → remote send needs two approvals: HTS → wrapper, wrapper → Router
  • Receiver accounts must associate the native HTS token before inbound mints
  • Mint/burn/transfer amounts must fit HTS
    int64
Do not mix Axelar or LayerZero token addresses into CCIP env/config.
标准方案:在 Hedera EVM 上部署
BurnMintERC20
+
BurnMintTokenPool
,与 Sepolia 上的方案一致。
HTS 支撑方案:
  • 用户持有通过预编译合约
    0x167
    创建的原生 HTS 代币
  • CCIP 注册的是包装器(
    HtsBurnMintERC20
    ),而非用户在钱包中看到的 HTS 代币 ID/地址
  • 资金池(
    HtsBurnMintTokenPool
    )必须与原生 HTS 代币关联,并向包装器授权
  • 从 Hedera 向远程链发送需要两次授权:HTS → 包装器、包装器 → Router
  • 接收方账户必须在接收铸造前关联原生 HTS 代币
  • 铸造/燃烧/转账的金额必须在 HTS
    int64
    的范围内
请勿将 Axelar 或 LayerZero 的代币地址混入 CCIP 的环境/配置中。

Send Flow (native fee)

发送流程(原生代币付费)

solidity
Client.EVM2AnyMessage memory message = Client.EVM2AnyMessage({
    receiver: abi.encode(receiver),
    data: "",
    tokenAmounts: tokenAmounts, // token is the CCIP-registered ERC-20 / wrapper
    feeToken: address(0),
    extraArgs: Client._argsToBytes(
        Client.EVMExtraArgsV2({ gasLimit: 0, allowOutOfOrderExecution: true })
    )
});

uint256 fee = IRouterClient(router).getFee(destinationChainSelector, message);
IERC20(tokenToSend).approve(router, amount);
IRouterClient(router).ccipSend{ value: fee }(destinationChainSelector, message);
solidity
Client.EVM2AnyMessage memory message = Client.EVM2AnyMessage({
    receiver: abi.encode(receiver),
    data: "",
    tokenAmounts: tokenAmounts, // token is the CCIP-registered ERC-20 / wrapper
    feeToken: address(0),
    extraArgs: Client._argsToBytes(
        Client.EVMExtraArgsV2({ gasLimit: 0, allowOutOfOrderExecution: true })
    )
});

uint256 fee = IRouterClient(router).getFee(destinationChainSelector, message);
IERC20(tokenToSend).approve(router, amount);
IRouterClient(router).ccipSend{ value: fee }(destinationChainSelector, message);

Checklist

检查清单

  • Chain selectors from the CCIP directory (not EVM chain IDs, Axelar names, or LZ EIDs)
  • Token admin registered and pool set on both chains
  • applyChainUpdates
    wired both directions before sending
  • Native fee attached to
    ccipSend
    (
    feeToken = address(0)
    )
  • HTS path: wrapper registered with CCIP; users hold native HTS; dual approve + associate
  • Amounts fit
    int64
    when touching HTS mint/burn
  • CCIP token/pool addresses not copied from Axelar/LayerZero configs
  • Chain selectors 来自 CCIP 目录(而非 EVM 链 ID、Axelar 名称或 LZ EID)
  • 两条链上都完成了代币管理员注册和资金池设置
  • 发送前已通过
    applyChainUpdates
    完成双向连接
  • ccipSend
    已附带原生代币费用(
    feeToken = address(0)
    )
  • HTS 方案:包装器已注册到 CCIP;用户持有原生 HTS;完成双重授权 + 关联
  • 涉及 HTS 铸造/燃烧时,金额在
    int64
    范围内
  • CCIP 代币/资金池地址未从 Axelar/LayerZero 配置中复制

References

参考资料

  • references/examples.md —— 注册、连接、发送、HTS 双重授权的示例代码
  • references/hedera-ccip.md —— selectors 与链 ID 的区别、Router/注册表地址的获取方式
  • CCIP 目录
  • CCIP burn-and-mint CCT
  • CCIP Explorer