Contract ca4c475a1f32dd875b6c075934d359b8ce780f403d09625ffb727cd537884170

← Back to Index 📥 Download WASM

Meta

binver 4.0.0
rssdkver 25.3.1#e50d95af029c83196dd122f0154bac3f1302394b
rsver 1.93.0

Interface

Buy a listed NFT at the fixed price.

fn buy(env: soroban_sdk::Env, listing_id: u64, buyer: soroban_sdk::Address)

Create a fixed-price listing (public — anyone can buy).

fn list(
    env: soroban_sdk::Env,
    seller: soroban_sdk::Address,
    nft_contract: soroban_sdk::Address,
    nft_id: u32,
    currency: soroban_sdk::Address,
    price: i128,
) -> u64

Upgrade the contract WASM. Admin only. ⚠️ NEVER REMOVE THIS FUNCTION — doing so bricks the contract permanently.

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

Contract version.

fn version(env: soroban_sdk::Env) -> u32
fn get_offer(env: soroban_sdk::Env, offer_id: u64) -> Offer

Transfer admin role.

fn set_admin(
    env: soroban_sdk::Env,
    current_admin: soroban_sdk::Address,
    new_admin: soroban_sdk::Address,
)

Extend instance and persistent storage TTLs.

fn extend_ttl(env: soroban_sdk::Env)

Make an offer on any NFT. Uses the allowance pattern (no escrow). Bidder MUST have granted an allowance to the marketplace prior or in the same transaction.

fn make_offer(
    env: soroban_sdk::Env,
    bidder: soroban_sdk::Address,
    nft_contract: soroban_sdk::Address,
    nft_id: u32,
    currency: soroban_sdk::Address,
    amount: i128,
    expires_at: u32,
) -> u64
fn get_listing(env: soroban_sdk::Env, listing_id: u64) -> Listing
fn update_fees(
    env: soroban_sdk::Env,
    admin: soroban_sdk::Address,
    protocol_fee_bps: u32,
    project_fee_bps: u32,
)

Accept an offer. NFT owner calls this.

fn accept_offer(env: soroban_sdk::Env, offer_id: u64, seller: soroban_sdk::Address)
fn add_currency(
    env: soroban_sdk::Env,
    admin: soroban_sdk::Address,
    currency: soroban_sdk::Address,
)

Cancel an active offer. No funds are returned because no funds were escrowed.

fn cancel_offer(env: soroban_sdk::Env, offer_id: u64, bidder: soroban_sdk::Address)

Get a page of listings. Returns listing_ids that exist in [start, start+limit). Client-side filters by status/collection.

fn get_listings(env: soroban_sdk::Env, start: u64, limit: u64) -> soroban_sdk::Vec

Create a private listing — only the designated buyer can purchase.

fn list_private(
    env: soroban_sdk::Env,
    seller: soroban_sdk::Address,
    nft_contract: soroban_sdk::Address,
    nft_id: u32,
    currency: soroban_sdk::Address,
    price: i128,
    designated_buyer: soroban_sdk::Address,
) -> u64

Initialize the marketplace.

fn __constructor(
    env: soroban_sdk::Env,
    admin: soroban_sdk::Address,
    protocol_fee_bps: u32,
    protocol_fee_receiver: soroban_sdk::Address,
    project_fee_bps: u32,
    project_fee_receiver: soroban_sdk::Address,
    allowed_currencies: soroban_sdk::Vec,
)

Add an NFT collection to the whitelist.

fn add_collection(
    env: soroban_sdk::Env,
    admin: soroban_sdk::Address,
    collection: soroban_sdk::Address,
)

Cancel an active listing.

fn cancel_listing(env: soroban_sdk::Env, listing_id: u64, seller: soroban_sdk::Address)

Replace the entire allowed currencies list (admin only).

fn set_currencies(
    env: soroban_sdk::Env,
    admin: soroban_sdk::Address,
    currencies: soroban_sdk::Vec,
)

Get the current nonce for a seller.

fn get_seller_nonce(env: soroban_sdk::Env, seller: soroban_sdk::Address) -> u64

Get the expiry ledger sequence for a listing (0 = no expiry).

fn get_listing_expiry(env: soroban_sdk::Env, listing_id: u64) -> u32

Set a hard expiry on an active listing (seller only). This is the practical fix for permissionless TTL extension: even if an attacker extends the storage TTL, the contract-level expiry check in buy() will reject the purchase.

fn set_listing_expiry(
    env: soroban_sdk::Env,
    listing_id: u64,
    seller: soroban_sdk::Address,
    expires_at: u32,
)

Cancel ALL active listings for a seller by incrementing their nonce. Any listing created with a previous nonce becomes invalid at buy-time. This is the "nuclear option" — equivalent to OpenZeppelin's incrementNonce().

fn cancel_all_listings(env: soroban_sdk::Env, seller: soroban_sdk::Address)

Get the total number of offers ever created.

fn next_offer_id_value(env: soroban_sdk::Env) -> u64

Get the designated buyer for a listing (if any).

fn get_designated_buyer(
    env: soroban_sdk::Env,
    listing_id: u64,
) -> Option

Get the total number of listings ever created.

fn next_listing_id_value(env: soroban_sdk::Env) -> u64

Imports

WebAssembly Text (WAT) ▶