Loading...
Loading...
LayerZero V2 messaging on Hedera. Use when building OFT / OApp bridges between Hedera and EVM chains, configuring Endpoint V2 peers and ULN/DVN/executor wiring, sending with quoteSend + send, implementing HTS-backed OFT connectors (mint/burn via 0x167), or relaying educational lzReceive flows on testnet.
npx skill4agent add hedera-dev/hedera-skills layerzero-messagingOFTsetPeerOFT (EVM) ←setPeer→ HTSConnectorOFT (Hedera)
│ send / quoteSend │ _debit burn / _credit mint (HTS 0x167)
└──────── Endpoint V2 + ULN + DVN + Executor ────────┘lzReceive| Concept | Rule |
|---|---|
| Endpoint | |
| Peer | |
| Send | |
| Receiver | |
| Hedera OFT | HTS-backed connector — create HTS token, burn on send, mint on receive |
| HTS fee | Deploy connector with native value to pay |
| Approval | User must |
| IDs | Use LayerZero EIDs in peers/ |
setPeer(remoteEid, remoteOAppAsBytes32)setSendLibrarysetReceiveLibrarysetConfig12setEnforcedOptionslzReceive1peers(remoteEid)0x167_debit_creditint64// Deploy with value so createFungibleToken fee is paid
new HTSConnectorOFT{ value: htsCreateValue }(name, symbol, lzEndpoint, owner);SendParam memory sendParam = SendParam({
dstEid: remoteEid,
to: bytes32(uint256(uint160(receiver))),
amountLD: amountLD,
minAmountLD: (amountLD * 9) / 10,
extraOptions: OptionsBuilder.newOptions().addExecutorLzReceiveOption(lzReceiveGas, 0),
composeMsg: "",
oftCmd: ""
});
MessagingFee memory fee = IOFT(localOFT).quoteSend(sendParam, false);
IOFT(localOFT).send{ value: fee.nativeFee }(sendParam, fee, payable(refundTo));quotecastOFTsetPeerhtsTokenAddress()lzReceivequoteSendsendbytes32