ERC1155MarketplaceFacet

ERC1155ListingAdd

event ERC1155ListingAdd(uint256 listingId, address seller, address erc1155TokenAddress, uint256 erc1155TypeId, uint256 category, uint256 quantity, uint256 priceInWei, uint256 time)

ERC1155ListingSplit

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

ERC1155ListingWhitelistSet

event ERC1155ListingWhitelistSet(uint256 listingId, uint32 whitelistId)

ERC1155ExecutedListing

event ERC1155ExecutedListing(uint256 listingId, address seller, address buyer, address erc1155TokenAddress, uint256 erc1155TypeId, uint256 category, uint256 _quantity, uint256 priceInWei, uint256 time)

ERC1155ExecutedToRecipient

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

Is sent in tandem with ERC1155ExecutedListing

ERC1155ListingCancelled

event ERC1155ListingCancelled(uint256 listingId)

ChangedListingFee

event ChangedListingFee(uint256 listingFeeInWei)

setListingFee

function setListingFee(uint256 _listingFeeInWei) external

Allow the aavegotchi diamond owner or DAO to set the default listing fee

Parameters

NameTypeDescription

_listingFeeInWei

uint256

The new listing fee in wei

Category

struct Category {
  address erc1155TokenAddress;
  uint256 erc1155TypeId;
  uint256 category;
}

setERC1155Categories

function setERC1155Categories(struct ERC1155MarketplaceFacet.Category[] _categories) external

Allow the aavegotchi diamond owner or DAO to set the category details for multiple ERC1155 NFTs

Parameters

NameTypeDescription

_categories

struct ERC1155MarketplaceFacet.Category[]

An array of structs where each struct contains details about each ERC1155 item //erc1155TokenAddress,erc1155TypeId and category

getERC1155Category

function getERC1155Category(address _erc1155TokenAddress, uint256 _erc1155TypeId) public view returns (uint256 category_)

Query the category details of a ERC1155 NFT

Parameters

NameTypeDescription

_erc1155TokenAddress

address

Contract address of NFT to query

_erc1155TypeId

uint256

Identifier of the NFT to query

Return Values

NameTypeDescription

category_

uint256

Category of the NFT // 0 is wearable, 1 is badge, 2 is consumable, 3 is tickets

setERC1155Listing

function setERC1155Listing(address _erc1155TokenAddress, uint256 _erc1155TypeId, uint256 _quantity, uint256 _priceInWei) external

Allow an ERC1155 owner to list his NFTs for sale

If an NFT has been listed before,it cancels it and replaces it with the new one

Parameters

NameTypeDescription

_erc1155TokenAddress

address

The contract address of the NFT to be listed

_erc1155TypeId

uint256

The identifier of the NFT to be listed

_quantity

uint256

The amount of NFTs to be listed

_priceInWei

uint256

The cost price of the NFT individually in $GHST

setERC1155ListingWithSplit

function setERC1155ListingWithSplit(address _erc1155TokenAddress, uint256 _erc1155TypeId, uint256 _quantity, uint256 _priceInWei, uint16[2] _principalSplit, address _affiliate) external

setERC1155ListingWithWhitelist

function setERC1155ListingWithWhitelist(address _erc1155TokenAddress, uint256 _erc1155TypeId, uint256 _quantity, uint256 _priceInWei, uint16[2] _principalSplit, address _affiliate, uint32 _whitelistId) external

cancelERC1155Listing

function cancelERC1155Listing(uint256 _listingId) external

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

Parameters

NameTypeDescription

_listingId

uint256

The identifier of the listing to be cancelled

executeERC1155Listing

function executeERC1155Listing(uint256 _listingId, uint256 _quantity, uint256 _priceInWei) external

Allow a buyer to execcute an open listing i.e buy the NFT

Will throw if the NFT has been sold or if the listing has been cancelled already Will be deprecated soon.

Parameters

NameTypeDescription

_listingId

uint256

The identifier of the listing to execute

_quantity

uint256

The amount of ERC1155 NFTs execute/buy

_priceInWei

uint256

the cost price of the ERC1155 NFTs individually

executeERC1155ListingToRecipient

function executeERC1155ListingToRecipient(uint256 _listingId, address _contractAddress, uint256 _itemId, uint256 _quantity, uint256 _priceInWei, address _recipient) external

Allow a buyer to execcute an open listing i.e buy the NFT on behalf of 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

_itemId

uint256

the erc1155 token id

_quantity

uint256

The amount of ERC1155 NFTs execute/buy

_priceInWei

uint256

the cost price of the ERC1155 NFTs individually

_recipient

address

the recipient of the item

ExecuteERC1155ListingParams

struct ExecuteERC1155ListingParams {
  uint256 listingId;
  address contractAddress;
  uint256 itemId;
  uint256 quantity;
  uint256 priceInWei;
  address recipient;
}

batchExecuteERC1155Listing

function batchExecuteERC1155Listing(struct ERC1155MarketplaceFacet.ExecuteERC1155ListingParams[] listings) external

execute ERC1155 listings in batch

updateERC1155Listing

function updateERC1155Listing(address _erc1155TokenAddress, uint256 _erc1155TypeId, address _owner) external

Update the ERC1155 listing of an address

Parameters

NameTypeDescription

_erc1155TokenAddress

address

Contract address of the ERC1155 token

_erc1155TypeId

uint256

Identifier of the ERC1155 token

_owner

address

Owner of the ERC1155 token

updateBatchERC1155Listing

function updateBatchERC1155Listing(address _erc1155TokenAddress, uint256[] _erc1155TypeIds, address _owner) external

Update the ERC1155 listings of an address

Parameters

NameTypeDescription

_erc1155TokenAddress

address

Contract address of the ERC1155 token

_erc1155TypeIds

uint256[]

An array containing the identifiers of the ERC1155 tokens to update

_owner

address

Owner of the ERC1155 tokens

cancelERC1155Listings

function cancelERC1155Listings(uint256[] _listingIds) external

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

Parameters

NameTypeDescription

_listingIds

uint256[]

An array containing the identifiers of the listings to be cancelled

updateERC1155ListingPriceAndQuantity

function updateERC1155ListingPriceAndQuantity(uint256 _listingId, uint256 _quantity, uint256 _priceInWei) external

Allow an ERC1155 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

_quantity

uint256

The amount of ERC1155 NFTs execute/buy

_priceInWei

uint256

The price of the item

batchUpdateERC1155ListingPriceAndQuantity

function batchUpdateERC1155ListingPriceAndQuantity(uint256[] _listingIds, uint256[] _quantities, uint256[] _priceInWeis) external