CRUZZER NFTs is a PoC NFT marketplace smart contract and decentralised application that allow users to perform the following:
- Mint Custom NFTs
- Put up Minted NFTs for sale
- Buy NFTs from other users of the application
-
NFTDetails
A struct for holding associated details of a particular NFT
struct NFTDetails {
address payable owner;
bool forSale;
uint price;
uint tokenId;
string name;
string desc;
string tokenURI;
}
-
minted
An array of NFTDetails objects
NFTDetails[] minted
-
mintToken
-
functionality: Mints a new NFT and transfers it to the address of the user
-
params: name, desc and _tokenURI
-
returns: NFTDetails
-
-
makeNFTSellable
- functionality: makes an NFT sellable buy transfering ownership to the contract's address
- params: tokenId and price
- returns: NFTDetails
-
makeNFTNonSellable
- functionality: makes an NFT non-sellable buy transfering ownership from the contract's address back to the user who created it.
- params: tokenId
- returns: NFTDetails
-
buyNFT
- functionality: buys an NFT from the marketplace buy transferring its ownership to the caller and transferring CELO (the attached price) to the address of the NFT creator.
- params: tokenId
-
getNFTs
- functionality: get all the minted NFTs
- returns: NFTDetails[] (an array of NFTDetails objects)
- Installation: run
pnpm i
in thenft
directory to install required dependencies - Compilation: run
pnpm exec hardhat compile
- Testing: run
pnpm exec hardhat test
- Deployment: run
pnpm exec hardhat run ignition/module/Cruzzer.ts
for local deployment andpnpm exec hardhat run --network alfajores ignition/module/Cruzzer.ts
for deployment on Celo's Alfajores' testnet.
The user interface has been developed with a JavaScript framework, Next.js v14 and helper libraries mainly
- RainbowKit and TransactQuery for wallet connections
- Wagmi for contract interaction (send read and write transactions)
- Viem for utilities and interfaces (parsing and formatting ether, etc)
- Home: Provides a welcome screen and overview of the DApp
- Minter: Provides a form for minting NFTs
- Bazaar: Provides a marketplace for viewing, buying and setting minted NFTs as "for sale" or "not for sale"
- Installation: run
pnpm i
in thedapp
directory to install required dependencies - Local deployment: run
pnpm dev
to use the DApp in the development. - Production deployment: run
pnpm build
and follow the instructions for your preferred hosting platform to host the DApp and use it in live mode.