Week1 - Road to Web3

https://university.alchemy.com/

  • Who are you, and what is your software development background?

    My name is Yong and I recently pivot into software development coming from an accounting background. I’ve self-studied for several months now using many free resources available online and was lucky to discover Alchemy University through Chainshot.

  • Why did you want to complete this lesson?

    To better understand how exactly are NFTs created. The step by step walkthrough including the max limitations of total NFT and max per wallet on the smart contract was something new for me. Diving in into the metadata show me possibilities of bridging the unique characteristics of NFT with the real world.

  • When did you complete the project?

    I completed the project on November 4th, 2022.

  • What technologies did you use?

    To complete the project I used OpenZeppelin, Remix, Filebase, and an online JSON editor.

  • What did you enjoy about the tutorial?

    Introducing all the available technologies out there that simplified the overall process of minting NFTs. Providing a video as well as a written tutorial really help with solidifying the topic and made me better understand the overall objective.

  • How do you think you can use this technology to build useful applications in the future? What are some specific example applications?

    One useful applications that came to mind is minting of a NFT with every real world item purchase. An example would be a luxury handbag, where a NFT is minted when the first owner purchased the item. The owner can use the NFT on social media as Clout or can sell the NFT in the open market as they wish. Another use case could be that the NFT is an actual item in the virtual metaverse and the owner can equip the same handbag on their avatar virtually.

  • Who would you recommend this project to?

    I would recommend this project to anyone interested in learning more about Web3 and NFTs.

  • What is the Ethereum wallet address you would like to receive your PoK at?

    0xE3247b11dE61f544485F909eA597C1d035B560b9

  • Below are Links:

    - Contract Address / etherscan link

    https://goerli.etherscan.io/address/0xa31b318e30cf63a0c5d9856238642a468c7cb412

    - OpenSea/Rarible/other NFT link

    https://testnets.opensea.io/collection/baobaomi

    - a screenshot of your deployed NFT (e.g. in OpenSea)

post image

- Contract Code:

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;

import "@openzeppelin/contracts@4.7.3/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts@4.7.3/token/ERC721/extensions/ERC721Enumerable.sol";
import "@openzeppelin/contracts@4.7.3/token/ERC721/extensions/ERC721URIStorage.sol";
import "@openzeppelin/contracts@4.7.3/utils/Counters.sol";

contract BaoBaoMi is ERC721, ERC721Enumerable, ERC721URIStorage {
    using Counters for Counters.Counter;

    Counters.Counter private _tokenIdCounter;
    uint256 MAX_SUPPLY = 10000;
    uint256 MAX_PER_WALLET = 5;

    constructor() ERC721("BaoBaoMi", "BBM") {}

    function safeMint(address to, string memory uri) public {
        uint256 tokenId = _tokenIdCounter.current();
        require(tokenId < MAX_SUPPLY, "I'm sorry all NFTs have been minted.");
        require(balanceOf(to) < MAX_PER_WALLET, "You have reached the maximum number of NFTs per wallet.");
        _tokenIdCounter.increment();
        _safeMint(to, tokenId);
        _setTokenURI(tokenId, uri);
    }

    // The following functions are overrides required by Solidity.

    function _beforeTokenTransfer(address from, address to, uint256 tokenId)
        internal
        override(ERC721, ERC721Enumerable)
    {
        super._beforeTokenTransfer(from, to, tokenId);
    }

    function _burn(uint256 tokenId) internal override(ERC721, ERC721URIStorage) {
        super._burn(tokenId);
    }

    function tokenURI(uint256 tokenId)
        public
        view
        override(ERC721, ERC721URIStorage)
        returns (string memory)
    {
        return super.tokenURI(tokenId);
    }

    function supportsInterface(bytes4 interfaceId)
        public
        view
        override(ERC721, ERC721Enumerable)
        returns (bool)
    {
        return super.supportsInterface(interfaceId);
    }
}