Skip to main content

ERC1155 NFT collection Sale in an Auction

The smart contract template to help you sell ERC1155 tokens in the form of an auction. In a video game, you can sell a piece of equipment to the player placing the highest bid.

Notice you can start a new auction by simply calling the startNewAuction function without having to deploy a new contract.

Parameters

ParameterDescription
definitiveTokenAddressThe token address of the ERC721 that you want to sell.
definitiveFeeReceiverThe address that will receive the amount paid for the NFTs.
initialStartingPriceThe initial price offered for the NFT.
initialMinPriceDifferenceThe minimum price increase to place a bid on top of the current auction winner.
initialStartTimeThe time at which the sale will begin and users can bid. Timestamp in seconds.
initialEndTimeThe time when the sale will end and users couldn't bid anymore. Timestamp in seconds.
initialTokenIdThe token id of the token that will be minted for the auction.
initialTokenAmountThe amount of tokens that will be minted for the auction.

Functions

FunctionInput ParametersDescription
tokenNoneReturns the NFT contract where the new tokens will be minted at.
currentPriceNoneReturns the current price of the auction.
minPriceDifferenceNoneReturns the minimum difference between the currentPrice and the bided amount that there should be.
currentAuctionWinnerNoneReturns the current winner of the auction. Notice that if it’s equal to 0 then there isn’t any winner yet.
startTimeNoneReturns the start time of the sale.
endTimeNoneReturns the end time of the sale.
tokenIdNoneReturns the id that the token being auctioned will have.
tokenAmountNoneReturns the amount of tokens being auctioned.
bidNoneBid for the auction and set the price of the bid by the amount you send to the contract.
claimNoneMint a new token with the tokenURI to the winner of the auction.
startNewAuction(uint256 newStartingPrice, uint256 newMinPriceDifference, uint256 newStartTime, uint256 newEndTime, uint256 newTokenId, uint256 newTokenAmount)Start a whole new auction with new parameters you can define. Notice that no current auction can be ongoing and the caller must be the owner of the smart contract.
withdrawNoneWithdraw the price paid for the mints.
ownerNoneReturns the owner of the smart contract.
renounceOwnershipNoneRenounce the ownership of the smart contract.
transferOwnership(address newOwner)Transfer the ownership of the contract to a specified address.
  • Parameters
  • Functions