Contract 56d4e5fe322f95decc4c6caf7e64540eed7adf04111e95650ec0d4ff66a141f3

← Back to Index 📥 Download WASM

Meta

cliver 25.2.0#28484880988199233a7e8e87c97cb12dac323cb3
rssdkver 25.3.0#dcbea44513feb7734af6b6c4aced2c4a7a2715d0
rsver 1.93.1

Instances

  • CCC6QCFLZL7AVXGMIA226H37KJ4DTQMJNZTYD527AZS2QHFA6JFC3HO6

Interface

fn upgrade(env: soroban_sdk::Env, new_wasm_hash: soroban_sdk::BytesN<32>)

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 current factory configuration tuple: (owner, account_hash, verifier_hash, native_token_address).

fn get_config(
    env: soroban_sdk::Env,
) -> (soroban_sdk::BytesN<32>, soroban_sdk::BytesN<32>, soroban_sdk::Address)

Updates one or more factory configuration values.

fn set_config(
    env: soroban_sdk::Env,
    account_hash: Option>,
    verifier_hash: Option>,
    native_token_address: Option,
)

Initializes the factory with deploy-time configuration.

fn __constructor(
    env: soroban_sdk::Env,
    owner: soroban_sdk::Address,
    account_hash: soroban_sdk::BytesN<32>,
    verifier_hash: soroban_sdk::BytesN<32>,
    native_token_address: soroban_sdk::Address,
)

Creates a new smart account with Ed25519 authentication and funds it with native tokens.

This function handles the entire account creation process:

  1. Authenticates the funder address
  2. Deploys the Ed25519 verifier contract if it doesn't already exist
  3. Deploys a smart account contract with the public key configured as an external signer
  4. Transfers the specified amount of native tokens from the funder to the new account
  5. Returns the address of the new smart account

Arguments

  • funder - The address that will fund the new account. This address must authenticate the transaction.
  • key - A 32-byte Ed25519 public key used for authenticating transactions on the new account.
  • recovery_key - A 32-byte Ed25519 public key used as the recovery signer.
  • amount - The amount of native tokens (XLM) to transfer to the newly created account, specified in stroops.

Returns

Returns the Address of the newly created smart account.

fn create_account(
    env: soroban_sdk::Env,
    funder: soroban_sdk::Address,
    key: soroban_sdk::BytesN<32>,
    recovery_key: soroban_sdk::BytesN<32>,
    amount: i128,
) -> soroban_sdk::Address

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)

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,
)

Imports

WebAssembly Text (WAT) ▶