NFT Drop Market

A market for minting NFTs with Foundation.
function MINTER_ROLE() external view returns (bytes32)

The role type used to validate drop collections have granted this market access to mint.

Returns

NameTypeDescription
_0bytes32
function createFixedPriceSale(address nftContract, uint80 price, uint16 limitPerAccount) external nonpayable

Create a fixed price sale drop.

Notes: a) The sale is final and can not be updated or canceled. b) The sale is immediately kicked off. c) Any collection that abides by INFTDropCollectionMint and IAccessControl is supported.

Parameters

NameTypeDescription
nftContractaddressThe address of the NFT drop collection.
priceuint80The price per NFT minted. Set price to 0 for a first come first serve airdrop-like drop.
limitPerAccountuint16The max number of NFTs an account may have while minting.
function getAvailableCountFromFixedPriceSale(address nftContract, address user) external view returns (uint256 numberThatCanBeMinted)

Returns the max number of NFTs a given account may mint.

Parameters

NameTypeDescription
nftContractaddressThe address of the NFT drop collection.
useraddressThe address of the user which will be minting.

Returns

NameTypeDescription
numberThatCanBeMinteduint256How many NFTs the user can mint.
function getFeesAndRecipients(address nftContract, uint256 tokenId, uint256 price) external view returns (uint256 totalFees, uint256 creatorRev, address payable[] creatorRecipients, uint256[] creatorShares, uint256 sellerRev, address payable seller)

Returns how funds will be distributed for a sale at the given price point.

Parameters

NameTypeDescription
nftContractaddressThe address of the NFT contract.
tokenIduint256The id of the NFT.
priceuint256The sale price to calculate the fees for.

Returns

NameTypeDescription
totalFeesuint256How much will be sent to the Foundation treasury and/or referrals.
creatorRevuint256How much will be sent across all the creatorRecipients defined.
creatorRecipientsaddress payable[]The addresses of the recipients to receive a portion of the creator fee.
creatorSharesuint256[]The percentage of the creator fee to be distributed to each creatorRecipient. If there is only one creatorRecipient, this may be an empty array. Otherwise creatorShares.length == creatorRecipients.length.
sellerRevuint256How much will be sent to the owner/seller of the NFT. If the NFT is being sold by the creator, this may be 0 and the full revenue will appear as creatorRev.
selleraddress payableThe address of the owner of the NFT. If sellerRev is 0, this may be address(0).
function getFethAddress() external view returns (address fethAddress)

Gets the FETH contract used to escrow offer funds.

Returns

NameTypeDescription
fethAddressaddressThe FETH contract address.
function getFixedPriceSale(address nftContract) external view returns (address payable seller, uint256 price, uint256 limitPerAccount, uint256 numberOfTokensAvailableToMint, bool marketCanMint)

Returns details for a drop collection's fixed price sale.

Parameters

NameTypeDescription
nftContractaddressThe address of the NFT drop collection.

Returns

NameTypeDescription
selleraddress payableThe address of the seller which listed this drop for sale. This value will be address(0) if the collection is not listed or has sold out.
priceuint256The price per NFT minted.
limitPerAccountuint256The max number of NFTs an account may have while minting.
numberOfTokensAvailableToMintuint256The total number of NFTs that may still be minted.
marketCanMintboolTrue if this contract has permissions to mint from the given collection.
function getFoundationTreasury() external view returns (address payable treasuryAddress)

Gets the Foundation treasury contract.

This call is used in the royalty registry contract.

Returns

NameTypeDescription
treasuryAddressaddress payableThe address of the Foundation treasury contract.
function getRoyaltyRegistry() external view returns (address registry)

Returns the address of the registry allowing for royalty configuration overrides.

See https://royaltyregistry.xyz/

Returns

NameTypeDescription
registryaddressThe address of the royalty registry contract.
function getSellerOf(address nftContract, uint256 tokenId) external view returns (address payable seller)

Checks who the seller for an NFT is if listed in this market.

Parameters

NameTypeDescription
nftContractaddressThe address of the NFT contract.
tokenIduint256The id of the NFT.

Returns

NameTypeDescription
selleraddress payableThe seller which listed this NFT for sale, or address(0) if not listed.
function initialize() external nonpayable

Called once to configure the contract after the initial proxy deployment.

This farms the initialize call out to inherited contracts as needed to initialize mutable variables.

function internalGetImmutableRoyalties(address nftContract, uint256 tokenId) external view returns (address payable[] recipients, uint256[] splitPerRecipientInBasisPoints)

For internal use only.

This function is external to allow using try/catch but is not intended for external use. If ERC2981 royalties (or getRoyalties) are defined by the NFT contract, allow this standard to define immutable royalties that cannot be later changed via the royalty registry.

Parameters

NameTypeDescription
nftContractaddress
tokenIduint256

Returns

