ERC721MarketplaceFacet
event ERC721ListingAdd(uint256 listingId, address seller, address erc721TokenAddress, uint256 erc721TokenId, uint256 category, uint256 time)
event ERC721ListingSplit(uint256 listingId, uint16[2] principalSplit, address affiliate)
event ERC721ListingWhitelistSet(uint256 listingId, uint32 whitelistId)
event ERC721ExecutedListing(uint256 listingId, address seller, address buyer, address erc721TokenAddress, uint256 erc721TokenId, uint256 category, uint256 priceInWei, uint256 time)
event ERC721ExecutedToRecipient(uint256 listingId, address buyer, address recipient)
Is sent in tandem with ERC721ExecutedListing
struct Category {
address erc721TokenAddress;
uint256 category;
}
function setERC721Categories(struct ERC721MarketplaceFacet.Category[] _categories) external
Allow the aavegotchi diamond owner or DAO to set the category details for different types of ERC721 NFTs
Name | Type | Description |
---|---|---|
_categories | struct ERC721MarketplaceFacet.Category[] | An array of structs where each struct contains details about each ERC721 category //erc721TokenAddress and category |
function getERC721Category(address _erc721TokenAddress, uint256 _erc721TokenId) public view returns (uint256 category_)
Query the category of an NFT
Name | Type | Description |
---|---|---|
_erc721TokenAddress | address | The contract address of the NFT to query |
_erc721TokenId | uint256 | The identifier of the NFT to query |
Name | Type | Description |
---|---|---|
category_ | uint256 | Category of the NFT // 0 == portal, 1 == vrf pending, 2 == open portal, 3 == Aavegotchi 4 == Realm. |
function addERC721Listing(address _erc721TokenAddress, uint256 _erc721TokenId, uint256 _priceInWei) external
Allow an ERC721 owner to list his NFT for sale
If the NFT has been listed before,it cancels it and replaces it with the new one NFTs that are listed are immediately locked Will be deprecated soon, use addERC721ListingWithSplit
Name | Type | Description |
---|---|---|
_erc721TokenAddress | address | The contract address of the NFT to be listed |
_erc721TokenId | uint256 | The identifier of the NFT to be listed |
_priceInWei | uint256 | The cost price of the NFT in $GHST |
function addERC721ListingWithSplit(address _erc721TokenAddress, uint256 _erc721TokenId, uint256 _priceInWei, uint16[2] _principalSplit, address _affiliate) external
Allow an ERC721 owner to list his NFT for sale
If the NFT has been listed before,it cancels it and replaces it with the new one NFTs that are listed are immediately locked
Name | Type | Description |
---|---|---|
_erc721TokenAddress | address | The contract address of the NFT to be listed |
_erc721TokenId | uint256 | The identifier of the NFT to be listed |
_priceInWei | uint256 | The cost price of the NFT in $GHST |
_principalSplit | uint16[2] | principal split |
_affiliate | address | The address of affiliate |
function addERC721ListingWithWhitelist(address _erc721TokenAddress, uint256 _erc721TokenId, uint256 _priceInWei, uint16[2] _principalSplit, address _affiliate, uint32 _whitelistId) external
function updateERC721ListingPrice(uint256 _listingId, uint256 _priceInWei) external
Allow an ERC721 owner to update list price of his NFT for sale
If the NFT has not been listed before, it will be rejected
Name | Type | Description |
---|---|---|
_listingId | uint256 | The identifier of the listing to execute |
_priceInWei | uint256 | The price of the item |
function batchUpdateERC721ListingPrice(uint256[] _listingIds, uint256[] _priceInWeis) external
function cancelERC721ListingByToken(address _erc721TokenAddress, uint256 _erc721TokenId) external
Allow an ERC721 owner to cancel his NFT listing by providing the NFT contract address and identifier
Name | Type | Description |
---|---|---|
_erc721TokenAddress | address | The contract address of the NFT to be delisted |
_erc721TokenId | uint256 | The identifier of the NFT to be delisted |
function cancelERC721Listing(uint256 _listingId) external
Allow an ERC721 owner to cancel his NFT listing through the listingID
Name | Type | Description |
---|---|---|
_listingId | uint256 | The identifier of the listing to be cancelled |
function executeERC721ListingToRecipient(uint256 _listingId, address _contractAddress, uint256 _priceInWei, uint256 _tokenId, address _recipient) external
Allow a buyer to execute an open listing i.e buy the NFT on behalf of another address (the recipient). Also checks to ensure the item details match the listing.
Will throw if the NFT has been sold or if the listing has been cancelled already
Name | Type | Description |
---|---|---|
_listingId | uint256 | The identifier of the listing to execute |
_contractAddress | address | The token contract address |
_priceInWei | uint256 | The price of the item |
_tokenId | uint256 | the tokenID of the item |
_recipient | address | The address to receive the NFT |
struct ExecuteERC721ListingParams {
uint256 listingId;
address contractAddress;
uint256 priceInWei;
uint256 tokenId;
address recipient;
}
function batchExecuteERC721Listing(struct ERC721MarketplaceFacet.ExecuteERC721ListingParams[] listings) external
execute gotchi listings in batch
function updateERC721Listing(address _erc721TokenAddress, uint256 _erc721TokenId, address _owner) external
Update the ERC721 listing of an address
Name | Type | Description |
---|---|---|
_erc721TokenAddress | address | Contract address of the ERC721 token |
_erc721TokenId | uint256 | Identifier of the ERC721 token |
_owner | address | Owner of the ERC721 token |
function cancelERC721Listings(uint256[] _listingIds) external
Allow an ERC721 owner to cancel his NFT listings through the listingIDs
Name | Type | Description |
---|---|---|
_listingIds | uint256[] | An array containing the identifiers of the listings to be cancelled |