Contract 433ab3c147acb637a798b0e2fc1b5e8df6bce4bebf41c9bb525686c1010aa1a7

← Back to Index 📥 Download WASM

Meta

cliver 25.1.0#
rssdkver 25.1.0#86c50a1ea4f87b40add3064ff9df95c7553565c5
rsver 1.93.0

Instances

  • CB4PBLDPTMAGCLSCEDMTKB5JZUDON5TFEF7GQ4KIWD7LSCHRUBINJM7X

Interface

Verifies a receipt by routing to the selector-specific verifier.

Extracts the selector from seal[0..4], resolves the verifier address, and forwards the full verification call.

Errors

  • [VerifierError::MalformedSeal] -- seal is shorter than 4 bytes
  • [VerifierError::SelectorRemoved] -- selector is tombstoned
  • [VerifierError::SelectorUnknown] -- selector was never registered
  • Any error from the underlying verifier (e.g. InvalidProof)
fn verify(
    env: soroban_sdk::Env,
    seal: soroban_sdk::Bytes,
    image_id: soroban_sdk::BytesN<32>,
    journal: soroban_sdk::BytesN<32>,
) -> Result<(), VerifierError>

Returns Some(Address) if ownership is set, or None if ownership has been renounced.

Arguments

  • e - Access to the Soroban environment.
fn get_owner(env: soroban_sdk::Env) -> Option

Returns the raw [VerifierEntry] for a selector.

Unlike get_verifier_by_selector, this method never reverts. Returns None when a selector has never been set, allowing callers to distinguish "unset" vs "active" vs "tombstoned".

fn verifiers(
    env: soroban_sdk::Env,
    selector: soroban_sdk::BytesN<4>,
) -> Option

Registers a verifier for the given selector.

Once registered, any seal beginning with this selector will be routed to the specified verifier address.

Authorization

Requires owner.require_auth().

Errors

  • [VerifierError::SelectorRemoved] -- the selector was previously removed (tombstoned) and cannot be re-registered
  • [VerifierError::SelectorInUse] -- the selector is already mapped to an active verifier
fn add_verifier(
    env: soroban_sdk::Env,
    selector: soroban_sdk::BytesN<4>,
    verifier: soroban_sdk::Address,
) -> Result<(), VerifierError>

Initializes the router with the owner that can manage verifiers.

The owner is typically a timelock controller contract address, so that all verifier management operations go through the timelock's schedule/execute flow.

fn __constructor(env: soroban_sdk::Env, owner: soroban_sdk::Address)

Permanently removes a verifier for the given selector.

The selector is marked as a tombstone and can never be re-registered, even with the same verifier address. This prevents a compromised governance key from silently replacing a verifier.

Authorization

Requires owner.require_auth().

Errors

  • [VerifierError::SelectorUnknown] -- the selector has never been registered
fn remove_verifier(
    env: soroban_sdk::Env,
    selector: soroban_sdk::BytesN<4>,
) -> Result<(), VerifierError>

Accepts a pending ownership transfer.

Arguments

  • e - Access to the Soroban environment.

Errors

  • [crate::role_transfer::RoleTransferError::NoPendingTransfer] - If there is no pending transfer to accept.

Events

  • topics - ["ownership_transfer_completed"]
  • data - [new_owner: Address]
fn accept_ownership(env: soroban_sdk::Env)

Verifies receipt integrity by routing to the selector-specific verifier.

Extracts the selector from the receipt's seal prefix, resolves the verifier address, and forwards the integrity check.

Errors

  • [VerifierError::MalformedSeal] -- seal is shorter than 4 bytes
  • [VerifierError::SelectorRemoved] -- selector is tombstoned
  • [VerifierError::SelectorUnknown] -- selector was never registered
  • Any error from the underlying verifier (e.g. InvalidProof)
fn verify_integrity(
    env: soroban_sdk::Env,
    receipt: Receipt,
) -> Result<(), VerifierError>

Renounces ownership of the contract.

Permanently removes the owner, disabling all functions gated by #[only_owner].

Arguments

  • e - Access to the Soroban environment.

Errors

  • [OwnableError::TransferInProgress] - If there is a pending ownership transfer.
  • [OwnableError::OwnerNotSet] - If the owner is not set.

Notes

  • Authorization for the current owner is required.
fn renounce_ownership(env: soroban_sdk::Env)

Initiates a 2-step ownership transfer to a new address.

Requires authorization from the current owner. The new owner must later call accept_ownership() to complete the transfer.

Arguments

  • e - Access to the Soroban environment.
  • new_owner - The proposed new owner.
  • live_until_ledger - Ledger number until which the new owner can accept. A value of 0 cancels any pending transfer.

Errors

  • [OwnableError::OwnerNotSet] - If the owner is not set.
  • [crate::role_transfer::RoleTransferError::NoPendingTransfer] - If trying to cancel a transfer that doesn't exist.
  • [crate::role_transfer::RoleTransferError::InvalidLiveUntilLedger] - If the specified ledger is in the past.
  • [crate::role_transfer::RoleTransferError::InvalidPendingAccount] - If the specified pending account is not the same as the provided new address.

Notes

  • Authorization for the current owner is required.
fn transfer_ownership(
    env: soroban_sdk::Env,
    new_owner: soroban_sdk::Address,
    live_until_ledger: u32,
)

Returns the verifier address for the selector embedded in the seal.

Extracts the first 4 bytes of seal as the selector and resolves it to a verifier address.

Errors

  • [VerifierError::MalformedSeal] -- seal is shorter than 4 bytes
  • [VerifierError::SelectorRemoved] -- selector is tombstoned
  • [VerifierError::SelectorUnknown] -- selector was never registered
fn get_verifier_from_seal(
    env: soroban_sdk::Env,
    seal: soroban_sdk::Bytes,
) -> Result

Returns the verifier address for a selector, reverting if unknown or removed.

Errors

  • [VerifierError::SelectorRemoved] -- selector is tombstoned
  • [VerifierError::SelectorUnknown] -- selector was never registered
fn get_verifier_by_selector(
    env: soroban_sdk::Env,
    selector: soroban_sdk::BytesN<4>,
) -> Result

Imports

WebAssembly Text (WAT) ▶