📂
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 claimNFT
  • Method getWNFTPrice
  • Method withdrawEther
  • Method withdrawTokens
  • Method setPrice
  • Method setEnableAfterDate
  1. Technical documentation
  2. Smart-contracts
  3. Launchpad
  4. V0

Launchpad.sol

PreviousV0NextV1

Last updated 2 years ago

The Lunchpad contract allows wNFT to be sold with Collateral in the form of a specific ERC-20 token. wNFT in this case is the packaging of the ERC-20 token being sold. There may be other ERC-20 tokens in the Collateral of wNFT, but they do not affect the price of wNFT. Their balance for wNFT is not taken into account when calculating the price of wNFT.

The mechanics of the calculation are as follows: an ERC-20 token being sold by wrapping some amount of it in wNFT can be sold for a native network token or ERC-20 tokens A, B, C (for example). Other ERC-20 tokens cannot be used to buy wNFT with Collateral. Only the owner of the lunchpad contract sets the price per unit of ERC-20 token sold in the native token or ERC-20 tokens A, B,C.

When selling wNFT, the contract analyses how much ERC-20 token being sold is in Collateral, multiplies it by the price in native token or ERC-20 tokens A,B,C - depending on which token the buyer chooses to pay for the purchase. This calculates the price to sell wNFT with some amount of ERC-20 token to be sold.

The main feature of the contract is that it can only sell one kind of ERC-20 token in this way. To sell another ERC-20 token, the contract must be re-deployed. Because when the contract is deployed, it is specified which ERC-20 token is being sold by the contract. And another ERC-20 token cannot be added to the contract settings for sale. When a contract is deployed into the network, the start date of the sale is fixed. It is not possible to buy wNFT with ERC-20 tokens in the collateral before this date.

Method claimNFT

The method allows the purchase of wNFT with collateral in the form of ERC-20 tokens sold. The method verifies that:

  • Sale launch has taken place

  • The token that the buyer wants to pay with is allowed for payment - the price in the token is set

  • If the user will pay with ERC-20 tokens, the user must not send the contract to the network's native tokens

  • If the user will pay with native network tokens, the balance of the native tokens must be greater than or equal to the price of wNFT. If an attempt is made to pay for wNFT more than the price, the user will be refunded change.

  • There is the allowance to use ERC-20 token for the purchase granted for the Launchpad contract

Once purchased, the buyer of wNFT with ERC-20 tokens for sale becomes the owner. If the method is passed a null address in the payWith parameter, the method will assume that the purchase will be made in native network tokens.

Parameters:

Name
Type
Description

tokenId

uint256

Token id of the wNFT to be purchased

payWith

address

Address of the ERC-20 contract of the tokens the buyer wishes to use to pay for the purchase

Method getWNFTPrice

The method calculates the price of wNFT with ERC-20 tokens being sold for the tokens the buyer wishes to settle with. The price is calculated relative to the number of ERC-20 tokens contained in the wNFT collateral.

Parameters:

Name
Type
Description

tokenId

uint256

Token id of the wNFT to be purchased

payWith

address

Address of the ERC-20 contract of the tokens the buyer wishes to use to pay for the purchase

Returns values:

Name
Type
Description

payAmount

uint256

Price wNFT in contract tokens at payWith

Method withdrawEther

The method transfers all native tokens from launchpad to msg.sender that there are on launchpad balance. Only the owner of the launchpad smart contract can call this method. The method does not have input parameters and output value.

Method withdrawTokens

The method transfers all ERC-20 tokens from launchpad to msg.sender that there are on launchpad balance. The caller defines what tokens it needs withdraw. Only the owner of the launchpad smart contract can call this method. The method does not have output value.

Parameters:

Name
Type
Description

_erc20

address

The address of ERC-20 tokens smart contract that it needs withdraw

Method setPrice

The method sets price per unit of ERC-20 token being sold. Msg.sender defines by which tokens and how mutch buyer has to pay. Only the owner of the launchpad smart contract can call this method. The method does not have output value.

Parameters:

Name
Type
Description

_erc20

address

The smart contract address of ERC-20 token by that buyers will be able pay your purchases

_amount

uint256

The amount of ERC-20 tokens that buyers have to pay per unit ERC-20 token being sold

_decimals

uint256

The decimals places of the token

Method setEnableAfterDate

The method sets the start date of the sale. Only the owner of the launchpad smart contract can call this method. The method does not have output value.

Parameters:

Name
Type
Description

_enableAfter

uint256

The start date of the sale