ERC721MarketplaceFacet

ERC721ListingAdd

event ERC721ListingAdd(uint256 listingId, address seller, address erc721TokenAddress, uint256 erc721TokenId, uint256 category, uint256 time)

ERC721ListingSplit

event ERC721ListingSplit(uint256 listingId, uint16[2] principalSplit, address affiliate)

ERC721ListingWhitelistSet

event ERC721ListingWhitelistSet(uint256 listingId, uint32 whitelistId)

ERC721ExecutedListing

event ERC721ExecutedListing(uint256 listingId, address seller, address buyer, address erc721TokenAddress, uint256 erc721TokenId, uint256 category, uint256 priceInWei, uint256 time)

ERC721ExecutedToRecipient

event ERC721ExecutedToRecipient(uint256 listingId, address buyer, address recipient)

Is sent in tandem with ERC721ExecutedListing

Category

struct Category {
  address erc721TokenAddress;
  uint256 category;
}

setERC721Categories

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

Parameters

NameTypeDescription

_categories

struct ERC721MarketplaceFacet.Category[]

An array of structs where each struct contains details about each ERC721 category //erc721TokenAddress and category

getERC721Category

function getERC721Category(address _erc721TokenAddress, uint256 _erc721TokenId) public view returns (uint256 category_)

Query the category of an NFT

Parameters

NameTypeDescription

_erc721TokenAddress

address

The contract address of the NFT to query

_erc721TokenId

uint256

The identifier of the NFT to query

Return Values

NameTypeDescription

category_

uint256

Category of the NFT // 0 == portal, 1 == vrf pending, 2 == open portal, 3 == Aavegotchi 4 == Realm.

addERC721Listing

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

Parameters

NameTypeDescription

_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

addERC721ListingWithSplit

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

Parameters

NameTypeDescription

_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

addERC721ListingWithWhitelist

function addERC721ListingWithWhitelist(address _erc721TokenAddress, uint256 _erc721TokenId, uint256 _priceInWei, uint16[2] _principalSplit, address _affiliate, uint32 _whitelistId) external

updateERC721ListingPrice

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

Parameters

NameTypeDescription

_listingId

uint256

The identifier of the listing to execute

_priceInWei

uint256

The price of the item

batchUpdateERC721ListingPrice

function batchUpdateERC721ListingPrice(uint256[] _listingIds, uint256[] _priceInWeis) external

cancelERC721ListingByToken

function cancelERC721ListingByToken(address _erc721TokenAddress, uint256 _erc721TokenId) external

Allow an ERC721 owner to cancel his NFT listing by providing the NFT contract address and identifier

Parameters

NameTypeDescription

_erc721TokenAddress

address

The contract address of the NFT to be delisted

_erc721TokenId

uint256

The identifier of the NFT to be delisted

cancelERC721Listing

function cancelERC721Listing(uint256 _listingId) external

Allow an ERC721 owner to cancel his NFT listing through the listingID

Parameters

NameTypeDescription

_listingId

uint256

The identifier of the listing to be cancelled

executeERC721ListingToRecipient

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

Parameters

NameTypeDescription

_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

ExecuteERC721ListingParams

struct ExecuteERC721ListingParams {
  uint256 listingId;
  address contractAddress;
  uint256 priceInWei;
  uint256 tokenId;
  address recipient;
}

batchExecuteERC721Listing

function batchExecuteERC721Listing(struct ERC721MarketplaceFacet.ExecuteERC721ListingParams[] listings) external

execute gotchi listings in batch

updateERC721Listing

function updateERC721Listing(address _erc721TokenAddress, uint256 _erc721TokenId, address _owner) external

Update the ERC721 listing of an address

Parameters

NameTypeDescription

_erc721TokenAddress

address

Contract address of the ERC721 token

_erc721TokenId

uint256

Identifier of the ERC721 token

_owner

address

Owner of the ERC721 token

cancelERC721Listings

function cancelERC721Listings(uint256[] _listingIds) external

Allow an ERC721 owner to cancel his NFT listings through the listingIDs

Parameters

NameTypeDescription

_listingIds

uint256[]

An array containing the identifiers of the listings to be cancelled