Contract ea0e7893665c3d777fc71b6ee42fbc8ef9206c5d1d1aabc9456ba25853bd89f9

← Back to Index 📥 Download WASM

Meta

rssdkver 21.7.7#5da789c50b18a4c2be53394138212fed56f0dfc4
rsver 1.96.0

Instances

  • CDR4EEFL7OTXIJHD5ZR24J2VCO7THYIE3LGGRXJJY7W4WPCQ2QRO5ZY7

Interface

initialize: One-time setup called by deployer to link validator with registry and configure fee schedule.

Arguments

  • admin - Address authorized to manage fees and withdraw treasury
  • registry - Address of the deployed AgentRegistry contract
  • fee_stroops - Validation fee in stroops (e.g., 50_000_000 = 5 XLM)

Errors

  • Panics if called more than once (re-initialization guard)
fn initialize(
    env: soroban_sdk::Env,
    admin: soroban_sdk::Address,
    registry: soroban_sdk::Address,
    fee_stroops: i128,
)

get_pending: Retrieve pending deployment record by agent_id.

fn get_pending(
    env: soroban_sdk::Env,
    agent_id: soroban_sdk::Symbol,
) -> PendingDeployment

is_confirmed: Check if an agent has been successfully deployed.

fn is_confirmed(env: soroban_sdk::Env, agent_id: soroban_sdk::Symbol) -> bool

admin_address: Query the current admin address.

fn admin_address(env: soroban_sdk::Env) -> soroban_sdk::Address

get_confirmed: Retrieve confirmed deployment record with signature proof.

fn get_confirmed(
    env: soroban_sdk::Env,
    agent_id: soroban_sdk::Symbol,
) -> ConfirmedDeployment

confirm_deploy: Verify wallet signature and proceed with agent registration. On success, collects validation fee and calls AgentRegistry inter-contract.

Arguments

  • deployer - Agent owner's Stellar address (must match pending record)
  • agent_id - Unique on-chain agent identifier
  • signature_hash - SHA-256 of the signed confirmation message from Freighter

Flow

  1. Verify pending deployment exists and matches deployer
  2. Collect validation fee into treasury
  3. Call AgentRegistry::register_agent (inter-contract)
  4. Mark deployment confirmed with signature proof
  5. Update deployer's fee history

Errors

  • If no pending deployment for this agent_id
  • If deployer doesn't match pending record
  • If deployment already confirmed
fn confirm_deploy(
    env: soroban_sdk::Env,
    deployer: soroban_sdk::Address,
    agent_id: soroban_sdk::Symbol,
    signature_hash: soroban_sdk::BytesN<32>,
)

request_deploy: Record pending deployment intent and emit event for UI. User's wallet will prompt for signature after this call returns.

Arguments

  • deployer - Agent owner's Stellar address
  • agent_id - Unique on-chain agent identifier
  • metadata_hash - IPFS CID or SHA-256 hash of agent configuration
  • price_stroops - Agent pricing per request (in stroops)

Errors

  • If duplicate pending deployment exists
  • If price is negative
fn request_deploy(
    env: soroban_sdk::Env,
    deployer: soroban_sdk::Address,
    agent_id: soroban_sdk::Symbol,
    metadata_hash: soroban_sdk::Symbol,
    price_stroops: i128,
)

get_fee_history: Retrieve a deployer's fee payment history.

fn get_fee_history(env: soroban_sdk::Env, deployer: soroban_sdk::Address) -> FeeHistory

validate_wallet: Verify deployer's wallet and check for duplicate agents. This is a read-only inter-contract call to AgentRegistry.

Arguments

  • deployer - The Stellar address wanting to deploy an agent
  • agent_id - Proposed unique agent identifier

Returns

true if validation passes

Errors

  • If agent_id already exists in registry
  • If deployer fails authentication
fn validate_wallet(
    env: soroban_sdk::Env,
    deployer: soroban_sdk::Address,
    agent_id: soroban_sdk::Symbol,
) -> bool

registry_address: Query the linked AgentRegistry contract address.

fn registry_address(env: soroban_sdk::Env) -> soroban_sdk::Address

treasury_balance: Returns accumulated validation fees (stroops).

fn treasury_balance(env: soroban_sdk::Env) -> i128

withdraw_treasury: Admin withdraws accumulated fees. Integration with native Stellar transfers happens off-chain (API level).

fn withdraw_treasury(env: soroban_sdk::Env, amount_stroops: i128) -> i128

get_validation_fee: Query the current validation fee in stroops.

fn get_validation_fee(env: soroban_sdk::Env) -> i128

set_validation_fee: Update the validation fee (admin-only). Useful for fee adjustments without redeployment.

fn set_validation_fee(env: soroban_sdk::Env, new_fee_stroops: i128)

Imports

WebAssembly Text (WAT) ▶