- NFT smart-contract: https://testnet.cronoscan.com/address/0x8208Bb3a2e25310BAd343fD80968F061F23a707B#code
- Marketplace smart-contract: https://testnet.cronoscan.com/address/0xd5A32E3fb8cBeacbd10E51172067A5AEf02Ef5D6#code
This backend has been built with the game Planet-Giant for the Cronos & Moralis Hackathon - August-September 2022.
The entire project is divided in 3 parts. Here are the links to all the different github repos:
- Unity Game: https://github.com/shamrockstudios/Planet-Giant_Game
- React Webapp: https://github.com/shamrockstudios/Planet-Giant_Webapp
- Backend contracts: https://github.com/shamrockstudios/Planet-Giant_Contracts
This backend cover 2 parts:
- Batch mint: node.js code to allow the NFT's images and attributes to be generated and stored on IPFS.
- Smart-contracts: NFTs and Marketplace smart-contract to mint NFTs and sell/buy them on the dedicated marketplace.
- node.js installed (developped on LTS v16.16.0)
- typescript installed (developped on v4.7.4)
- yarn installed
- MetaMask (or any web3 compatible wallet) installed in your browser
Once your config is ready, create a new repo, open your favorite code editor, and clone the repo with the following cmd:
git clone https://github.com/shamrockstudios/Planet-Giant_Contracts.git .
yarn install
- Navigate in:
cd src
- Then edit the file
image.js
to match your content, then run:
node image.js
- Finally edit the file
metadata.js
(don't forget to edit the IPFS image path with the newly generated one), and run:
node matadata.js
Go back to the root folder by typing:
cd ..
Now you'll have to edit a few file:
- The deployment script in
scripts\deploy.ts
with your data (or even better create a .env file); - The NFT_minter contract in
contract\NFT_minter.sol
with your own IPFS path; - The
hardhat.config.ts
file depending on which network you want to deploy your NFT collection. Once you're ready, simply run:
yarn deploy
And let the magic do its thing!