NFTKiosk.sol
The main changes included in version 1 of the Launchpad are as follows:
The contract architecture has been reworked.
Pricing and discount functionality have been separated into a separate contract.
The ability to create an individual storefront (aka Kiosk) for its owner has been added.
The ability to use a personalized pricing and discount contract for each storefront (aka Kiosk) has been added.
Functionality for selling regular ERC-721 standard NFTs has been added.
The ability to set individual prices for NFTs and wNFTs has been added.
The ability to set prices at the storefront (aka Kiosk) level for the NFTs and wNFTs placed on it has been added.
Various types of discounts have been introduced, including time-based discounts, discounts using promo codes, and referral discounts.
Restrictions:
The smart contract can only work with wNFT of Wrapper v.1 version.
The sellable ERC-20 tokens should be first in the collateral array of wNFTs.
ERC-1155 tokens are not being supported.
The contract model of prices and discounts for the Kiosk should be added in the white list of models. To do it it is necessary to send email to DAO ENVELOP. Email address is tech@niftsy.io. The technical team will contact the email sender to perform the code review of his smart contract.
Method setDisplayParams
The method registers a storefront (aka Kiosk) for a user. Only the owner of the storefront (aka Kiosk) can configure it, set prices, place NFTs and wNFTs on their storefront (aka Kiosk), and set the size of discounts to them.
The owner needs to come up with a name for the storefront, which users will use in the URL when they visit the launchpad dApp. For example, in the URL "https://stage.appv1.envelop.is/launchpad/5/0xb267e4067886da3566511fa508ffce4b24e656b6/brownie", the last part "brownie" represents the storefront's name.
The method emits a DisplayChanged event with the following details:
The hash of the storefront name using the SHA-256 algorithm.
The address of the storefront owner.
The address of the recipient for funds from the sale of NFTs and wNFTs on the storefront (when sales happen on default storefront (aka Kiosk)).
The start date of the sales in Unix time format.
The end date of the sales in Unix time format.
The address of the contract for the pricing and discount model for the storefront.
The storefront name.
Incoming parameters for calling the method:
Method transferDisplay
The method transfers ownership of a storefront (aka Kiosk) from the old owner to a new owner.
The method emits a DisplayTransfer event with the following details:
The hash of the storefront name using the SHA-256 algorithm.
The old owner of the storefront.
|The new owner of the storefront.
Incoming parameters for calling the method:
Method addItemToDisplay
The method places NFTs (non-fungible tokens) and wNFTs (wrapped non-fungible tokens) on a storefront (aka Kiosk). Only the owner of a specific Kiosk can call this method. Before calling the method, the owner must give permission to the Launchpad contract to use their (NFTs and wNFTs). The method transfers the NFTs and wNFTs to the address of the Launchpad smart-contract.
The method emits an event called "ItemAddedToDisplay" with the following details:
The hash of the storefront name using the SHA-256 algorithm.
The address of the NFT/wNFT smart contract.
The tokenId of the NFT/wNFT.
The index position of the NFT/wNFT in the array of tokens placed on the specific display case.
Incoming parameters for the method:
ETypes.AssetItem
ETypes.Asset
ETypes.AssetType: 3 - ERC-721.
KTypes.Price
The method returns values:
Method addBatchItemsToDisplayWithSamePrice
The method allows the placement of multiple NFTs/wNFTs on a Kiosk in a single call. Only the owner of a specific Kiosk can call this method. Before calling the method, the owner must give permission to the Launchpad contract to use their NFTs and wNFTs. The method transfers the NFTs and wNFTs to the address of the Launchpad contract. Individual pricing settings apply to the entire group of NFTs/wNFTs being placed.
The method emits an event called "ItemAddedToDisplay" for each NFT/wNFT being placed, providing the following details:
The hash of the Kiosk name using the SHA-256 algorithm.
The address of the NFT/wNFT smart contract.
The tokenId of the NFT/wNFT.
The index position of the NFT/wNFT in the array of tokens placed on the specific Kiosk.
Incoming method call parameters:
The method returns an array of value pairs:
Method addAssetItemPriceAtIndex
The method adds prices for NFT/wNFT. The method can only be called by the owner of the Kiosk where the NFT/wNFT is placed.
The method emits an event called "ItemPriceChanged" with the following details:
The hash of the Kiosk name using the SHA-256 algorithm, where the NFT/wNFT is placed.
The address of the NFT/wNFT smart-contract.
The tokenId of the NFT/wNFT.
Incoming parameters for the method:
Method editAssetItemPriceAtIndex
The method replaces the price record in the array of individual prices for the NFT/wNFT placed on the Kiosk. The method can only be called by the owner of the Kiosk where the NFT/wNFT is placed.
The method emits an event called "ItemPriceChanged" with the following details:
The hash of the Kiosk name using the SHA-256 algorithm, where the NFT/wNFT is placed.
The address of the NFT/wNFT smart-contract.
The tokenId of the NFT/wNFT.
Incoming parameters for the method:
Method removeLastPersonalPriceForAssetItem
The method deletes the last record in the array of individual prices for the NFT/wNFT placed on the Kiosk. The method can only be called by the owner of the Kiosk, where the NFT/wNFT is placed.
The method emits an event called "ItemPriceChanged" with the following details:
The hash of the Kiosk name using the SHA-256 algorithm, where the NFT/wNFT is placed.
The address of the NFT/wNFT smart-contract.
The tokenId of the NFT/wNFT.
Incoming parameters for the method:
Method buyAssetItem
The method allows a user to purchase the NFT/wNFT placed on the Kiosk. When call the method, the user can send a certain amount of native network coins if he decide to buy for native tokens. Before calling the method, the user must give permission to use ERC-20 tokens, which they intend to use for payment of the NFT/wNFT (if the payment is made with ERC-20 tokens that the Kiosk owner is willing to accept as payment). The purchase can only be made during the period between the start and end dates of trading the NFT/wNFT on the Kiosk.
The method emits an event called "EnvelopPurchase" with the following details:
The hash of the Kiosk name using the SHA-256 algorithm, where the NFT/wNFT is placed.
The address of the NFT/wNFT smart-contract.
The tokenId of the NFT/wNFT.
The method emits an event called "EnvelopReferrer" with the following details (if buyer calls method with filled referrer address):
The address of referrer.
The address of buyer.
The address of payment token smart contract using by buyer to pay
The amount of payment
The percent of referrer discount
Incoming parameters for the method:
Method getDisplayOwner
The method returns the address of the Kiosk owner.
Incoming parameters for the method:
Returned values:
Method getDisplay
The method returns information about the Kiosk.
Incoming parameters for the method:
Returned values:
KTypes.Display
KTypes.ItemForSale
Method getAssetItemPlace
The method returns data about the Kiosk where the NFT/wNFT is placed.
Incoming parameters for the method:
Returned values:
Method getAssetItemPricesAndDiscounts
The method returns data about prices and discounts for placed NFT/wNFT.
Incoming parameters for the method:
Returned values:
KTypes.Discount:
DiscountType:
0 - promo-discount (PROMO)
1 - referral-discount (REFERRAL)
2 - discount by volume of purchases (BATCH)
3 - discount by time (TIME)
4 - discount for members of "white-lists" (WHITELIST)
5, 6, 7 - discounts which can be set in the contract price and discount models by the the kiosk owner (CUSTOM1, CUSTOM2, CUSTOM3)
Method getDisplayAssetItems
The method returns for the Kiosk information about all NFTs and wNFT placed on it and not yet sold.
Incoming parameters for the method:
Returned values:
Method getAssetItem
The method returns settings data for a particular NFT/wNFT.
Incoming parameters for the method:
Returned values:
Method hlpHashString
The method returns SHA-256 hash for a value.
Incoming parameters for the method:
Returned values:
Last updated