LogoLogo
  • 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
LogoLogo

Links:

  • envelop.is
  • daoenvelop.eth

dApps:

  • app.envelop.is
  • crossing

Soc. nets:

  • blog
  • youtube
On this page
  • TrustedWrapperV2
  • Method wrap
  • Method transferIn
  • BatchWorker
  • Method wrapBatch
  • Method addCollateralBatch

Was this helpful?

  1. Technical documentation
  2. Smart-contracts
  3. Protocol
  4. V1
  5. Contracts

Saft

PreviousEnvelopwNFT1155NextSBT smart-contract Factory

Last updated 7 months ago

Was this helpful?

TrustedWrapperV2

This smart contract is special implementation of WrapperBaseV1. It has more gas cheap method to wrap NFTs that the users can use for wrap. This implementation does not have the blacklist of the collateral tokens and allows to create wNFTs with any ERC20, ERC721, ERC1155 tokens in the collateral.

Method wrap

The method allows to create the wNFTs ERC721 or ERC1155 and save the information about wNFT and his collateral. Only trusted addresses can call this method. The owner of the smart contract can add the trusted addresses in a list.

The method creates a WrappedV1 event specifying:

  • the contract address of the original NFT;

  • wNFT contract address;

  • id of the original NFT;

  • wNFT id;

  • recipient wNFT;

  • the number of native tokens that have been transferred as collateral for wNFT;

  • description of wNFT rules.

The method creates a CollateralAdded event for every collateral record specifying:

  • wNFT contract address;

  • wNFT id;

  • collateral contract address;

  • collateral tokenId (for NFT ERC721 and ERC1155 added in a collateral);

  • number of NFT copies (for NFT ERC-1155 - balance, for ERC20 tokens - the amount of the tokens, for NFT ERC721 - zero; added in a collateral).

The method returns a value with the following data structure:

  • wNFT contract address

  • wNFT id

  • number of copies - wNFT balance (for ERC-1155 - value other than zero, for ERC-721 - 0)

Input parameters of the method:

Name
Type
Description

_inData

ETypes.INData

_collateral

ETypes.AssetItem[]

_wrappFor

address

Address for which wNFT is created

Method transferIn

This method transfers the assets (ether, ERC20, ERC721, ERC1155 tokens) to TrustedWrapperV2 smart contract address. Only trusted addresses can call this method.

Only the owner of the assets or a spender can transfer the assets by this method. To do so, the asset owner FT must set allowance for the TrustedWrapperV2 contract to use it.

The method returns a value with the following data structure:

  • the amount of the asset that was transferred.

Input parameters of the method:

Name
Type
Description

_assetItem

ETypes.AssetItem

_from

address

Address who assets will be transferred to TrustedWrapperV2 address

BatchWorker

This smart contract allows to wrap wNFTs batch or add a collateral in wNFTs batch per one transaction.

Method wrapBatch

The method allows to create the wNFTs ERC721 or ERC1155 batch and add a collateral at the same time per one transaction. The users can use any collateral tokens (ERC20, native), there are not any restriction for the adding tokens.

For the adding native tokens in the collateral the users must have the record about it in collateral array passed the method. The users must set in this record the amount of native tokens for one wNFT. The method is payable. The smart contract checks the amount of attached to the transaction of the native tokens is enougth for the adding according to the collateral array record. The attached to the transaction msg.value of the native tokens is divided equally between all creating wNFTs. Don't forget add the record about native tokens with the amount for one wNFT in the collateral array .

The users must set the allowance for TrustedWrapperV2 smart contract address to use their ERC20 tokens if they want to add it in the collateral of wNFTs. For ERC20 tokens the amount for the allowance calculates like the wNFT count multiplaying to the amount from the collateral array record of this ERC20 token passed to the method. The users must set the amount of the tokens in the collateral array record necessarily which they want to add in one wNFT.

For the wrapping ERC721 or ERC1155 tokens the users must set the allowance for TrustedWrapperV2 smart contract address to use them also.

The method creates a WrappedV1 event for every creating wNFT specifying:

  • the contract address of the original NFT;

  • wNFT contract address;

  • id of the original NFT;

  • wNFT id;

  • recipient wNFT;

  • the number of native tokens that have been transferred as collateral for wNFT;

  • description of wNFT rules.

The method creates a CollateralAdded event for every collateral record and for every creating wNFT specifying:

  • wNFT contract address;

  • wNFT id;

  • collateral contract address;

  • collateral tokenId (for NFT ERC721 and ERC1155 added in a collateral);

  • number of NFT copies (for NFT ERC-1155 - balance, for ERC20 tokens - the amount of the tokens, for NFT ERC721 - zero; added in a collateral).

Input parameters of the method:

Name
Type
Description

_inDataS

ETypes.INData[]

_collateralERC20

ETypes.AssetItem[]

_receivers

address[]

Address for which wNFT is created - as an array.

Method addCollateralBatch

This method gives the opportunity to add ERC20 or the native tokens in the collateral of wNFT tokens batch per one transaction. The users can add only tokens added in the whitelist in the collateral. Only the owner of TrustedWrapperV2 smart contract has the permitions to add the tokens in the whitelist.

The method is payable. For the adding native tokens in the collateral the users must attach the ether amount to a transaction. This amount will be divided equally between all wNFT tokens who token ids are passed to the method.

The users must set the allowance for BatchWorker smart contract address to use their ERC20 tokens if they want to add them in the collateral of wNFTs. For ERC20 tokens the amount for the allowance calculates like the wNFT count multiplaying to the amount from the collateral array record of this ERC20 token passed to the method. The users must set the amount of the tokens in the collateral array record necessarily which they want to add in one wNFT.

The method creates a CollateralAdded event for every collateral record and for every wNFT specifying:

  • wNFT contract address;

  • wNFT id;

  • collateral contract address;

  • collateral tokenId (for NFT ERC721 and ERC1155 added in a collateral);

  • number of NFT copies (for NFT ERC-1155 - balance, for ERC20 tokens - the amount of the tokens, for NFT ERC721 - zero; added in a collateral).

Input parameters of the method:

Name
Type
Description

_wNFTAddress

address[]

Array of the smart contract addresses of wNFT tokens which were wrapped by BatchWorker.

_wNFTTokenId

uint256[]

Array of ids of wNFT tokens which were wrapped by BatchWorker.

_collateralERC20

ETypes.AssetItem[]

TrustedWrapperV2 contract inherits WrapperBaseV1 contract and all description how WrapperBaseV1 contract methods works can be found .

collateral asset type (from enum );

type of wNFT to be created (3 - ERC-721, 4 - ERC-1155, from )

The data types are described in contact LibEnvelopTypes.sol, .

Data for creating wNFT. The description of the data type is .

Transferable collateral data for wNFT - as an array. The description of the data type is .

Transferable asset data. The description of the data type is .

collateral asset type (from enum );

Data for creating wNFT - as an array. The description of the data type is .

The asset data adding in the collateral for every wNFT- as an array. The description of the data type is .

collateral asset type (from enum );

The asset data adding in the collateral for every wNFT- as an array. The description of the data type is .

here
ETypes.AssetType
ETypes.AssetType
ETypes library
ETypes.AssetType
ETypes.AssetType
here
here
here
here
here
here