How to Deploy a Primary Sales Contract in Sequence Builder
This guide walks through how to setup and deploy the contracts for launching a primary sale - suitable for an NFT Drop, in-game store, and more.
Step 1: Navigate to contracts
Start by selecting your desired project
you would like to create a sale for and head to Contracts > Deploy
.
Step 2: Deploy your chosen collectible contract
Follow this guide in order to deploy a collectible contract as well as upload the collection metadata that you wish to create a sale for.
Step 3: Deploy your Primary Sales contract
Once successfully deployed, return to the contracts page and select + Deploy new contract
again. Then select the appropriate ERC721 or ERC1155 sale contract that corresponds to your previously deployed collectible contract in step 2 and click Deploy sale contract
.
Step 4: Set your mint details on the Primary Sales contract.
Navigate to the mint details tab for your primary sales contract. Fill out the mint details with your desired sale parameters.
Supply Cap
: This is the amount of supply of tokens that users can mint via the Sale contractCost
: Is the cost amount in GWEI of minting a single token. In this example, we set it to 0 to easily mint from Builder, but when deploying in production this should match what you wish to charge your users.Start and End Time
: Start and end time of the sale. If the current time is within the date range provided, this will activate the sale. Consider setting the date range to the future if desired.Payment Token
: You can select the native token on the chain or a custom currency as well that the sale is in.Sale Type
: You can also opt to choose between a Public or Private mint. When selecting a private mint, you can also choose a list of allowlisted participants that is uploaded using our Audience feature. Important to note, that for a private mint you will need to pass in a merkle proof that corresponds to the merkle root added in the sale details in order to mint. Not to worry though, we provide this logic in our boilerplates by default.
For this walkthrough, we will assume you are creating a public mint.
Step 5: Add MinterRole for Sales Contract to Collection Contract
Copy the Sales contract address, then you can navigate to the specific contract and select the settings to view Permissions.
Once you have the modal open, select the Permissions
tab and you can Edit
, or, + Add Collaborator
.
Then complete the form with the Sales contract address to add as a collaborator and select the dropdown to assign the Minter
role.
Finally, complete and sign the transaction update the contract Access Control.
Step 6:
Now that you've got your contracts configured, let's try to do a test mint!
Return to your deployed Sale contract and select Write contract
. We will then click on the mint()
function and pass in a few parameters:
to
: this is the address that the NFT is being minted to. Generally this would be the user who paid, but we can simply pass in our Builder address located in the top-right hand corner.amount
: The amount of NFTs to mint, we will simply mint 1.paymentToken
: For a custom currency, you would pass in that currency's address. However for native tokens it will be0x0000000000000000000000000000000000000000
.maxTotal
: The maximum amount of the given currency that can be paid.proof
: For a public mint, you can simply leave this field blank. In a private mint, this would be the generated proof that corresponds to the user's address & previously provided merkle root.
Once all that information is filled out, go ahead and click Write
to build the transaction, then Confirm
to mint the token!
What's next? You can now utilize the sale contracts publicly on your website for an NFT drop or use these contracts for your in-game store to sell game items to your players. We also recommend taking a look at our boilerplates that leverage the sale contracts to enable various use cases such as Fiat Payments with a credit card or ability to pay in any currency for your sale using currency abstraction.