tzKlar boilerplate (Tezos FA2 NFT)
How to use it
First of all. This is a template so you are encouraged to change everything however you like.
First you need to fork it or just click "Use this template" on GitHub to create your own repo based on this one.
Most likely you will need IPFS Desktop installed to freely access files on
./.env.example file into
.env and fill it with Pinata credentials. Example file is already set up with credentials for sandbox so initially you don't have to change anything else there. But if you would like to deploy your contracts to some other network just change rpc, signers and network name.
Install all the packages
Starting and stopping sandbox
yarn tzklar start-sandbox yarn tzklar stop-sandbox
Check your tezos credentials and current network
This is basically checking what you have currently in your
yarn tzklar check-tezos-config
It will take your ReasonLIGO contract and compile it to Michelson (.tz and .json). Example FA2 contract is located in
yarn tzklar compile-contract
Compile off-chain views
To be compliant with TZIP-12 and TZIP-16 we need Michelson code for our off-chain views. Since writing Michelson code is not an easy task we're compiling some specific functions from main religo contract. Later this compiled views will be used to populate contract metadata JSON.
yarn tzklar compile-off-chain-views
Generate contract metadata
yarn tzklar generate-contract-metadata
Pin contract metadata JSON to IPFS
yarn tzklar pin-contract-metadata
Pin our NFT image to IPFS
yarn tzklar pin-token-0-asset
Generate token metadata
This repo shows an example token of id "0".
yarn tzklar generate-token-0-metadata
Pin token metadata JSON to IPFS
yarn tzklar pin-token-0-metadata
Finally, originate contract on Tezos
yarn tzklar originate-contract
Here's an example script that will mint token 0 for a given account. This example contract allows you to mint the same token many times but feel free to change the contract however you like.
yarn tzklar mint 0 tz1VSUr8wwNhLAzempoch5d6hLRiTh8Cjcjb
You can write and check tests of your contract