Validates authorization for DVN contract operations.
fn __check_auth(
env: soroban_sdk::Env,
signature_payload: soroban_sdk::BytesN<32>,
auth_data: TransactionAuthData,
auth_contexts: soroban_sdk::Vec,
) -> Result<(), soroban_sdk::Error>
Sets the paused state of the worker.
When paused, the worker will reject new job assignments (e.g., assign_job, get_fee). Existing jobs in progress are not affected.
paused - true to pause, false to unpausefn set_paused(env: soroban_sdk::Env, paused: bool)
Sets admin status for an address.
Admins can configure worker settings like fee multipliers, deposit addresses, and supported option types.
Address type requirement: Admins used for execute/compose flows (Executor) or custom account auth (DVN) must be Ed25519 accounts. Contract-type addresses cannot participate in custom account authorization. Only Ed25519 account addresses can sign for execute/compose and DVN admin operations. Contract-type admins are not supported for these flows;
admin - The address to set admin status foractive - true to add admin, false to removefn set_admin(env: soroban_sdk::Env, admin: soroban_sdk::Address, active: bool)
Sets whether a message library is supported by this worker.
Message libraries (e.g., ULN302) call workers to assign jobs. Only supported libraries can interact with this worker.
message_lib - The message library contract addresssupported - true to add support, false to remove supportfn set_supported_message_lib(
env: soroban_sdk::Env,
message_lib: soroban_sdk::Address,
supported: bool,
)
Sets allowlist status for an OApp address.
When the allowlist is empty, all OApps are allowed (unless on denylist). When the allowlist is not empty, only allowlisted OApps are allowed. Denylist always takes precedence over allowlist.
oapp - The OApp contract addressallowed - true to add to allowlist, false to removefn set_allowlist(env: soroban_sdk::Env, oapp: soroban_sdk::Address, allowed: bool)
Sets denylist status for an OApp address.
Denylisted OApps are blocked from using this worker, even if they're on the allowlist (denylist takes precedence).
oapp - The OApp contract addressdenied - true to add to denylist, false to removefn set_denylist(env: soroban_sdk::Env, oapp: soroban_sdk::Address, denied: bool)
Sets the default fee multiplier in basis points.
The multiplier is applied to base fees during fee calculation. Used when no destination-specific multiplier is configured.
admin - Admin address (must provide authorization)multiplier_bps - Multiplier in basis points (10000 = 1x, 12000 = 1.2x)fn set_default_multiplier_bps(
env: soroban_sdk::Env,
admin: soroban_sdk::Address,
multiplier_bps: u32,
)
Sets the deposit address where worker fees are collected.
When jobs are assigned, fees are directed to this address.
admin - Admin address (must provide authorization)deposit_address - Address to receive collected feesfn set_deposit_address(
env: soroban_sdk::Env,
admin: soroban_sdk::Address,
deposit_address: soroban_sdk::Address,
)
Sets supported executor option types for a destination endpoint.
admin - Admin address (must provide authorization)eid - Destination endpoint ID (chain identifier)option_types - Supported option types. Each byte represents an option type.fn set_supported_option_types(
env: soroban_sdk::Env,
admin: soroban_sdk::Address,
eid: u32,
option_types: soroban_sdk::Bytes,
)
Sets the worker fee library contract address.
The fee library calculates fees based on executor options and price feed data.
admin - Admin address (must provide authorization)worker_fee_lib - Fee library contract address implementing IExecutorFeeLibfn set_worker_fee_lib(
env: soroban_sdk::Env,
admin: soroban_sdk::Address,
worker_fee_lib: soroban_sdk::Address,
)
Sets the price feed contract address.
The price feed provides gas prices and exchange rates for cross-chain fee calculations.
admin - Admin address (must provide authorization)price_feed - Price feed contract address implementing ILayerZeroPriceFeedfn set_price_feed(
env: soroban_sdk::Env,
admin: soroban_sdk::Address,
price_feed: soroban_sdk::Address,
)
Returns whether the worker is paused.
fn paused(env: soroban_sdk::Env) -> bool
Returns whether an address is an admin.
admin - The address to checkfn is_admin(env: soroban_sdk::Env, admin: soroban_sdk::Address) -> bool
Returns all admin addresses.
fn admins(env: soroban_sdk::Env) -> soroban_sdk::Vec
Returns whether a message library is supported.
message_lib - Message library contract addressfn is_supported_message_lib(
env: soroban_sdk::Env,
message_lib: soroban_sdk::Address,
) -> bool
Returns all supported message library addresses.
Vector of supported message library contract addresses.
fn message_libs(env: soroban_sdk::Env) -> soroban_sdk::Vec
Returns whether an OApp is on the allowlist.
oapp - OApp contract addressfn is_on_allowlist(env: soroban_sdk::Env, oapp: soroban_sdk::Address) -> bool
Returns the number of addresses on the allowlist.
fn allowlist_size(env: soroban_sdk::Env) -> u32
Returns whether an OApp is on the denylist.
oapp - OApp contract addressfn is_on_denylist(env: soroban_sdk::Env, oapp: soroban_sdk::Address) -> bool
Returns whether an OApp has access control list (ACL) permission.
ACL evaluation order:
oapp - OApp contract address to checkfn has_acl(env: soroban_sdk::Env, oapp: soroban_sdk::Address) -> bool
Returns the default fee multiplier in basis points.
fn default_multiplier_bps(env: soroban_sdk::Env) -> u32
Returns the deposit address where fees are collected.
fn deposit_address(env: soroban_sdk::Env) -> Option
Returns supported option types for a destination endpoint.
eid - Destination endpoint ID (chain identifier)fn get_supported_option_types(
env: soroban_sdk::Env,
eid: u32,
) -> Option
Returns the worker fee library contract address.
fn worker_fee_lib(env: soroban_sdk::Env) -> Option
Returns the price feed contract address.
fn price_feed(env: soroban_sdk::Env) -> Option
Calculates the verification fee for a cross-chain message.
Called by the send library to quote DVN fees before sending.
fn get_fee(
env: soroban_sdk::Env,
send_lib: soroban_sdk::Address,
sender: soroban_sdk::Address,
dst_eid: u32,
packet_header: soroban_sdk::Bytes,
payload_hash: soroban_sdk::BytesN<32>,
confirmations: u64,
options: soroban_sdk::Bytes,
) -> i128
Assigns a verification job to this DVN and returns fee payment info.
Called by the send library when a message is sent. The DVN will later verify the message on the destination chain.
fn assign_job(
env: soroban_sdk::Env,
send_lib: soroban_sdk::Address,
sender: soroban_sdk::Address,
dst_eid: u32,
packet_header: soroban_sdk::Bytes,
payload_hash: soroban_sdk::BytesN<32>,
confirmations: u64,
options: soroban_sdk::Bytes,
) -> FeeRecipient
Dispatches external contract calls.
fn execute_transaction(env: soroban_sdk::Env, calls: soroban_sdk::Vec)
Sets the upgrader contract address. Requires self authorization.
fn set_upgrader(env: soroban_sdk::Env, upgrader: Option)
Returns the current upgrader contract address, if set.
fn upgrader(env: soroban_sdk::Env) -> Option
Sets destination chain configurations. Requires admin authorization.
fn set_dst_config(
env: soroban_sdk::Env,
admin: soroban_sdk::Address,
params: soroban_sdk::Vec,
)
Returns the destination configuration for a specific endpoint ID.
fn dst_config(env: soroban_sdk::Env, dst_eid: u32) -> Option
Returns the Verifier ID for this DVN.
fn vid(env: soroban_sdk::Env) -> u32
Computes the hash of call data for multisig signing.
Off-chain signers use this to compute the hash they need to sign.
fn hash_call_data(
env: soroban_sdk::Env,
vid: u32,
expiration: u64,
calls: soroban_sdk::Vec,
) -> soroban_sdk::BytesN<32>
Initializes the DVN contract.
vid - Verifier ID, unique identifier for this DVNsigners - Initial multisig signers (20-byte Ethereum addresses)threshold - Minimum signatures required for multisig operationsadmins - Initial admin addresses for operational functionssupported_msglibs - Message libraries this DVN supports (e.g., ULN302)price_feed - Price feed contract for fee calculationsdefault_multiplier_bps - Default fee multiplier (10000 = 1x)worker_fee_lib - Fee library contract for computing DVN feesdeposit_address - Address to receive fee paymentsfn __constructor(
env: soroban_sdk::Env,
vid: u32,
signers: soroban_sdk::Vec>,
threshold: u32,
admins: soroban_sdk::Vec,
supported_msglibs: soroban_sdk::Vec,
price_feed: soroban_sdk::Address,
default_multiplier_bps: u32,
worker_fee_lib: soroban_sdk::Address,
deposit_address: soroban_sdk::Address,
)
Sets admin status for an address. Can be called by an existing admin.
This allows existing admins to add or remove other admins without going through the owner/multisig path.
caller - The admin calling this function (must provide authorization)admin - The address to set admin status foractive - true to add admin, false to removefn set_admin_by_admin(
env: soroban_sdk::Env,
caller: soroban_sdk::Address,
admin: soroban_sdk::Address,
active: bool,
)
Upgrades the contract to new WASM bytecode.
fn upgrade(env: soroban_sdk::Env, new_wasm_hash: soroban_sdk::BytesN<32>)
Runs migration logic after an upgrade.
fn migrate(env: soroban_sdk::Env, migration_data: soroban_sdk::Bytes)
fn authorizer(env: soroban_sdk::Env) -> Option
Adds or removes a signer from the multisig. Requires owner authorization.
fn set_signer(env: soroban_sdk::Env, signer: soroban_sdk::BytesN<20>, active: bool)
Sets the signature threshold (quorum). Requires owner authorization.
fn set_threshold(env: soroban_sdk::Env, threshold: u32)
Returns all registered signers.
fn get_signers(env: soroban_sdk::Env) -> soroban_sdk::Vec>
Returns the total number of registered signers.
fn total_signers(env: soroban_sdk::Env) -> u32
Checks if an address is a registered signer.
fn is_signer(env: soroban_sdk::Env, signer: soroban_sdk::BytesN<20>) -> bool
Returns the current signature threshold (quorum).
fn threshold(env: soroban_sdk::Env) -> u32
Verifies signatures against the configured threshold.
fn verify_signatures(
env: soroban_sdk::Env,
digest: soroban_sdk::BytesN<32>,
signatures: soroban_sdk::Vec>,
)
Verifies signatures against a custom threshold.
fn verify_n_signatures(
env: soroban_sdk::Env,
digest: soroban_sdk::BytesN<32>,
signatures: soroban_sdk::Vec>,
threshold: u32,
)
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