đź“‚
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
  • WrapAndDistrib721WithMint method
  • WrapAndDistribEmpty method
  1. Technical documentation
  2. Smart-contracts
  3. Protocol
  4. V0
  5. Contracts

WrapperDistributor721.sol

PreviousWrapperWithERC20Collateral (V.0)NextWrapperFarming.sol

Last updated 3 years ago

This contract inherits all methods of the WrapperWithERC20Collateral contract, the methods of which can be found . The WrapperDistributor721 contract is a separate implementation that extends the functionality of the Protocol. It is designed to perform bulk wrapping of NFTs and creation of wrappers without depositing the original NFT.

WrapAndDistrib721WithMint method

Not any address can call the method. Only the one that the contract owner has assigned the distributor role to. The method checks that the number of recipients equals the number of token id of the original NFT. If all checks are met, method:

  • Transfers ERC-20 tokens to the WrapperDistributor721 contract address for each "address and number of ERC-20 tokens" pair specified in the provisioning array, the aggregate amount of these tokens. These tokens will be deposited into all the wrapped NFTs being created. The aggregate volume to transfer ERC-20 tokens is defined as the number of tokens from the "pair" multiplied by the number of recipients of the wrapped NFTs. It is mandatory that the contracts of the ERC-20 tokens deposited as collateral for the wrapped nfts must have permission for WrapperDistributor721 to use the tokens.

  • Mint on the contract of the original nft tokens according to the transferred array with the token id. The recipient of the original NFT data will be the contact WrapperDistributor721. Obligatorily the contract address WrapperDistributor721 must be assigned the mint role for the original NFT contract. Mandatory the mint method of the original nft contract must have two input parameters - the NFT recipient address and the token id with which the original NFT is to be issued.

  • Mint wrapped nft ERC-721 to each address in the recipient array

  • for each wrapped NFT the unlock date is fixed, passed to the method (in unixtime format) - the date from which the wrapped nft can be unlocked.

  • If native network tokens are transferred to the contract when the method is called, Collateral in native tokens is recorded for each wrapped NFT. The volume of Collateral in native tokens for this fixation is calculated as the volume of native tokens sent to the contract divided by the number of recipients of wrapped NFTs.

The method results in the user is creating the mass-wrapped ERC-721 nfts with the provisioning in native and/or ERC-20 tokens and minting of the original ERC-721 nfts. The method also checks that if there is not enough gas to complete the transaction, an event will be created to capture how many wrapped nfts were created - to retry and create the remaining wrapped NFTs (wNFTs).

Parameters:

Name
Type
Description

_original721

address

Contract address of the original NFT ERC-721

_receivers

address[]

An array of recipient addresses which will get the wrapped NFTs (wNFT)

_tokenIds

uint256[]

Array of token id of original NFTs

_forDistrib

ERC20Collateral[]

An array of Collateral with pairs of "ERC-20 token contract address and number of tokens" to be deposited as Collateral for each wrapped NFT (wNFT)

_unwrapAfter

uint256

Date of the unlocking wrapped NFT (wNFT)

WrapAndDistribEmpty method

Not any address can call the method. Only the one to which the contract owner has assigned the distributor role. The method checks that the number of recipients is not greater than 256.

If all checks are met, the method:

  • Transfers ERC-20 tokens to the WrapperDistributor721 contract address for each "address and number of ERC-20 tokens" pair specified in the provisioning array, the aggregate amount of these tokens. These tokens will be deposited into all the wrapped NFTs being created. The aggregate volume to transfer ERC-20 tokens is defined as the number of tokens from the "pair" multiplied by the number of recipients of the wrapped NFTs. It is mandatory that the contracts of the ERC-20 tokens deposited to secure the wrapped nfts must have permission for WrapperDistributor721 to use the tokens.

  • Mints a wrapped nft ERC-721 to each address in the recipient array (a blank envelope in which the collateral will be stored)

  • for each wrapped nft the unlock date is given to the method is recorded (in unixtime format) - the date from which the wrapped nft can be unlocked.

  • If native tokens are transferred to the contract when the method is called, Collateral in native tokens is recorded for each wrapped NFT. The volume of Collateral in native tokens for this fixation is calculated as the volume of native tokens sent to the contract divided by the number of recipients of wrapped NFTs.

The method results in the user is creating the mass-wrapped ERC-721 NFTs (without creating and wrapping the original ERC-721 NFTs) with the provisioning in native and/or ERC-20 tokens. The method also checks that if there is not enough gas to complete the transaction, an event will be created to capture how many wrapped NFTs were created - to retry and create the remaining wrapped NFTs.

Parameters:

Name
Type
Description

_receivers

address[]

An array of recipient addresses wrapped NFTs

_forDistrib

ERC20Collateral[]

An array of collateral with pairs of "ERC-20 token contract address and number of tokens" to be deposited as collateral for each wrapped NFT (wNFT)

_unwrapAfter

uint256

Date of the unlocking wrapped NFT (wNFT)

here