Contract a7a662cee9e54e10e9080ce1476a148396c3a5cfc90b13f3215ebf69ce8587a3

← Back to Index 📥 Download WASM

Meta

rssdkver 22.0.11#34f7f53ae31e0fd02aab436a9872e79fa671ca02
rsver 1.94.0

Instances

  • CBCBPR4KKIFJXAOHZTP756ENAFTRNINY5UBZJ4MK4YO4KBK336NKJPVS

Interface

Buyer purchases a listed domain (ATOMIC) max_price provides slippage protection — reverts if listing price exceeds it

fn buy(
    env: soroban_sdk::Env,
    buyer: soroban_sdk::Address,
    token_id: u32,
    max_price: i128,
) -> Result<(), MarketError>

Seller lists a domain for sale. Approval is handled atomically via Stellar Router SDK on the frontend.

fn list(
    env: soroban_sdk::Env,
    seller: soroban_sdk::Address,
    token_id: u32,
    price: i128,
) -> Result<(), MarketError>

Emergency pause — blocks list, buy, update_price, make_offer, accept_offer

fn pause(env: soroban_sdk::Env, admin: soroban_sdk::Address) -> Result<(), MarketError>

Seller removes a listing (always allowed, even when paused)

fn delist(
    env: soroban_sdk::Env,
    seller: soroban_sdk::Address,
    token_id: u32,
) -> Result<(), MarketError>

Resume normal operations

fn unpause(
    env: soroban_sdk::Env,
    admin: soroban_sdk::Address,
) -> Result<(), MarketError>

Upgrade the contract WASM in-place (preserves all storage)

fn upgrade(
    env: soroban_sdk::Env,
    admin: soroban_sdk::Address,
    new_wasm_hash: soroban_sdk::BytesN<32>,
) -> Result<(), MarketError>

Get contract config (admin tooling)

fn get_config(env: soroban_sdk::Env) -> Config

Query all active offers for a specific domain

fn get_offers(env: soroban_sdk::Env, token_id: u32) -> soroban_sdk::Vec

Buyer makes an offer on any domain. XLM is escrowed in the contract.

fn make_offer(
    env: soroban_sdk::Env,
    offerer: soroban_sdk::Address,
    token_id: u32,
    amount: i128,
) -> Result<(), MarketError>

Change the commission fee rate and recipient

fn update_fee(
    env: soroban_sdk::Env,
    admin: soroban_sdk::Address,
    fee_bps: u32,
    fee_recipient: soroban_sdk::Address,
) -> Result<(), MarketError>

Get a single listing by token ID

fn get_listing(env: soroban_sdk::Env, token_id: u32) -> Option

Seller accepts an offer. NFD approval must be granted beforehand (frontend combines approve+accept via Stellar Router SDK).

fn accept_offer(
    env: soroban_sdk::Env,
    seller: soroban_sdk::Address,
    token_id: u32,
    offerer: soroban_sdk::Address,
) -> Result<(), MarketError>

Buyer cancels their offer and receives full refund (always allowed, even when paused)

fn cancel_offer(
    env: soroban_sdk::Env,
    offerer: soroban_sdk::Address,
    token_id: u32,
) -> Result<(), MarketError>

Admin can force-delist stale listings (always allowed, even when paused)

fn force_delist(
    env: soroban_sdk::Env,
    admin: soroban_sdk::Address,
    token_id: u32,
) -> Result<(), MarketError>

Transfer admin rights to a new address

fn update_admin(
    env: soroban_sdk::Env,
    admin: soroban_sdk::Address,
    new_admin: soroban_sdk::Address,
) -> Result<(), MarketError>

Seller updates the price of a listing

fn update_price(
    env: soroban_sdk::Env,
    seller: soroban_sdk::Address,
    token_id: u32,
    new_price: i128,
) -> Result<(), MarketError>

Initialize the marketplace contract

fn __constructor(
    env: soroban_sdk::Env,
    admin: soroban_sdk::Address,
    nfd_contract: soroban_sdk::Address,
    xlm_sac: soroban_sdk::Address,
    fee_recipient: soroban_sdk::Address,
    fee_bps: u32,
)

Get current fee config

fn get_fee_config(env: soroban_sdk::Env) -> FeeConfig

Get all active listings

fn get_all_listings(env: soroban_sdk::Env) -> soroban_sdk::Vec<(u32, Listing)>

Change the minimum listing/offer price

fn update_min_amount(
    env: soroban_sdk::Env,
    admin: soroban_sdk::Address,
    min_amount: i128,
) -> Result<(), MarketError>

Admin force-cancels an offer. Refunds XLM to the original offerer (never to admin). Always allowed, even when paused.

fn force_cancel_offer(
    env: soroban_sdk::Env,
    admin: soroban_sdk::Address,
    token_id: u32,
    offerer: soroban_sdk::Address,
) -> Result<(), MarketError>

Imports

WebAssembly Text (WAT) ▶