DefaultPriceModel.sol
Last updated
Last updated
function editCollateralPriceRecordForDisplay( bytes32 _displayNameHash, address _erc20, uint256 _priceIndex, KTypes.DenominatedPrice calldata _price ) external virtual onlyDisplayOwner(_displayNameHash)
The method sets prices for the sale of ERC-20 tokens that will be sold through wNFT placed on the Kiosk. Multiple types of ERC-20 tokens can be simultaneously sold on the Kiosk. They just need to be added to the wNFT Collateral and placed on the Kiosk. Only the Kiosk owner can invoke this method.
IMPORTANT: In this example contract model, only the ERC-20 tokens that were added to wNFT first (the 1st token record in the wNFT Collateral array) are considered as the ones being sold with prices and discounts.
The method emits a CollateralPriceChanged event for each record in the provided array of prices, with the following details:
The SHA-256 hash of the Kiosk name on which the wNFT is placed.
The address of the smart-contract of the ERC-20 token being sold.
Incoming parameters for calling the method:
Name | Type | Description |
---|---|---|
KTypes.DenominatedPrice
The method edits prices for the sale of ERC-20 tokens by completely replacing the record in the price array. Only the Kiosk owner can invoke this method for their Kiosk.
The method emits a CollateralPriceChanged event with the following details:
The SHA-256 hash of the Kiosk name on which the wNFT is placed.
The address of the smart-contract of the ERC-20 token being sold.
Incoming parameters for calling the method:
The method sets prices for the sale of NFTs that will be sold through placing on the Kiosk. If individual prices are not specified when placing the NFTs, the prices set during the invocation of this method will be used for the sale. Only the Kiosk owner can invoke this method for their Kiosk.
The method emits a DefaultPriceChanged event for each record in the provided array of prices, with the following details:
The SHA-256 hash of the Kiosk name on which the NFT is listed.
The address of the smart-contract token that can be used to purchase the NFT.
The quantity of tokens required to be paid for the NFT.
Incoming parameters for calling the method:
KTypes.Price
The method edits prices for the sale of NFTs that will be sold through placing on the Kiosk. Only the Kiosk owner can invoke this method for their Kiosk.
The method emits a DefaultPriceChanged event with the following details:
The SHA-256 hash of the Kiosk name on which the NFT is placed.
The address of the smart-contract token that can be used to purchase the NFT.
The quantity of tokens required to be paid for the NFT.
Incoming parameters for calling the method:
The method sets time-based discounts that will be applied during the sale of NFTs and wNFTs on the Kiosk. It is possible to configure step-by-step application of discounts. For example, a 10% discount is applicable until 01.01.2024, and a 5% discount is applicable from 01.01.2024 to 01.02.2024. Only the Kiosk owner can invoke this method for their Kiosk.
The method emits a DiscountChanged event for each record in the provided array of time-based discounts, with the following details:
The SHA-256 hash of the Kiosk name on which the NFT/wNFT is placed.
The discount type, "TIME," which is a value from the DiscountType enumeration.
The date in Unix time format until which the discount is valid.
The discount percentage. For example, 1% would be represented as 100, 20% as 2000, and 100% as 10000.
Full list of discount types:
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)
Incoming parameters for calling the method:
DiscountUntil
KTypes.Discount:
The method updates time-based discount data that will be applied during the sale of NFTs and wNFTs on the Kiosk. Only the Kiosk owner can invoke this method for their Kiosk.
The method emits a DiscountChanged event with the following details:
The SHA-256 hash of the Kiosk name on which the NFT/wNFT is placed.
The discount type, a value from the DiscountType enumeration.
The date in Unix time format until which the discount is valid.
The discount percentage. For example, 1% would be represented as 100, 20% as 2000, and 100% as 10000.
Incoming parameters for calling the method:
The method sets discounts based on promo codes that will be applied during the sale of NFTs and wNFTs on the Kiosk. It is possible to create multiple promo codes for the Kiosk. Only the Kiosk owner can invoke this method for their Kiosk.
The method emits a DiscountChanged event with the following details:
The SHA-256 hash of the Kiosk name on which the NFT/wNFT is placed.
The discount type, "PROMO," which is a value from the DiscountType enumeration.
The SHA-256 hash of the promo-code (words or phrases).
The discount percentage. For example, 1% would be represented as 100, 20% as 2000, and 100% as 10000.
Incoming parameters for calling the method:
The method sets discounts based on the refereer address that will be applied during the sale of NFTs and wNFTs on the Kiosk. It is possible to create multiple refereer addresses for the Kiosk. Only the Kiosk owner can invoke this method for their Kiosk.
The method emits a DiscountChanged event with the following details:
The SHA-256 hash of the Kiosk name on which the NFT/wNFT is placed.
The discount type, "REFERRAL," which is a value from the DiscountType enumeration.
The SHA-256 hash of the refereer address.
The discount percentage. For example, 1% would be represented as 100, 20% as 2000, and 100% as 10000.
Incoming parameters for calling the method:
The method returns the price data specified in the Kiosk settings (default prices). If the _assetItem is a wNFT, the method will return all prices for the ERC-20 token being sold (the first token in the wNFT collateral array) as specified in the Kiosk settings. If the _assetItem is an NFT, the method will return all prices specified in the storefront settings for the NFTs being sold.
Incoming parameters for calling the method:
ETypes.AssetItem
ETypes.Asset
ETypes.AssetType: 3 - ERC-721.
Returned values:
The method returns data about prices specified in the Kiosk settings for sold nfts (regular NFTs).
Incoming parameters for calling the method:
Returned values:
The method returns data about temporary discounts set for the Kiosk.
Incoming parameters for calling the method:
Returned values:
The method returns discount data for an NFT/wNFT that will be applied during its sale.
IMPORTANT: In this example of the price and discount contract, this method always returns an array of three records. The first record contains information about the time-based discount, the second record contains information about the promo-code discount, and the third record contains information about the referral discount. The Kiosk owner is allowed to develop their own price and discount contract and modify the algorithm of this method.
Incoming parameters for calling the method:
Returned values:
The method can return an array of prices for the NFT/wNFT array. The method is for the case when the user buys several NFT/wNFT and a discount for the volume of purchases should be applied. The logic of the method is not implemented in this contract of prices and discounts.
Incoming parameters for calling the method:
Returned values:
The method can return an array of discounts for an array of NFTs/wNFTs. This method is used when a user purchases multiple NFTs/wNFTs and a volume discount should be applied. The logic for this method is not implemented in this price and discount contract.
Incoming parameters for calling the method:
Returned values:
The method returns prices per unit of ERC-20 token being sold in the Kiosk.
Incoming parameters for calling the method:
Returned values:
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|