Drop Contract

This section intends to give an overview of the public read functions that must be exposed in order for the drop contract to be correctly integrated with Luxy Launchpad.

As code speaks for itself we recommend all the approved users for creating their own drop to fork our template and adapt their own smart contract code from it.

Our template for creating a drop can be found at LuxyTemplate.

Anyways you're free to design the contract as you wish we just have as minimal requirement that your contract has the following functions in order to be compatible with our front-end (as we will be reading data straight from the contract to fetch information at the Drop page and to call in the mint function).

Public Constants

Mandatory Public Constants

All the public constants in this section are mandatory we need those in order to be able to present your collection properly at Luxy's front-end

MAX_BATCH_MINT (uint256): maximum number of units that can be minted per mint function call.

MAX_SUPPLY (uint256): maximum supply for the drop.

DROP_START_TIME (uint256): timestamp when mint starts in Unix time.

PRICE_PER_TOKEN (uint256): The amount of tokens paid per NFT bought in WEI of the native blockchain token.

Optional Public Constants

The public constants in this section are optional, but if the contract creator chooses to implement a whitelist and enable the LuxySale period (we recommend you do as it will give an incentive for Luxy's community to buy your collection).

WHITELIST_EXPIRE_TIME (uint256): time in which minting will be exclusive for whitelisted addresses after DROP_START_TIME.

LUXY_SALE_EXPIRE_TIME (uint256): time in which minting will be exclusive for luxy holders after

MINIMUM_LUXY_AMOUNT (uint256): The minimum amount of tokens for a user to be eligible to participate luxy_sale

Public Variables

Mandatory Public Variables

artist (address): Address who receives the drop gains.

luxyLaunchpadFeeManagerProxy (address): The address of LuxyFeeManagerProxy that will be responsible for the minting function call

Optional Public Variables

whitelistSize (uint256): Size of the whitelist mapping, to display at luxy front-end.

Mint Function

The mint functions must be done in a format that enables only the LuxyLaunchpadFeeManager to call the minting function at the contract of the drop. The LuxyLaunchpadFeeManager will be responsible for handling the minting process and will send Luxy Marketplace fees to the proper address and also the amount due for the Artist.

// Mint function on drop contract example
function mint(uint256 num) external {
        require(_msgSender() == luxyLaunchpadFeeManagerProxy, "Not allowed");
        require(block.timestamp > DROP_START_TIME, "Drop hasnt started yet");
        require(num <= MAX_BATCH_MINT, "Exceeds max batch per mint");
        require(totalSupply() + num <= MAX_SUPPLY, "Exceeds drop max supply");

        for (uint256 i; i < num; i++) {
            uint256 tokenId = _tokenIds.current();
            _safeMint(tx.origin, tokenId);

Note that even though you're free to implement the minting function in your own way the absolute mandatory parts would be the initially required functions (all four of them), also that the first requirement be that the _msgSender() is equal to the luxyLaunchpadFeeManagerProxy and the revert error message must be the same as defined there. And finally that the input argument is a uint256 (it's the amount of tokens that will be minted per that function call).

Whitelist Functions Example

At the Github example for the Luxy template, there are a few commented functions regarding an optional way to implement a whitelist and luxy sale period on your project. They are commented and there is a marker comment that's written Uncomment this section to enable whitelist above each of them. Those functions offer an easy and working way to implement the whitelist at your contract. Note that even if you don't use such functions it would be good to have the whitelistSize variable at your own custom implementation so the number of wallets can be displayed at luxy front-end.

Last updated