Launchpad Specification
About Launchpad
Launchpad allows NFT projects to host their primary sales on galler.io.
How it works
When a user makes a purchase order on Galler's Launchpad, our smart contract will call your minting function. Both our smart contracts will interact.
There are 3 functions that have to be implemented from the project side,
getMaxLaunchpadSupply(),
getLaunchpadSupply(),
mintTo(address to, uint256 size).
Let's dive deeper!
Inside the contract folder on our github, there are 2 smart contracts that help projects understand how it works.
file name | description |
---|---|
LaunchpadNFT.sol | A template for NFT project, would have to implement 3 functions which are getMaxLaunchpadSupply(), getLaunchpadSupply() and mintTo(address to, uint256 size) |
Launchpad.sol | This is how Galler's smart contract interacts with yours. |
Before we're able to onboard your collection to our launchpad, please go through these 2 files, make sure your smart contract fit our requirement.
From our side, we will have to know about the quantity of NFTs and call your mint function to complete the transaction.
About Quantities
In case a project decides to host their primary sales on multiple platforms (including their own website), they can reserve a certain quantity for Galler. And that's where getMaxLaunchpadSupply() is used for.
As for getLaunchpadSupply() will be counted when a mint is triggered.
function mintTo(address to, uint size) external onlyLaunchpad {
require(to != address(0), "can't mint to empty address");
require(size > 0, "size must greater than zero");
require(LAUNCH_SUPPLY + size <= LAUNCH_MAX_SUPPLY, "max supply reached");
for (uint256 i=1; i <= size; i++) {
_mint(to, ERC721Enumerable.totalSupply() + i);
LAUNCH_SUPPLY++;
}
}
About transactions
For every transaction made through our launchpad, our side distributes the price received to your address. Please note that we will charge a fee when a transaction is made.
This part is been emit from our smart contract which you can check from "Launchpad.sol"
// transfer token and mint
payable(campaign.payeeAddress).transfer(totalPrice);
ILaunchpadNFT(contractAddress).mintTo(msg.sender, batchSize);
emit Mint(campaign.contractAddress, campaign.payeeAddress, batchSize, campaign.price);
// return
uint256 valueLeft = msg.value - totalPrice;
if (valueLeft > 0) {
payable(_msgSender()).transfer(valueLeft);
}
Launchpad is small and simple, it work as a sell proxy, collect mint fee and mint your NFT for user.
Your contract needs to support Galler NFT Protocol Standard and implement some special interfaces.
Quick summary: these are the 3 functions you have to build in your smart contract
interface ILaunchpadNFT {
// return max supply config for launchpad, if no reserved will be collection's max supply
function getMaxLaunchpadSupply() external view returns (uint256);
// return current launchpad supply
function getLaunchpadSupply() external view returns (uint256);
// this function need to restrict mint permission to launchpad contract
function mintTo(address to, uint256 size) external;
}
Notice
tokenId
You are responsible to handle the tokenId for each mint action, so you can hold a special range of tokenId as reserve.
Helpful links
Launchpad deployed address
BSC
0x190449C9586a73dA40A839e875Ff55c853dBc2f8
BSC Testnet
0x64eF5f4145A77EA9091DA00eb5f5B865eB27B5D2
ETH
0xa2833c0fDeacfD2510243222f6FeA7881e8E6c68
ETH Rinkeby
Updated over 2 years ago