Contract 99bd0ddc506ee13fc4f433f0627092034dc38f4773ec16930a1823a1174431d4

← Back to Index 📥 Download WASM

Meta

rssdkver 23.5.3#d3e1ab2424388b10893b796b0c8e405c5edd03d2
rsver 1.93.0

Instances

  • CACMENFFJPJMSDAJQLX4R7K3SFZIW2LJSE3R2UMLGSWHFHS353FVXAZV

Interface

fn pause(env: soroban_sdk::Env)
fn paused(env: soroban_sdk::Env) -> bool
fn unpause(env: soroban_sdk::Env)
fn upgrade(
    env: soroban_sdk::Env,
    new_wasm_hash: soroban_sdk::BytesN<32>,
    operator: soroban_sdk::Address,
)
fn get_admin(env: soroban_sdk::Env) -> Option
fn get_owner(env: soroban_sdk::Env) -> Option
fn get_pauser(env: soroban_sdk::Env) -> Option
fn get_rescuer(env: soroban_sdk::Env) -> Option

Returns the message format version.

Arguments

  • e - Access to the Soroban environment.

Returns

The message format version.

fn get_version(env: soroban_sdk::Env) -> u32
fn accept_admin(env: soroban_sdk::Env)
fn rescue_sep41(
    env: soroban_sdk::Env,
    token_contract: soroban_sdk::Address,
    to: soroban_sdk::Address,
    amount: i128,
)

Sends a message to the destination domain and recipient.

Formats the message, and emits a MessageSent event with message information.

Arguments

  • e - Access to the Soroban environment.
  • caller - The address of the caller (message sender).
  • destination_domain - The destination domain identifier.
  • recipient - The recipient address on destination chain as BytesN<32>.
  • destination_caller - Caller on the destination domain as BytesN<32>.
  • min_finality_threshold - The minimum finality threshold at which the message must be attested to.
  • message_body - Contents of the message (bytes).

Errors

  • HostError: Error(Contract, #1000) – Contract is paused (EnforcedPaused).
  • HostError: Error(Auth, InvalidAction)caller authorization fails.
  • [MessageTransmitterError::DestinationIsLocalDomain] – Cannot send to local domain.
  • [MessageTransmitterError::MessageBodyTooLarge] – Message body exceeds max size.
  • [MessageTransmitterError::RecipientIsZero] – Recipient cannot b
fn send_message(
    env: soroban_sdk::Env,
    caller: soroban_sdk::Address,
    destination_domain: u32,
    recipient: soroban_sdk::BytesN<32>,
    destination_caller: soroban_sdk::BytesN<32>,
    min_finality_threshold: u32,
    message_body: soroban_sdk::Bytes,
)
fn __constructor(env: soroban_sdk::Env, params: MessageTransmitterV2ContractInitParams)

Checks if a nonce has been used.

Arguments

  • e - Access to the Soroban environment.
  • nonce - The nonce to check.

Returns

true if the nonce has been used, false otherwise.

fn is_nonce_used(env: soroban_sdk::Env, nonce: soroban_sdk::BytesN<32>) -> bool
fn update_pauser(env: soroban_sdk::Env, new_pauser: soroban_sdk::Address)
fn transfer_admin(
    env: soroban_sdk::Env,
    new_admin: soroban_sdk::Address,
    expires_in_ledgers: u32,
)
fn update_rescuer(env: soroban_sdk::Env, new_rescuer: soroban_sdk::Address)
fn enable_attester(env: soroban_sdk::Env, attester: soroban_sdk::BytesN<20>)

Receives a message. Messages can only be broadcast once for a given nonce. The message body of a valid message is passed to the specified recipient for further processing.

Attestation Format

A valid attestation is the concatenated 65-byte signature(s) of exactly thresholdSignature signatures, in increasing order of attester address. If the attester addresses recovered from signatures are not in increasing order, signature verification will fail. If incorrect number of signatures or duplicate signatures are supplied, signature verification will fail.

Message Format

Field Bytes Type Index version 4 uint32 0 sourceDomain 4 uint32 4 destinationDomain 4 uint32 8 nonce 32 bytes32 12 sender 32 bytes32 44 recipient 32 bytes32 76 destinationCaller 32 bytes32 108 minF

fn receive_message(
    env: soroban_sdk::Env,
    caller: soroban_sdk::Address,
    message: soroban_sdk::Bytes,
    attestation: soroban_sdk::Bytes,
) -> bool
fn accept_ownership(env: soroban_sdk::Env)
fn disable_attester(env: soroban_sdk::Env, attester: soroban_sdk::BytesN<20>)

Returns the local domain identifier for this chain.

Arguments

  • e - Access to the Soroban environment.

Returns

The local domain identifier.

fn get_local_domain(env: soroban_sdk::Env) -> u32
fn get_pending_admin(env: soroban_sdk::Env) -> Option
fn get_pending_owner(env: soroban_sdk::Env) -> Option
fn transfer_ownership(
    env: soroban_sdk::Env,
    new_owner: soroban_sdk::Address,
    expires_in_ledgers: u32,
)
fn is_enabled_attester(
    env: soroban_sdk::Env,
    attester: soroban_sdk::BytesN<20>,
) -> bool
fn get_attester_manager(env: soroban_sdk::Env) -> Option
fn get_enabled_attester(env: soroban_sdk::Env, index: u32) -> soroban_sdk::BytesN<20>
fn get_signature_threshold(env: soroban_sdk::Env) -> Option
fn set_signature_threshold(env: soroban_sdk::Env, new_signature_threshold: u32)
fn update_attester_manager(
    env: soroban_sdk::Env,
    new_attester_manager: soroban_sdk::Address,
)

Returns the maximum allowed message body size.

Arguments

  • e - Access to the Soroban environment.

Returns

The maximum allowed message body size.

fn get_max_message_body_size(env: soroban_sdk::Env) -> u32
fn get_num_enabled_attesters(env: soroban_sdk::Env) -> u32

Sets the maximum allowed message body size.

Arguments

  • e - Access to the Soroban environment.
  • max_message_body_size - The maximum allowed message body size.

Errors

  • HostError: Error(Auth, InvalidAction) – Authorization from the contract owner fails.

Events

  • topics - ["max_message_body_size_updated"]
  • data - [new_max_message_body_size: u32]
fn set_max_message_body_size(env: soroban_sdk::Env, max_message_body_size: u32)

Imports

WebAssembly Text (WAT) ▶