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
  • UserCollectionPRegistry.sol
  • Method deployNewCollection
  • Method getSupportedImplementation
  • Method getUsersCollections
  • Method isImplementationSupported
  • Method checkUserSubscription
  • UsersCollectionFactory
  • Method deployProxyFor
  • UserCollectionProxy
  • PublicUsersCollection721BehindProxy
  • PublicUsersCollection1155BehindProxy

Was this helpful?

  1. Technical documentation
  2. Smart-contracts

Factory (smart-contracts) minting

PreviousSubscription serviceNextP2P NFT/wNFT trading service

Last updated 1 year ago

Was this helpful?

Smart-сontract Architecture dAPP Factory for creating customized NFT-collection contracts:

  • UserCollectionPRegistry is the contract accessed by users to deploy a customized NFT collection proxy contract of ERC-721 or ERC-1155 tokens to themselves on the blockchain.

  • UserCollectionPRegistry checks the relevance/validity of the subscription and call the UsersCollectionFactory contract to deploy the collection proxy-contract to the user (the user will be the owner of the proxy-contract).

  • UsersCollectionFactory smart-contract deploys the UserCollectionProxy contract on the blockchain for a collection of ERC-721 or ERC-1155 (NFTs) for the user.

  • UserCollectionProxy smart-contract is a proxy contract that calls the methods of logical contracts, but stores changes to the proxy contract's state variables. dApp can create two types of proxy contracts: proxy-contracts for the PublicUsersCollection721BehindProxy logical contract and PublicUsersCollection1155BehindProxy.

  • PublicUsersCollection721BehindProxy smart-contract is a logical smart-contract (implementation) of ERC-721 tokens whose methods proxy contracts use.

  • PublicUsersCollection1155BehindProxy smart-contract is a logical smart-contract (implementation) of ERC-1155 tokens whose methods proxy contracts use.

The dApp architecture for proxy contracts is based on EIP-1967, which you can read more about here: .

Proxy contracts do not have the ability to change the logical smart-contract and use methods of new logical smart-contract. Only the owner of a proxy-contract can call "mint NFT" method of it.

UserCollectionPRegistry.sol

Method deployNewCollection

function deployNewCollection(
        address _implAddress, 
        address _creator,
        string memory name_,
        string memory symbol_,
        string memory _baseurl
    ) external

The method calls the UsersCollectionFactory contract to deploy the UserCollectionProxy proxy-contract in the blockchain. Only a user with a valid subscription can call the method. It is purchased from agents selling subscriptions to the services of this dApp.

Input parameters of the method for calling:

Name
Type
Description

_implAddress

address

Address of the logical smart-contract

_creator

address

The address that will own the proxy-contract

name_

string

Name of NFT-collection

symbol_

string

Abbreviation of the NFT -collection, e.g.: ELEM

_baseurl

string

Part of the metadata reference for NFT that do not have personal metadata

The method emits an Initialized event specifying the address of the proxy-contract deployed in the blockchain.

Method getSupportedImplementation

function getSupportedImplementation() external view returns(Asset[] memory) 

The method returns an array of data about logical smart-contracts for which proxy-contracts can be deployed on the blockchain.

The method returns values:

Name
Type
Description

supportedImplementations

Asset[]

Array of data about logical-smart contracts for which proxy-contracts can be deployed on the blockchain

Asset:

Name
Type
Description

assetType

AssetType

Value from the token type data dictionary

contractAddress

address

Address of the logical smart-contract

AssetType:

  • 3 - ERC-721

  • 4 - ERC-1155

Method getUsersCollections

function getUsersCollections(address _user) external view returns(Asset[] memory)

The method returns an array of data about the proxy-contracts that belong to the user.

Input parameters of the method for calling:

Name
Type
Description

_user

address

The address of the user for whom the array of proxy contracts deployed in the blockchain is being requested

The method returns values:

Name
Type
Description

assets

Asset[]

Array of data about proxy-contracts owned by the user. The description of the data type is given above.

Method isImplementationSupported

function isImplementationSupported(address _impl) public view  returns(bool isSupported, uint256 index)

The method returns the result of checking whether a smart contract is included in the list of available logical smart-contracts for which a proxy contract can be deployed.

Input parameters of the method for calling:

Name
Type
Description

_impl

address

Address of the logical smart-contract for which the check is performed

The method returns values:

Name
Type
Description

isSupported

bool

Boolean value. Flag whether it is possible to deploy a proxy-contract on the blockchain for a logical smart-contract.

index

uint256

Order number from the array of available logical smart-contracts for which a proxy-contract can be deployed on the blockchain.

Method checkUserSubscription

function checkUserSubscription(address _user) 
            external 
            view 
            returns (bool ok, bool needFix)

The method checks the activity of a subscription purchased by the user, which allows the user to deploy a proxy-contract in the blockchain.

Input parameters of the method for calling:

Name
Type
Description

_user

address

The address of the user for whom the subscription activity is being checked.

The method returns values:

Name
Type
Description

ok

bool

Boolean value. True - the subscription is still valid, active. False - subscription is not valid, inactive.

needFix

bool

Boolean value. True - for subscriptions at the tariff (rate) with the volume of use of provider's services (an indication that the volume available to the user should be reduced each time the subscription is used). False - always for tariff (rate) subscriptions with validity period.

UsersCollectionFactory

Method deployProxyFor

function deployProxyFor(
        address _implAddress, 
        address _creator,
        string memory name_,
        string memory symbol_,
        string memory _baseurl
    ) public returns(address proxy) 

The method deploys the UserCollectionProxy contract in the blockchain for the user. Only a "trusted" user can call the method.

Input parameters of the method for calling:

Name
Type
Description

_implAddress

address

Address of the logical smart-contract.

_creator

address

The address that will own the proxy-contract.

name_

string

Name of the NFT-collection.

symbol_

string

Abbreviation of the NFT-collection, e.g.: ELEM.

_baseurl

string

Part of the metadata reference for NFTs that do not have personal metadata

The method returns values:

Name
Type
Description

proxy

address

Address of the proxy-contract deployed in the blockchain.

UserCollectionProxy

The contract has no public methods. The contract "constructor" method emits an Upgraded event specifying: address of the proxy-contract deployed in the blockchain.

PublicUsersCollection721BehindProxy

PublicUsersCollection1155BehindProxy

A detailed description of the method operation is given in the documentation describing the operation of the subscription service, which can be found here: .

The contract inherits the ERC721EnumerableUpgradeable contract from the OpenZeppelin library. A description of the contract can be found here: .

The contract inherits the ERC1155URIStorageUpgradeable contract from the OpenZeppelin library. A description of the contract can be found here: .

https://eips.ethereum.org/EIPS/eip-1967
https://docs.envelop.is/tech/smart-contracts/subscription-service#method-_checkusersubscription
https://docs.openzeppelin.com/contracts/4.x/api/token/erc721#ERC721Enumerable
https://docs.openzeppelin.com/contracts/4.x/api/token/erc1155#ERC1155URIStorage