zkLink Nova SBT NFT 2024

This guide provides step-by-step instructions for deploying Non-Fungible Tokens (NFTs) through zkSync with Hardhat using the zkLink Nova SBT NFT project.

Prerequisites

Ensure the following prerequisites are met:

  • Node.js
  • npm (Node Package Manager)

Installation

Follow these installation steps:

  1. Clone the repository to your local machine:
git clone git@github.com:zkLinkProtocol/zklink-nova-links-sbt-trademarks.git
  1. Navigate to the project directory:
cd zklink-nova-links-sbt-trademarks
  1. Install dependencies:
npm install --force
  1. Create an .env file by copying .env.example:
cp .env.example .env
  1. Compile all Smart contracts
npm run compile

Deployment

Configuration

Before deployment, configure the .env file:

  • Obtain the wallet private key from Metamask and insert it into WALLET_PRIVATE_KEY and WITNESS_SINGER_PRIVATE_KEY in the .env file.

Deployments

Deploy Nova SBT NFT

  1. Run npm run deploy.
npm run deploy

> deploy
> npx hardhat deploy-zksync --script nft/deploy.ts

Starting deployment process of "NovaNFT"...
rpcUrl https://goerli.rpc.zklink.io
Estimated deployment cost: 0.00001036124 ETH
Balance of Wallet: 91659544900000000

"NovaNFT" was successfully deployed:
 - Contract address: 0x047190965337D85c304E72DaEEFFE48aCC1FD47c
 - Contract source: contracts/nft/NovaNFT.sol:NovaNFT
 - Encoded constructor arguments: 0x0000000000000000000000008f9fac43a6740eba56b89d146841c5ed2d3665dd

Requesting contract verification...
Your verification ID is: 101
Contract successfully verified on zkSync block explorer!
  1. Paste the Smart Contract Address (0x047190965337D85c304E72DaEEFFE48aCC1FD47c) into NOVA_NFT_CONTRACT_ADDRESS in the .env file.

Deploy Trademark NFT

  1. Execute npm run deploy:trademark.
  2. Paste the Smart Contract Address into TRADEMARK_CONTRACT_ADDRESS in the .env file.

Deploy Nova Lynk NFT

  1. Execute npm run deploy:full_nova_nft
  2. Paste the Smart Contract Address into FULL_NOVA_NFT_CONTRACT_ADDRESS in the .env file.

Deploy Mystery Box NFT

  1. Execute npm run deploy:box.
  2. Paste the Smart Contract Address into BOX_CONTRACT_ADDRESS in the .env file.

Deploy Booster NFT

  1. Execute npm run deploy:booster
  2. Paste the Smart Contract Address into BOOSTER_CONTRACT_ADDRESS in the .env file.

Interaction Scripts

Use the following scripts for interactions:

SBT

  1. Run npm run interact to receive one Nova SBT NFT to your wallet.
  2. Execute npm run interact:trademark to mint 4 trademarks to your wallet.
  3. Run npm run interact:full to burn SBT and 4 trademarks to obtain the Full Version NFT.

Booster

  1. Execute npm run interact:box to mint 12 mystery boxes to your wallet.
  2. Run npm run interact:booster to burn Box to obtain the Booster NFT.

Testing

  1. Get the Goerli Testnet ETH
  2. Run npx hardhat test to deploy the script and run all test cases