ERC721 NFT Sale in an Auction
The smart contract to help you sell ERC721 tokens in the form of an auction. In a video game, you can sell a piece of land 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.
Settings
| Parameter | Description |
|---|---|
| definitiveTokenAddress | The token address of the ERC721 that you want to sell. |
| definitiveFeeReceiver | The address that will receive the amount paid for the NFTs. |
| initialStartingPrice | The initial price offered for the NFT. |
| initialMinPriceDifference | The minimum price increase to place a bid on top of the current auction winner. |
| initialStartTime | The time at which the sale will begin and users can bid. Timestamp in seconds. |
| initialEndTime | The time when the sale will end and users couldn't bid anymore. Timestamp in seconds. |
| initialTokenURI | The URI that will be append in the end of the base token URI for the token that will be minted. |
Functions
| Function | Input Parameters | Description |
|---|---|---|
| token | None | Returns the NFT contract where the new tokens are minted. |
| currentPrice | None | Returns the current price of the auction. |
| minPriceDifference | None | Returns the minimum difference between the currentPrice and the bided amount that there should be. |
| currentAuctionWinner | None | Returns the current winner of the auction. Notice that if it’s equal to 0 then there isn’t any winner yet. |
| startTime | None | Returns the start time of the sale. |
| endTime | None | Returns the end time of the sale. |
| tokenURI | None | Returns the URI that the token being auctioned will have. |
| bid | None | Bid for the auction and set the price of the bid by the amount you send to the contract. |
| claim | None | Mint a new token with the tokenURI to the winner of the auction. |
| startNewAuction | (uint256 newStartingPrice, uint256 newMinPriceDifference, uint256 newStartTime, uint256 newEndTime, string memory newTokenURI) | 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. |
| withdraw | None | Withdraw the price paid for the mints. |
| owner | None | Returns the owner of the smart contract. |
| renounceOwnership | None | Renounce the ownership of the smart contract. |
| transferOwnership | (address newOwner) | Transfer the ownership of the contract to a specified address. |