0x0::dutch_auction

Module of a Dutch Auction Sale Market type.

It implements a dutch auction sale configuration, where all NFTs in the sale warehouse get sold to the winners of the auction. The number of winners

NFT creators can decide if they want to create a simple primary market sale or if they want to create a tiered market sale by segregating NFTs by different sale segments (e.g. based on rarity).

To create a market sale the administrator can simply call create_market. Each sale segment can have a whitelisting process, each with their own whitelist tokens.

Structs

dutch_auction::DutchAuctionMarket<FT> has store, key

Fields:

Name Type Description
id object::UID
reserve_price u64

The minimum price at which NFTs can be sold

bids crit_bit_u64::CB<vector<dutch_auction::Bid<FT>>>

A bid order stores the amount of fungible token, FT, that the buyer is willing to purchase.

inventory_id object::ID

Warehouse or Factory that the market will redeem from

dutch_auction::Bid<FT> has store

Fields:

Name Type Description
amount balance::Balance<FT>

Amount is equal to the price that the bidder is ready to pay for one NFT.

owner address

The address of the user who created this bid and who will receive an NFT in exchange for their tokens.

A bid for one NFT

dutch_auction::Witness has drop

Witness used to authenticate witness protected endpoints

Methods

public fun new<FT>(
    inventory_id: object::ID,
    reserve_price: u64,
    ctx: &mut tx_context::TxContext,
): dutch_auction::DutchAuctionMarket<FT>

public entry fun init_market<FT>(
    inventory_id: object::ID,
    reserve_price: u64,
    ctx: &mut tx_context::TxContext,
)

Creates a DutchAuctionMarket<FT> and transfers to transaction sender

public entry fun init_venue<C, FT>(
    listing: &mut listing::Listing,
    inventory_id: object::ID,
    is_whitelisted: bool,
    reserve_price: u64,
    ctx: &mut tx_context::TxContext,
)

Initializes a Venue with DutchAuctionMarket<FT>

public fun create_venue<C, FT>(
    listing: &mut listing::Listing,
    inventory_id: object::ID,
    is_whitelisted: bool,
    reserve_price: u64,
    ctx: &mut tx_context::TxContext,
): object::ID

Creates a Venue with DutchAuctionMarket<FT>

public entry fun create_bid<FT>(
    wallet: &mut coin::Coin<FT>,
    listing: &mut listing::Listing,
    venue_id: object::ID,
    price: u64,
    quantity: u64,
    ctx: &mut tx_context::TxContext,
)

Creates a bid in a FIFO manner, previous bids are retained

public entry fun create_bid_whitelisted<FT>(
    wallet: &mut coin::Coin<FT>,
    listing: &mut listing::Listing,
    venue_id: object::ID,
    whitelist_token: market_whitelist::Certificate,
    price: u64,
    quantity: u64,
    ctx: &mut tx_context::TxContext,
)

public entry fun cancel_bid<FT>(
    wallet: &mut coin::Coin<FT>,
    listing: &mut listing::Listing,
    venue_id: object::ID,
    price: u64,
    ctx: &mut tx_context::TxContext,
)

Cancels a single bid at the given price level in a FIFO manner

Bids can always be canceled no matter whether the auction is live.

public entry fun sale_cancel<FT>(
    listing: &mut listing::Listing,
    venue_id: object::ID,
    ctx: &mut tx_context::TxContext,
)

Cancel the auction and toggle the Slingshot's live to false. All bids will be cancelled and refunded.

Permissioned endpoint to be called by admin.

public entry fun sale_conclude<C, FT>(
    listing: &mut listing::Listing,
    venue_id: object::ID,
    ctx: &mut tx_context::TxContext,
)

Conclude the auction and toggle the Slingshot's live to false. NFTs will be allocated to the winning biddeers.

Permissioned endpoint to be called by admin.

public fun reserve_price<FT>(
    market: &dutch_auction::DutchAuctionMarket<FT>,
): u64

Get the auction's reserve price

public fun bids<FT>(
    market: &dutch_auction::DutchAuctionMarket<FT>,
): 
    &crit_bit_u64::CB<vector<dutch_auction::Bid<FT>>>

Get the auction's bids

public fun bid_owner<FT>(
    bid: &dutch_auction::Bid<FT>,
): address

public fun bid_amount<FT>(
    bid: &dutch_auction::Bid<FT>,
): &balance::Balance<FT>