📂
DAO Envelop. NIFTSY
  • Envelop (NIFTSY) documentation
  • Documents
    • Key terms
    • F.A.Q.
    • White paper
      • Disclaimers
      • Introduction
      • Key terms
      • Industry (market) analysis and NIFTSY's place in it
        • Figures and facts
        • Possible implementations of Envelop
      • Protocol. Oracle. Index
        • Protocol
          • NFT as a new order ETF and a brief history of NIFTSY
        • Oracle
        • Index
      • The architecture of the Project and the role of the Token
        • DAO. Token. IDO
        • The token as a linking element in the project
        • IDO (Initial DAO offering)
      • Roadmap. Part. #01
      • Roadmap. Part #02
      • Conclusion
      • List of references
    • Lite paper
      • Abstract
      • Disclaimers
      • Market challenges - our solutions
      • The main hypostases and parts of the Project
      • Development strategy and market coverage
      • Additions
    • White paper (Spanish)
      • Descargo de responsabilidad
      • Introducción
      • Términos clave
      • Análisis de la industria (mercado) y el lugar de NIFTSY en el
        • Figuras y hechos
        • Posibles implementaciones de NIFTSY
      • Protocolo. Oráculo. Índice
        • Protocolo
        • NFTs como un nuevo de EFT y una breve historia de NIFTS
        • Oraculo
        • Índice
        • Untitled
      • La arquitectura del proyecto y el rol del token
        • DAO. Token. IDO
        • El token como un elemento vinculante en el proyecto
        • IDO
      • Mapa de ruta
      • Conclusiones
      • Lista de referencias
    • Lite paper (Spanish)
      • Abstracto
      • Descargo de responsabilidad
      • Los desafíos del mercado y nuestras soluciones
      • La hipótesis principal y partes del proyecto
      • Estrategia de desarrollo y cobertura de mercado
      • Adiciones
    • White paper (BAHASA INDONESIA)
      • PENAFIAN
      • PENGANTAR
      • ​KATA KUNCI
      • ANALISIS INDUSTRI (PASAR)) DAN KEDUDUKAN niftsy DI DALAMNYA
      • Angka dan Fakta
      • Kemungkinan implementasi NIFTSY
      • PROTOKOL. ORACLE. INDEKS
        • Protokol
        • Oracle
        • Indeks
      • ARSITEKTUR PROYEK DAN PERAN TOKEN
      • DAO. Token. IDO
      • Token sebagai elemen penghubung dalam proyek
      • IDO
      • ROADMAP
      • KESIMPULAN
      • DAFTAR REFERENSI
    • LITE PAPER (BAHASA INDONESIA)
      • Abstrak
      • Penafian
      • Tantangan pasar - solusi kami
      • Hipotesis utama dan bagian dari Proyek
      • Strategi pengembangan dan cakupan pasar
      • Tambahan
    • Tokenomics
      • General provisions
      • Links
  • Technical documentation
    • URLs of dAPPs
    • Technical paper
      • Introduction
      • Protocol
      • Oracle
      • Index
      • Stack
      • Conclusion
    • Smart-contracts
      • Deployment addresses v2
      • Deployment addresses v1
      • Deployment addresses v0
      • Security and smart contracts
      • Contract NiftsyERC20.sol
      • Protocol
        • V0
          • Audit
          • Contracts
            • WrapperWithERC20Collateral (V.0)
            • WrapperDistributor721.sol
            • WrapperFarming.sol
        • V1
          • Audit
          • Contracts
            • WrapperV1
            • AdvancedWhiteList.sol
            • EnvelopwNFT721
            • EnvelopwNFT1155
            • Saft
            • SBT smart-contract Factory
          • Gas measurements for Protocol version 1
      • Launchpad
        • V0
          • Launchpad.sol
        • V1
          • NFTKiosk.sol
          • DefaultPriceModel.sol
      • Subscription service
      • Factory (smart-contracts) minting
      • P2P NFT/wNFT trading service
    • Envelop dApps Troubleshooting
  • Tutorials
    • Introduction to tutorials
    • dApps
      • Minting
        • Version 0
          • Release notes
          • Instruction
          • Video
        • Version 1.1
          • Release notes
          • Instruction
          • Video
      • Main app
        • Version 0
          • Release notes
          • Instruction
          • Aptos instruction
          • Video
        • Version 1.0
          • Release notes
          • Instruction
        • Version 1.1
          • Release notes
          • Instruction
          • Video
      • Cross-NFT
        • Version 0
          • Release notes
          • Instruction
          • Video
      • Launchpad (wINO)
        • Version 0
          • Release notes
          • Instruction
          • Video
        • Version 1
          • Release notes
          • Instruction
            • NFT trading
            • ERC20 tokens trading
          • Video
      • Farming
        • Version 0
          • Release notes
          • Instruction
      • SAFT wNFT
        • Version 0
          • Release notices
          • Instruction
          • Video
        • Version 1.0
          • Release notices
          • Insctruction
          • Video
        • Version 1.1
          • Release notices
          • Insctruction
          • Video
    • Oracle
      • Version 0
        • Release notices
      • Version 1
        • Release notices
    • Subscription service
      • Version 0
        • Release notes
      • Version 1
        • Release notes
    • Metamask settings for different networks
    • How to wrap your NFT
    • How to make SAFT wNFT
    • How to unwrap your wNFT
    • How to mint Soulbound tokens with Envelop
    • How to use Wrapper from Safe Gnosis
    • Video tutorials
  • Bounty
    • Bounty FAQ
    • General conditions
    • Bounty rules
    • Approximate (maximum) activity estimates
    • Bug Bounty
  • Legal
    • Privacy-policy
    • Legal FAQ
    • DAO
    • Archive
      • Licence
  • ARHIVE
    • Archive tutorials
      • Wrap NFT
    • Others
      • Marketplace (Scotch.sale)
      • How do I buy on DEXs?
        • Uniswap
        • PancakeSwap
        • QuickSwap
