Skip to content

Exemple of a NFT Factory contract in CameLIGO

License

Notifications You must be signed in to change notification settings

tezosmiami/NFT-factory-cameligo

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Contract VIN (Vinus In Numeris)

This contract implements a factory of FA2 NFT. Each FA2 contract represents a collection of wine bottles. Wine bottles are represented by tokens inside a FA2 contract. When originating a collection of bottle,

  • the creator must specify a collection name and a QR code for each bottle.
  • the creator owns all bottles of the collection

The creator of the collection can also add new bottles to his collection anytime (with the Mint entrypoint)

A bottle owner can transfer one or more bottle to someone else (with the Transfer entrypoint)

A collection of bottles is represented by a FA2 contract. The implementation of the FA2 introduces:

  • a admin address on the storage which represents the creator of the FA2 contract
  • a Mint entrypoint that allows the creator of the FA2 to create new tokens inside the NFT contract
  • a token_usage map that count the number of transfer of a bottle
  • a token_usage view for retrieving the number of transfer of a bottle (for a given token_id)

An extra Marketplace smart contract has been provided to illustrate how to make a secondary market on these Nft. The Marketplace contract allows Nft owners to sell their wine bottles on a secondary market. The Marketplace contract allows users to accept a sell proposal. The Marketplace smart contract is not meant for production purpose.

Compilation

A makefile is provided to compile the "Factory" smart contract, and to launch tests.

cd src/cameligo/
make compile
make test

Tests

A makefile is provided to launch tests.

cd src/cameligo/
make test

Deployment

A typescript script for deployment is provided to originate the smart contrat. This deployment script relies on .env file which provides the RPC node url and the deployer public and private key.

cd src/cameligo
make deploy

About

Exemple of a NFT Factory contract in CameLIGO

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • LigoLANG 91.1%
  • Makefile 5.3%
  • TypeScript 3.2%
  • Shell 0.4%