This guide provides step-by-step instructions for deploying Non-Fungible Tokens (NFTs) through zkSync with Hardhat using the zkLink Nova SBT NFT project.
Ensure the following prerequisites are met:
- Node.js
- npm (Node Package Manager)
Follow these installation steps:
- Clone the repository to your local machine:
git clone git@github.com:zkLinkProtocol/zklink-nova-links-sbt-trademarks.git
- Navigate to the project directory:
cd zklink-nova-links-sbt-trademarks
- Install dependencies:
npm install --force
- Create an
.env
file by copying.env.example
:
cp .env.example .env
- Compile all Smart contracts
npm run compile
Before deployment, configure the .env
file:
- Obtain the wallet private key from Metamask and insert it into
WALLET_PRIVATE_KEY
andWITNESS_SINGER_PRIVATE_KEY
in the.env
file.
- 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!
- Paste the Smart Contract Address (
0x047190965337D85c304E72DaEEFFE48aCC1FD47c
) intoNOVA_NFT_CONTRACT_ADDRESS
in the.env
file.
- Execute
npm run deploy:trademark
. - Paste the Smart Contract Address into
TRADEMARK_CONTRACT_ADDRESS
in the.env
file.
- Execute
npm run deploy:full_nova_nft
- Paste the Smart Contract Address into
FULL_NOVA_NFT_CONTRACT_ADDRESS
in the.env
file.
- Execute
npm run deploy:box
. - Paste the Smart Contract Address into
BOX_CONTRACT_ADDRESS
in the.env
file.
- Execute
npm run deploy:booster
- Paste the Smart Contract Address into
BOOSTER_CONTRACT_ADDRESS
in the.env
file.
Use the following scripts for interactions:
- Run
npm run interact
to receive one Nova SBT NFT to your wallet. - Execute
npm run interact:trademark
to mint 4 trademarks to your wallet. - Run
npm run interact:full
to burn SBT and 4 trademarks to obtain the Full Version NFT.
- Execute
npm run interact:box
to mint 12 mystery boxes to your wallet. - Run
npm run interact:booster
to burn Box to obtain the Booster NFT.
- Get the Goerli Testnet ETH
- Run
npx hardhat test
to deploy the script and run all test cases