NameTypeDescription
recipientsaddress payable[]
splitPerRecipientInBasisPointsuint256[]
function internalGetMutableRoyalties(address nftContract, uint256 tokenId, address payable creator) external view returns (address payable[] recipients, uint256[] splitPerRecipientInBasisPoints)

For internal use only.

This function is external to allow using try/catch but is not intended for external use. This checks for royalties defined in the royalty registry or via a non-standard royalty API.

Parameters

NameTypeDescription
nftContractaddress
tokenIduint256
creatoraddress payable

Returns

NameTypeDescription
recipientsaddress payable[]
splitPerRecipientInBasisPointsuint256[]
function internalGetTokenCreator(address nftContract, uint256 tokenId) external view returns (address payable creator)

For internal use only.

This function is external to allow using try/catch but is not intended for external use. This checks the token creator.

Parameters

NameTypeDescription
nftContractaddress
tokenIduint256

Returns

NameTypeDescription
creatoraddress payable
function mintFromFixedPriceSale(address nftContract, uint16 count, address payable buyReferrer) external payable returns (uint256 firstTokenId)

Used to mint count number of NFTs from the collection.

This call may revert if the collection has sold out, has an insufficient number of tokens available, or if the market's minter permissions were removed. If insufficient msg.value is included, the msg.sender's available FETH token balance will be used.

Parameters

NameTypeDescription
nftContractaddressThe address of the NFT drop collection.
countuint16The number of NFTs to mint.
buyReferreraddress payableThe address which referred this purchase, or address(0) if n/a.

Returns

NameTypeDescription
firstTokenIduint256The tokenId for the first NFT minted. The other minted tokens are assigned sequentially, so firstTokenId - firstTokenId + count - 1 were minted.
event BuyReferralPaid(address indexed nftContract, uint256 indexed tokenId, address buyReferrer, uint256 buyReferrerFee, uint256 buyReferrerSellerFee)

Emitted when an NFT sold with a referrer.

Parameters

NameTypeDescription
nftContract indexedaddress
tokenId indexeduint256
buyReferreraddress
buyReferrerFeeuint256
buyReferrerSellerFeeuint256
event CreateFixedPriceSale(address indexed nftContract, address indexed seller, uint256 price, uint256 limitPerAccount)

Emitted when a collection is listed for sale.

Parameters

NameTypeDescription
nftContract indexedaddress
seller indexedaddress
priceuint256
limitPerAccountuint256
event Initialized(uint8 version)

Parameters

NameTypeDescription
versionuint8
event MintFromFixedPriceDrop(address indexed nftContract, address indexed buyer, uint256 indexed firstTokenId, uint256 count, uint256 totalFees, uint256 creatorRev)

Emitted when NFTs are minted from the drop.

Parameters

NameTypeDescription
nftContract indexedaddress
buyer indexedaddress
firstTokenId indexeduint256
countuint256
totalFeesuint256
creatorRevuint256
event WithdrawalToFETH(address indexed user, uint256 amount)

Emitted when escrowed funds are withdrawn to FETH.

Parameters

NameTypeDescription
user indexedaddress
amountuint256
error FETHNode_FETH_Address_Is_Not_A_Contract()
error FETHNode_Only_FETH_Can_Transfer_ETH()
error FoundationTreasuryNode_Address_Is_Not_A_Contract()
error NFTDropMarketFixedPriceSale_Cannot_Buy_More_Than_Limit(uint256 limitPerAccount)

Parameters

NameTypeDescription
limitPerAccountuint256The limit of tokens an account can purchase.
error NFTDropMarketFixedPriceSale_Limit_Per_Account_Must_Be_Set()
error NFTDropMarketFixedPriceSale_Mint_Count_Mismatch(uint256 targetBalance)

Parameters

NameTypeDescription
targetBalanceuint256
error NFTDropMarketFixedPriceSale_Mint_Permission_Required()
error NFTDropMarketFixedPriceSale_Must_Buy_At_Least_One_Token()
error NFTDropMarketFixedPriceSale_Must_Have_Sale_In_Progress()
error NFTDropMarketFixedPriceSale_Must_Not_Be_Sold_Out()
error NFTDropMarketFixedPriceSale_Must_Not_Have_Pending_Sale()
error NFTDropMarketFixedPriceSale_Must_Support_Collection_Mint_Interface()
error NFTDropMarketFixedPriceSale_Must_Support_ERC721()
error NFTDropMarketFixedPriceSale_Only_Callable_By_Collection_Owner()
error NFTDropMarketFixedPriceSale_Too_Much_Value_Provided(uint256 mintCost)

Parameters

NameTypeDescription
mintCostuint256The total cost for this purchase.
error NFTDropMarket_NFT_Already_Minted()
error NFTMarketFees_Address_Does_Not_Support_IRoyaltyRegistry()
error NFTMarketFees_Invalid_Protocol_Fee()