Mogies Dutch Auction Contract

A variation on the ERC-721A Non-Fungible Token Standard The following smart contract allows for the implementation of a "Dutch Auction" sale for NFTs. This standard provides basic functionality for selling NFTs and other functionalities including:

  • Whitelist

  • Public Sale

  • Token Rebate

  • Developer Mint

  • Bonus Mint

Functions

auctionMint

function auctionMint(uint32 quantity, bool isUsingStars)

Function to handle the dutch auction

allowlistMint

function allowlistMint(uint32 quantity,bool isStars,bytes32[] memory _proof)

Function to support the whitelist sale

isAllowedListed

function isAllowListed(bytes32[] memory _proof, address _address)

setAllowListMerkleRoot

function setAllowListMerkleRoot(bytes32 _allowListMerkleRoot)

Function for contract owner to allow merkle tree during the whitelist sale

publicSaleMint

 function publicSaleMint(uint32 quantity, bool isStars)

isPublicSaleOn

function isPublicSaleOn() public view returns (bool)

setPublicSale

 function setPublicSale(bool _publicSale)

setAuctionEthParams

function setAuctionEthParams(
        uint256 _auctionStartEthPrice,
        uint256 _auctionEndEthPrice,
        uint256 _auctionDropPerStepEth
    )

Helper functions for setting prices right before auction. Will only be needed when large price fluctuations occur between deployment of the contract and start of auction. Will no longer be avaliable once the sale has started.

setAuctionStarsParams

 function setAuctionStarsParams(
        uint256 _auctionStartStarsPrice,
        uint256 _auctionEndStarsPrice,
        uint256 _auctionDropPerStepStars
    )

getAuctionPrice

function getAuctionPrice(uint256 _saleStartTime, bool _isUsingStars)

rebate

function rebate()

refundIfOver

function refundIfOver(uint256 price) private returns (uint256)

getBuyerList

function getBuyerList(uint256 tier)

setEthUsdPrice

function setEthUsdPrice(uint256 _ethUsdPrice)

setStarsUsdPrice

  function setStarsUsdPrice(uint256 _starsUsdPrice)

setAuctionSaleStartTime

  function setAuctionSaleStartTime(uint32 timestamp)

setWhitelistSaleStartTime

function setWhitelistSaleStartTime(uint32 timestamp)

setPublicSaleStartTime

 function setPublicSaleStartTime(uint32 timestamp)

setWhitelistSaleEndTime

function setWhitelistSaleEndTime(uint32 timestamp)

setPublicSaleEndTime

function setPublicSaleEndTime(uint32 timestamp)

devMint

function devMint(uint256 quantity, address recipient)

mintRemaining

 function mintRemaining()

setUriPrefix

function setUriPrefix(string memory _uriPrefix)

setUriSuffix

 function setUriSuffix(string memory _uriSuffix)

setRevealed

function setRevealed(bool _state)

tokenURI

function tokenURI(uint256 _tokenId)

setHiddenMetadataUri

function setHiddenMetadataUri(string memory _hiddenMetadataUri)

_baseURI

function _baseURI()

requestStartingIndex

function requestStartingIndex(bytes32 _keyHash, uint256 _fee)

fulfillRandomness

function fulfillRandomness(bytes32 _requestId, uint256 _randomness)

setProvenance

  function setProvenance(string calldata _provenance)

withdrawMoney

 function withdrawMoney()

Last updated