Powered by GitBook
On this page
  • Method setCollateralPriceForDisplay
  • Method editCollateralPriceRecordForDisplay
  • Method setDefaultNFTPriceForDisplay
  • Method editDefaultNFTPriceRecordForDisplay
  • Method setTimeDiscountsForDisplay
  • Method editTimeDiscountsForDisplay
  • Method setPromoDiscountForDisplay
  • Method setRefereerDiscountForDisplay
  • Method getItemPrices
  • Method getDefaultDisplayPrices
  • Method getDisplayTimeDiscounts
  • Method getItemDiscounts
  • Method getBatchPrices
  • Method getBatchDiscounts
  • Method getCollateralUnitPrice
  1. Technical documentation
  2. Smart-contracts
  3. Launchpad
  4. V1

DefaultPriceModel.sol

function editCollateralPriceRecordForDisplay( bytes32 _displayNameHash, address _erc20, uint256 _priceIndex, KTypes.DenominatedPrice calldata _price ) external virtual onlyDisplayOwner(_displayNameHash)

Method setCollateralPriceForDisplay

function setCollateralPriceForDisplay(
        bytes32 _displayNameHash,
        address _erc20,
        KTypes.DenominatedPrice[] calldata _prices
    ) 
        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

_displayNameHash

bytes32

SHA-256 hash of the Kiosk name

_erc20

address

Address of the being sold ERC-20 token

_prices

KTypes.DenominatedPrice[]

Array with price data

KTypes.DenominatedPrice

Name
Type
Description

payWith

address

The smart-contract address of the token, which can be used to pay for ERC-20 tokens sold. In the case of price setting with the possibility of payment by native network tokens zero address is specified

amount

uint256

Number of tokens to be paid per unit of ERC-20 tokens sold

denominator

uint256

A divider to define the price per unit of ERC-20 tokens sold. Applies if the price of one selling token in payment tokens is either fractional or, less than 1

Method editCollateralPriceRecordForDisplay

function editCollateralPriceRecordForDisplay(
        bytes32 _displayNameHash,
        address _erc20,
        uint256 _priceIndex,
        KTypes.DenominatedPrice calldata _price
    )
        external virtual
        onlyDisplayOwner(_displayNameHash)

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:

Name
Type
Description

_displayNameHash

bytes32

SHA-256 hash of the Kiosk name

_erc20

address

