Skip to main content

ERC1155 NFT Sale

The smart contract to help you sell ERC1155 tokens.In a video game, you can sell a piece of equipment to another player.

The sale version enables you to mint a new token and sell it to your users. It helps you set up a whole sale choosing when it starts and ends, set a maximum number of tokens that can be sold in total or to the same user.

Notice that you must set the price of the tokens you want to sell after creating the contract by calling the setPrices function.

Parameters

  • definitiveTokenAddress: The token address of the ERC721 that you want to sell

  • definitiveStartTime: The time when the sale will begin and users can mint tokens

  • definitiveEndTime: The time when the sale will end and users couldn't mint anymore tokens

  • definitiveMaxTokensPerAddress: The maximum amount of tokens that can be minted by a single address

  • definitiveMaxSupply: The maximum amount of tokens that can be minted during the sale

  • definitiveFeeReceiver: The address that will receive all the price paid to mint the NFTs

Functions

FunctionInput ParametersDescription
tokenNoneReturns the NFT contract where the new tokens will be minted at.
pricePerToken(uint256)Returns the price of the selected token
startTimeNoneReturns the start time of the sale.
endTimeNoneReturns the end time of the sale.
maxTokensPerAddressNoneReturns the max number of tokens that a address can mint.
leftSupplyNoneThe left amount of token that can be minted during this sale.
tokensClaimed(address)The amount of token claimed per address
mint(address to, uint256 id, uint256 amount)Mint nth new tokens to a specific address from the token collection with the given id. Notice the minter must send the required amount defined by price times the amount of tokens minted.
mintBatch(address to, uint256[] memory ids, uint256[] memory amounts)Batch mint nth new tokens to a specific address from the token collection with the given id. Notice the minter must send the required amount defined by price times the amount of tokens minted.
withdrawNoneWithdraw the price paid for the mints
setPrices(uint256[] memory ids, uint256[] memory prices)Set the prices of a list of tokens by a list of prices.
  • Parameters
  • Functions