Skip to content

Instantly share code, notes, and snippets.

Overview & Preliminaries

What we’re doing

  1. Set the peer (i.e., the OFT’s counterparty address on SUI) in your OFT contract.
  2. Configure the LayerZero endpoint with correct DVN and executor settings (send side, receive side).
  3. Optionally set enforced options (gas, value) for cross-chain message execution.

References

@chan-lz
chan-lz / oft_migration.md
Last active October 15, 2025 16:51
instruction to migrate(get back the treasury_cap)

The following codes are in OFT for migrating it to another OFT or/and getting back the treasury cap. In deUSD case, you would use the CallCap to initalize the new CustomOFT but pertain the treasury cap in your own token package for native mint.

The MigrationCap is the cap that will be created after initialization of an OFT, which we will provide to you when transfering the ownership.

/// Container for OFT components during migration operations.
public struct MigrationTicket<phantom T> {
    /// Address of the migration capability
    migration_cap: address,
    /// Call capability granting authorization for LayerZero operations
@chan-lz
chan-lz / instructions_wdeusd.md
Created October 14, 2025 02:17
instructions_wdeusd.md

Overview & Preliminaries

What we’re doing

  1. Set the peer (i.e., the OFT’s counterparty address on SUI) in your OFT contract.
  2. Configure the LayerZero endpoint with correct DVN and executor settings (send side, receive side).
  3. Optionally set enforced options (gas, value) for cross-chain message execution.

References

@chan-lz
chan-lz / deUSD_sui_to_eth.ts
Last active October 13, 2025 22:17
Script to send from SUI to ETH
#!/usr/bin/env ts-node
/**
* Script to send deUSD from Sui to Ethereum using LayerZero OFT
*
* Usage:
* 1. Set your private key in the PRIVATE_KEY_BASE64 environment variable
* 2. Adjust the AMOUNT_TO_SEND and RECEIVER_ADDRESS as needed
* 3. Run: npx ts-node scripts/send-deusd-to-eth.ts
*/
@chan-lz
chan-lz / instructions.md
Last active October 10, 2025 21:04
Instruction to wire deUSD from ETH to SUI

Overview & Preliminaries

What we’re doing

  1. Set the peer (i.e., the OFT’s counterparty address on SUI) in your OFT contract.
  2. Configure the LayerZero endpoint with correct DVN and executor settings (send side, receive side).
  3. Optionally set enforced options (gas, value) for cross-chain message execution.

References