Listing and Selling NFTs (SALE)

Workflow:

  1. Prepare NFTs: Ensure you have minted NFTs via ART20 and hold them in your UserBalance.

  2. Create Sale: Call create_nft_sale(...) to list a set of NFTs at a fixed price_per_nft. The sale becomes active, and a SaleCreated event is emitted.

  3. Manage Inventory: Use add_nfts_to_sale(...) to add more NFTs to the sale or close_sale(...) to end the sale when you’re done.

  4. Buyers Purchase: Buyers call purchase_nfts(...) supplying the required currency to acquire listed NFTs directly.

Result: A straightforward marketplace scenario. Buyers pay a fixed price, and sellers can withdraw proceeds once sales occur.

Example Script:

// Pseudocode:
create_nft_sale(
  nfts = my_nft_batch,
  nft_amount = 50,
  price_per_nft = 1000 /* tokens */,
  collection_cap,
  ...
);

Last updated