Address of the being sold ERC-20 token

_priceIndex

uint256

The index number of the record in the price array to be edited

_prices

KTypes.DenominatedPrice

The price data to be updated. A description of the data type is given above

Method setDefaultNFTPriceForDisplay

function setDefaultNFTPriceForDisplay(
        bytes32 _displayNameHash,
        KTypes.Price[] calldata _prices
    ) 
       external virtual
       onlyDisplayOwner(_displayNameHash)

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:

Name
Type
Description

_displayNameHash

bytes32

SHA-256 hash of the Kiosk name

_prices

KTypes.Price[]

An array of price data for NFT.

KTypes.Price

Name
Type
Description

payWith

address

The smart-contract address of the payment token. In case of payment with native tokens (coin) zero-address is specified

amount

uint256

Number of payment tokens

Method editDefaultNFTPriceRecordForDisplay

function editDefaultNFTPriceRecordForDisplay(
        bytes32 _displayNameHash,
        uint256 _priceIndex,
        KTypes.Price calldata _price
    )
        external virtual
        onlyDisplayOwner(_displayNameHash)

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:

Name
Type
Description

_displayNameHash

bytes32

SHA-256 hash of the Kiosk name

_priceIndex

uint256

The index number of the record in the price array to be edited

_prices

KTypes.Price

The price data for NFT. The description of the data type is given above

Method setTimeDiscountsForDisplay

function setTimeDiscountsForDisplay(
        bytes32 _displayNameHash,
        DiscountUntil[] calldata _discounts
    ) 
       external virtual
       onlyDisplayOwner(_displayNameHash)

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:

Name
Type
Description

_displayNameHash

bytes32

SHA-256 hash of the Kiosk name

_discounts

DiscountUntil[]

Array with data on temporary discounts

DiscountUntil

Name
Type
Description

untilDate

uint256

Date in unixtime format until which the discount applies

discount

KTypes.Discount

Discount data

KTypes.Discount:

Name
Type
Description

dsctType

DiscountType

The value from discount types enum

dsctPercent

uint16

Discount size: 100%-10000, 20%-2000, 3%-300

Method editTimeDiscountsForDisplay

function editTimeDiscountsForDisplay(
        bytes32 _displayNameHash,
        uint256 _discountIndex,
        DiscountUntil calldata _discount
    )
        external virtual
        onlyDisplayOwner(_displayNameHash)

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:

Name
Type
Description

_displayNameHash

bytes32

SHA-256 hash of the Kiosk name

_discountIndex

uint256

The serial number of the record in the array of temporary discounts to be edited

_discounts

DiscountUntil

Data about the temporary discount. A description of the data type is given above

Method setPromoDiscountForDisplay

function setPromoDiscountForDisplay(
        bytes32 _displayNameHash,
        bytes32 _promoHash,
        DiscountUntil calldata _discount
    ) 
        external virtual
        onlyDisplayOwner(_displayNameHash) 

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:

Name
Type
Description

_displayNameHash

bytes32

SHA-256 hash of the Kiosk name

_promoHash

bytes32

SHA-256 hash of promo-code (words or phrases)

_discounts

DiscountUntil

Data about the promotional code discount. A description of the data type is given above

Method setRefereerDiscountForDisplay

function setRefereerDiscountForDisplay(
        bytes32 _displayNameHash,
        address _referrer,
        DiscountUntil calldata _discount
    ) 
        external virtual
        onlyDisplayOwner(_displayNameHash)

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:

Name
Type
Description

_displayNameHash

bytes32

SHA-256 hash of the Kiosk name

_referrer

address

The refereer address which buyers can use to get refereer discount during the purchase

_discounts

DiscountUntil

Data about the refereer discount. A description of the data type is given above

Method getItemPrices

function getItemPrices(
        ETypes.AssetItem memory _assetItem
    ) external view virtual returns (KTypes.Price[] memory)

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:

Name
Type
Description

_assetItem

ETypes.AssetItem

Data on the NFT/wNFT that are being sold.

ETypes.AssetItem

Name
Type
Description

asset

ETypes.Asset

Data about the type and contract of token transferred to the Lunchpad contract

tokenId

uint256

Number of token

amount

amount

