Exemple of a NFT Factory contract in JsLIGO Resources
ligo init contract --template NFT-factory-jsligo [PROJECT_NAME]
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)
You need to install the following tools:
How to use this template ?
A makefile is provided to compile the "Factory" smart contract.
You can also override
make parameters by running :
make compile ligo_compiler=<LIGO_EXECUTABLE> protocol_opt="--protocol <PROTOCOL>"
A makefile is provided to launch tests.
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.
So make sure to rename
deploy/.env and fill the required variables.
|-||(name: string, list nat)|
|tokenMetas||big_map (big_map (nat, (token_id: nat, map (string, bytes))))|