Managing Sale State

close_sale<CURRENCY>(...) and reopen_sale<CURRENCY>(...) Purpose: Control the sale state. Closing a sale prevents further purchases; reopening it allows buying again.

Close Sale Process:

  1. Verify the caller is the sale creator.

  2. Ensure the sale is currently active.

  3. Set is_active = false.

  4. Emit a status change event.

Reopen Sale Process:

  1. Verify the caller is the sale creator.

  2. Ensure the sale is inactive.

  3. Check that there are still NFTs available in the sale.

  4. Set is_active = true and emit the appropriate event.

Use Cases:

  • Temporarily pause sales for maintenance or to adjust prices and then reopen later.

  • End the sale permanently once all desired NFTs are sold or no longer for sale.

By leveraging these functions and entry points, the SALE module offers a straightforward, flexible mechanism for launching NFT sales, adjusting inventory, and handling payment flows. Creators gain full control over their selling process, while buyers enjoy a simple, direct purchasing experience.

Last updated