Value 0 (zero)

ETypes.Asset

Name
Type
Description

assetType

ETypes.AssetType

The value from Asset Type enum

contractAddress

address

Thr address of the NFT/wNFT smart contract.

ETypes.AssetType: 3 - ERC-721.

Returned values:

Name
Type
Description

prices

KTypes.Price[]

Array with prices for NFT/wNFT. The description of the data type is given above

Method getDefaultDisplayPrices

function getDefaultDisplayPrices(
        ETypes.AssetItem memory _assetItem
    ) public view virtual returns (KTypes.Price[] memory _prices)

The method returns data about prices specified in the Kiosk settings for sold nfts (regular NFTs).

Incoming parameters for calling the method:

Name
Type
Description

_assetItem

ETypes.AssetItem

Data on the NFT that is being sold. A description of the type was given above

Returned values:

Name
Type
Description

prices

KTypes.Price[]

Array with prices for NFT. The description of the data type is given above

Method getDisplayTimeDiscounts

function getDisplayTimeDiscounts(
        bytes32 _displayNameHash
    ) public view virtual returns (DiscountUntil[] memory)

The method returns data about temporary discounts set for the Kiosk.

Incoming parameters for calling the method:

Name
Type
Description

_displayNameHash

bytes32

SHA-256 hash of the Kiosk name

Returned values:

discounts

DiscountUntil[]

Array with data about temporary discounts for NFT/wNFT. The description of the data type is given above

Method getItemDiscounts

function getItemDiscounts(
        ETypes.AssetItem memory _assetItem,
        address _buyer,
        address _referrer,
        bytes32 _promoHash
    ) public view virtual returns (KTypes.Discount[] memory)

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:

Name
Type
Description

_assetItem

ETypes.AssetItem

Data on the NFT/wNFT that is being sold. A description of the type was given above

_buyer

address

Address of the recipient of the being purchased NFT/wNFT

_referrer

address

Referral address, which is added by the Kiosk owner in the Kiosk settings

_promo

string

Promo-code added by the Kiosk owner in the Kiosk settings

Returned values:

Name
Type
Description

discount

KTypes.Discount[]

Array with data on discounts that apply to the given NFT/wNFT, taking into account the data passed to the method about the promo code and referral

Method getBatchPrices

function getBatchPrices(
        ETypes.AssetItem[] memory _assetItemArray
    ) external view virtual returns (KTypes.Price[] memory)

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:

Name
Type
Description

_assetItem

ETypes.AssetItem[]

An array of NFT/wNFT data for which prices are requested. The description of the type was given above

Returned values:

prices

KTypes.Price[]

Array with data on prices that apply to the passed NFT/wNFT to method

Method getBatchDiscounts

function getBatchDiscounts(
        ETypes.AssetItem[] memory _assetItemArray,
        address _buyer,
        address _referrer,
        bytes32 _promoHash
    ) external view virtual returns (KTypes.Discount[] memory)

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:

Name
Type
Description

_assetItem

ETypes.AssetItem[]

An array of NFT/wNFT data for which discounts are requested. The description of the type was given above

_buyer

address

Address of the recipient of the being purchased NFT/wNFT

_referrer

address

Referral address, which is added by the Kiosk owner in the Kiosk settings

_promo

string

Promo-code added by the Kiosk owner in the Kiosk settings

Returned values:

Name
Type
Description

discounts

KTypes.Discount[]

Array with data about discounts, which are applied to the passed NFT/wNFT to method, taking into account data about promo code and referral

Method getCollateralUnitPrice

function getCollateralUnitPrice(
        bytes32 _displayNameHash, 
        address _erc20
    ) external view returns(KTypes.DenominatedPrice[] memory)

The method returns prices per unit of ERC-20 token being sold in the Kiosk.

Incoming parameters for calling the method:

Name
Type
Description

_displayNameHash

bytes32

SHA-256 hash of the Kiosk name

_erc20

address

Address of the smart-contract of the ERC-20 token being sold in the Kiosk

Returned values:

Name
Type
Description

prices

KTypes.DenominatedPrice[]

An array with price data. The description of the data type is given above

PreviousNFTKiosk.solNextSubscription service

Last updated 2 years ago