Selling a Token
Once a token has been created, it can then be put up for sale. Minter strategy contracts are separate contracts that hold minting logic, but the main 1155 is called for minting. Check out the minting section to learn more about minters.
To create a sale you must use the callSale
function on the 1155 contract.
This will set the sale in the appropriate minter.
function callSale( uint256 tokenId, IMinter1155 salesConfig, // Minter Strategy Contract bytes memory data)
The data that is passed into the minter is used to call the setSale
function.
Each minter has a unique salesConfig.
function setSale(uint256 tokenId, SalesConfig memory salesConfig)
#
Fixed Price SaleCalling callSale
on an 1155 contract will create a sale for an NFT, but the FIXED_PRICE_SALE_STRATEGY
address must be specified.
The salesConfig
for a fixed price is structured as follows:
struct SalesConfig { uint64 saleStart; uint64 saleEnd; uint64 maxTokensPerAddress; uint96 pricePerToken; // Price in Wei address fundsRecipient; // Where to send the funds}
#
Merkle SaleCreate a allow list sale with a Merkle proof.
Note, the price and the max mint amount per address are specified when creating the Merkle tree. The Merkle sales config is as follows:
struct MerkleSaleSettings { uint64 presaleStart; uint64 presaleEnd; address fundsRecipient; bytes32 merkleRoot;}
#
Supply RoyaltyWhen selling a token, a creator has the opportunity to receive a certain percentage of the tokens minted for themselves.
These tokens are minted to the royaltyRecipient
address as the mints occur.
As tokens are minted, an amount is minted to them as the mints occur using the royaltyMintSchedule
.
royaltyMintSchedule
: 1/N tokens are minted to the royalty recipientroyaltyBPS
: The royalty amount in basis points for secondary sales.royaltyRecipient
: The address that will receive the royalty payments.
struct RoyaltyConfiguration { uint32 royaltyMintSchedule; uint32 royaltyBPS; address royaltyRecipient;}
This can be set at both the contract and token level.
function updateRoyaltiesForToken( uint256 tokenId, RoyaltyConfiguration memory newConfiguration)
#
Withdrawing FundsAdmin can withdraw all funds to the msg.sender
.
function withdrawAll() public onlyAdminOrRole(CONTRACT_BASE_ID, PERMISSION_BIT_FUNDS_MANAGER)
Admin can withdraw a certain amount to a specific address.
function withdrawCustom( address recipient, uint256 amounts) public onlyAdminOrRole(CONTRACT_BASE_ID, PERMISSION_BIT_FUNDS_MANAGER)