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:
Verify the caller is the sale creator.
Ensure the sale is currently active.
Set
is_active = false
.Emit a status change event.
Reopen Sale Process:
Verify the caller is the sale creator.
Ensure the sale is inactive.
Check that there are still NFTs available in the sale.
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