I am a self taught blockchain engineer, for many years I was a dedicated gamer and crypto native having been exposed to crypto currency when I was only 14. My path eventually lead me to meeting my mentor who was a senior developer in Web2. She pushed me to follow a path in web3, and I fell in love ever since.
I am completing Alchemy Uni as kinda fun thing to do on the side and go through their program. Hoping to pick up on some knowledge I may not have.
This project was completed 11/1/2022
I decided to have some fun so I created this project in Hardhat, using Solidity, ethers, Node.js, and Chai.
This tutorial was well put together, I did not know that openzepplin had plug and play for smart contracts so that was interesting to play around with.
How do you think you can use this technology to build useful applications in the future? What are some specific example applications?
This project is a great starter point for anyone looking to create unique and innovative smart contracts for minting NFTs. Some examples would be BAYC, Nouns DAO, and Pudgy Penguins.
I would recommend this project to new developers with a decent background in javascript looking to dive straight in to building smart contracts.
For my POK I would like to receive it at this address: 0x0e086ddA48aC11cA5957a5933A5FDF76453886ED
Check out Alchemy University:
<https://university.alchemy.com/ i>
You can check out the code for this smart contract here:
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/Counters.sol";
contract NftMinter is ERC721, ERC721Enumerable, ERC721URIStorage, Ownable {
using Counters for Counters.Counter;
Counters.Counter private _tokenIdCounter;
uint256 MAX_SUPPLY = 5000;
mapping(address => uint256) public totalMinted;
constructor() ERC721("AlchemyUNI", "NFT") {}
function safeMint(address to, string memory uri) public {
require(
_tokenIdCounter.current() <= MAX_SUPPLY,
"I'm sorry we reached the cap"
);
require(
totalMinted[msg.sender] < 5,
"Im sorry you have minted the max amount"
);
uint256 tokenId = _tokenIdCounter.current();
_tokenIdCounter.increment();
totalMinted[msg.sender]++;
_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);
}
function getTotalMinted() public view returns (uint256) {
return totalMinted[msg.sender];
}
function getMaxSupply() public view returns (uint256) {
return MAX_SUPPLY;
}
}

