General
What smart contract language does Stellar use?
What smart contract language does Stellar use?
soroban-sdk (v25.1.1 for LayerZero contracts).How is LayerZero's Stellar integration different from EVM?
How is LayerZero's Stellar integration different from EVM?
- Authorization: Uses
require_auth()instead ofmsg.sender - Token standard: SEP-41 instead of ERC-20
- Contract composition: Trait composition with proc macros instead of inheritance
- Storage: Three-tiered storage (instance, persistent, temporary) with TTL management
- Fee payment: Explicit SEP-41 token transfer instead of
msg.value - Address format: 32 bytes (contract or account) instead of 20 bytes
Do I need to deploy my own Endpoint?
Do I need to deploy my own Endpoint?
- Deploy your OApp or OFT contract, passing the Endpoint address in the constructor
- Set peers for each remote chain
- Configure enforced options and security stack (DVNs)
Development
What Rust version should I use?
What Rust version should I use?
wasm32v1-none target. Pin your version with a rust-toolchain.toml file:How do I use the #[oapp] macro?
How do I use the #[oapp] macro?
#[oapp] macro generates implementations for OAppCore, OAppSenderInternal, OAppReceiver, and OAppOptionsType3. Apply it to your contract struct together with #[lz_contract]:LzReceiveInternal for your receive logic. To customize specific traits, use #[oapp(custom = [receiver])].What is the difference between LockUnlock and MintBurn OFT modes?
What is the difference between LockUnlock and MintBurn OFT modes?
- LockUnlock: Tokens are locked in the OFT contract on send and unlocked on receive. Use this when you don’t control the token’s minting capability.
- MintBurn: Tokens are burned on send and minted on receive via an external
Mintablecontract. Use this when you control the token supply.
OftType enum in the constructor.How do I handle the two address types (C-address vs G-address)?
How do I handle the two address types (C-address vs G-address)?
resolve_address utility handles disambiguation automatically by checking if a contract exists at the address. You typically don’t need to handle this yourself — the OFT contract resolves addresses when crediting tokens to recipients.How do I handle decimal precision for OFTs?
How do I handle decimal precision for OFTs?
- Local decimals: Token’s native decimals on the chain (e.g., 7 for Stellar)
- Shared decimals: Crosschain precision (typically 6)
- Conversion rate:
10^(local - shared)
1,000,015 becomes 1,000,010 (the trailing 5 is dust).shared_decimals is set at deployment and cannot be changed. Use 6 for compatibility with most chains.See OFT Overview - Decimal Precision for details.Gas and Fees
How are LayerZero fees paid on Stellar?
How are LayerZero fees paid on Stellar?
msg.value, Stellar requires explicit SEP-41 token transfers. The OApp base contract handles this internally — it transfers XLM (native token) to the Endpoint before calling send. As a developer, you just pass the fee from the quote function (__quote for OApp, quote_send for OFT) to the send function.How does Soroban's fee model work?
How does Soroban's fee model work?
- CPU instructions: Computation cost
- Memory: Runtime memory allocation
- Storage I/O: Read/write bytes and entries
- Transaction size: Byte size of the transaction
Why are storage operations expensive?
Why are storage operations expensive?
Configuration
How do I configure DVNs on Stellar?
How do I configure DVNs on Stellar?
set_config function. You provide an XDR-encoded OAppUlnConfig with config type 2 (send) or 3 (receive). See DVN & Executor Config for detailed instructions.What are enforced options and why should I set them?
What are enforced options and why should I set them?
Why does XDR encoding matter for configuration?
Why does XDR encoding matter for configuration?
Can I change configuration after deployment?
Can I change configuration after deployment?
- Peers:
set_peerto add or update remote chain connections - Enforced options:
set_enforced_optionsto adjust gas limits per destination - Delegate:
set_delegateto assign or change the operational delegate
- Message libraries: Send and receive library selection
- DVN and Executor settings: Via the Endpoint’s
set_configfunction
Troubleshooting
My message was sent but not received. What should I check?
My message was sent but not received. What should I check?
- Check LayerZero Scan: Look up the message GUID on LayerZero Scan to see its status.
- Verify peers: Ensure peers are set on both the source and destination chains.
- Check DVN status: The message may be waiting for DVN verification. Use the receive library’s
verifiable(e.g. on ULN-302) to check whether DVNs have reached quorum. - Check executor: The executor may not have delivered yet. Check
endpoint.inbound_payload_hash(receiver, src_eid, sender, nonce)to see if it’s been verified but not delivered. - Check enforced options: Insufficient gas on the destination can cause delivery to fail silently.
How do I recover a stuck message?
How do I recover a stuck message?
- Retry delivery: The executor will typically retry automatically.
- Skip: Skip the nonce if using ordered delivery:
endpoint.skip() - Nilify: Void the message (can be re-verified later):
endpoint.nilify() - Burn: Permanently destroy a nonce (irreversible):
endpoint.burn() - Clear: Remove the payload:
endpoint.clear()
I'm getting 'ArchivedEntry' errors. What happened?
I'm getting 'ArchivedEntry' errors. What happened?
stellar contract restore or call any function that accesses the entry (TTL is automatically extended on access).Security
How does the 2-step ownership transfer work?
How does the 2-step ownership transfer work?
- Current owner calls
begin_ownership_transfer(new_owner, ttl)— proposes transfer with a TTL window - New owner calls
accept_ownership()— confirms within the TTL - If not accepted in time, the proposal expires and the original owner retains ownership
transfer_ownership is also available but is immediate and irreversible.This ensures the new owner can actually receive and operate the contract.How are DVNs authenticated on Stellar?
How are DVNs authenticated on Stellar?
Next Steps
- Common Errors: Detailed error codes and solutions.
- Getting Started: Key differences between EVM and Stellar development.
- Technical Overview: Deep dive into Soroban architecture.