Sets default executor configurations for multiple destination endpoints.
fn set_default_executor_configs(
env: soroban_sdk::Env,
params: soroban_sdk::Vec,
)
Sets default send ULN configurations for multiple destination endpoints.
fn set_default_send_uln_configs(
env: soroban_sdk::Env,
params: soroban_sdk::Vec,
)
Returns the treasury address for fee collection.
fn treasury(env: soroban_sdk::Env) -> soroban_sdk::Address
Returns the default executor configuration for a destination endpoint.
fn default_executor_config(
env: soroban_sdk::Env,
dst_eid: u32,
) -> Option
Returns the OApp-specific executor configuration for a destination endpoint.
fn oapp_executor_config(
env: soroban_sdk::Env,
sender: soroban_sdk::Address,
dst_eid: u32,
) -> Option
Returns the effective executor configuration by merging OApp config with default.
fn effective_executor_config(
env: soroban_sdk::Env,
sender: soroban_sdk::Address,
dst_eid: u32,
) -> ExecutorConfig
Returns the default send ULN configuration for a destination endpoint.
fn default_send_uln_config(env: soroban_sdk::Env, dst_eid: u32) -> Option
Returns the OApp-specific send ULN configuration for a destination endpoint.
fn oapp_send_uln_config(
env: soroban_sdk::Env,
sender: soroban_sdk::Address,
dst_eid: u32,
) -> Option
Returns the effective send ULN configuration by merging OApp config with default.
fn effective_send_uln_config(
env: soroban_sdk::Env,
sender: soroban_sdk::Address,
dst_eid: u32,
) -> UlnConfig
Quotes the total fee for sending a cross-chain message.
Calculates fees from: executor (message execution), DVNs (verification), and treasury (protocol fee).
fn quote(
env: soroban_sdk::Env,
packet: OutboundPacket,
options: soroban_sdk::Bytes,
pay_in_zro: bool,
) -> MessagingFee
Sends a cross-chain message and returns fee recipients for payment.
Assigns executor and DVNs, calculates fees, and encodes the packet for transmission.
fn send(
env: soroban_sdk::Env,
packet: OutboundPacket,
options: soroban_sdk::Bytes,
pay_in_zro: bool,
) -> FeesAndPacket
Called by a DVN to verify a message with a specific number of block confirmations.
Stores the DVN's verification attestation which will be checked during commit_verification.
fn verify(
env: soroban_sdk::Env,
dvn: soroban_sdk::Address,
packet_header: soroban_sdk::Bytes,
payload_hash: soroban_sdk::BytesN<32>,
confirmations: u64,
)
Permissionless function to commit a verified message to the endpoint after sufficient DVN verification.
Validates the packet header and checks that enough DVNs have verified the message (all required DVNs + optional DVN threshold). Once verified, cleans up DVN confirmation storage and calls the endpoint to mark the message as verified and executable.
fn commit_verification(
env: soroban_sdk::Env,
packet_header: soroban_sdk::Bytes,
payload_hash: soroban_sdk::BytesN<32>,
)
Sets default receive ULN configurations for multiple source endpoints.
Validates each config and stores it as the default for the specified source EID.
fn set_default_receive_uln_configs(
env: soroban_sdk::Env,
params: soroban_sdk::Vec,
)
Returns the number of block confirmations a DVN has submitted for a specific message.
fn confirmations(
env: soroban_sdk::Env,
dvn: soroban_sdk::Address,
header_hash: soroban_sdk::BytesN<32>,
payload_hash: soroban_sdk::BytesN<32>,
) -> Option
Checks if a message has been sufficiently verified by DVNs and is ready to commit.
fn verifiable(
env: soroban_sdk::Env,
packet_header: soroban_sdk::Bytes,
payload_hash: soroban_sdk::BytesN<32>,
) -> bool
Returns the default receive ULN configuration for a source endpoint.
fn default_receive_uln_config(env: soroban_sdk::Env, src_eid: u32) -> Option
Returns the OApp-specific receive ULN configuration override for a source endpoint.
fn oapp_receive_uln_config(
env: soroban_sdk::Env,
receiver: soroban_sdk::Address,
src_eid: u32,
) -> Option
Returns the effective receive ULN configuration by merging OApp config with defaults.
fn effective_receive_uln_config(
env: soroban_sdk::Env,
receiver: soroban_sdk::Address,
src_eid: u32,
) -> UlnConfig
Sets OApp-specific configuration parameters for the message library.
Called by the endpoint on behalf of the OApp to configure executor and ULN settings. Supports three config types: EXECUTOR, SEND_ULN, and RECEIVE_ULN.
fn set_config(
env: soroban_sdk::Env,
oapp: soroban_sdk::Address,
params: soroban_sdk::Vec,
)
Returns the XDR-encoded effective configuration bytes.
fn get_config(
env: soroban_sdk::Env,
eid: u32,
oapp: soroban_sdk::Address,
config_type: u32,
) -> soroban_sdk::Bytes
Returns true if the message library has full default configurations for the endpoint ID.
fn is_supported_eid(env: soroban_sdk::Env, eid: u32) -> bool
Returns the version of the message library.
fn version(env: soroban_sdk::Env) -> MessageLibVersion
Returns the type of the message library.
fn message_lib_type(env: soroban_sdk::Env) -> MessageLibType
fn __constructor(
env: soroban_sdk::Env,
owner: soroban_sdk::Address,
endpoint: soroban_sdk::Address,
treasury: soroban_sdk::Address,
)
Returns the LayerZero endpoint contract address.
fn endpoint(env: soroban_sdk::Env) -> soroban_sdk::Address
fn authorizer(env: soroban_sdk::Env) -> Option
Returns the current owner address, or None if no owner is set.
fn owner(env: soroban_sdk::Env) -> Option
Returns the pending owner address for 2-step transfer, or None if no transfer is pending.
fn pending_owner(env: soroban_sdk::Env) -> Option
Transfers ownership immediately to a new address.
Use with caution - if you transfer to a wrong address, ownership is lost forever.
Consider using begin_ownership_transfer instead.
OwnerNotSet if no owner is currently setTransferInProgress if a 2-step transfer is in progressfn transfer_ownership(env: soroban_sdk::Env, new_owner: soroban_sdk::Address)
Begins an ownership transfer to a new address.
The new owner must call accept_ownership() within ttl ledgers
to complete the transfer. The pending transfer will automatically expire after.
new_owner - The proposed new ownerttl - Number of ledgers the new owner has to accept.
Use 0 to cancel a pending transfer (new_owner must match pending).OwnerNotSet if no owner is currently setNoPendingTransfer when cancelling and no pending transfer existsInvalidTtl if ttl exceeds max TTLInvalidPendingOwner when cancelling with wrong new_owner addressfn begin_ownership_transfer(
env: soroban_sdk::Env,
new_owner: soroban_sdk::Address,
ttl: u32,
)
Accepts a pending 2-step ownership transfer.
Must be called by the pending owner before the TTL expires.
NoPendingTransfer if there is no pending transfer (or it expired)fn accept_ownership(env: soroban_sdk::Env)
Permanently renounces ownership.
OwnerNotSet if no owner is currently setTransferInProgress if a 2-step transfer is in progress (cancel it first)fn renounce_ownership(env: soroban_sdk::Env)
Extends the instance TTL.
threshold - The threshold to extend the TTL (if current TTL is below this, extend).extend_to - The TTL to extend to.fn extend_instance_ttl(env: soroban_sdk::Env, threshold: u32, extend_to: u32)
Sets TTL configs for instance and persistent storage.
None values remove the corresponding config (disables auto-extension for that type)threshold <= extend_to <= MAX_TTLinstance - TTL config for instance storagepersistent - TTL config for persistent storageTtlConfigFrozen if configs are frozenInvalidTtlConfig if validation failsfn set_ttl_configs(
env: soroban_sdk::Env,
instance: Option,
persistent: Option,
)
Returns the current TTL configs as (instance_config, persistent_config).
fn ttl_configs(env: soroban_sdk::Env) -> (Option, Option)
Permanently freezes TTL configs, preventing any future modifications.
This is irreversible and provides immutability guarantees to users.
Emits TtlConfigsFrozen event.
TtlConfigAlreadyFrozen if already frozenfn freeze_ttl_configs(env: soroban_sdk::Env)
Returns whether TTL configs are frozen.
fn is_ttl_configs_frozen(env: soroban_sdk::Env) -> bool