This Repo contains 2 different kinds of NFTs.
- An IPFS Hosted NFT
- An SVG NFT (Hosted 100% on-chain)
git clone https://github.com/allwin199/foundry-Nfts-v3.git
cd foundry-Nfts-v3
forge build
make anvil
This will default to your local node. You need to have it running in another terminal in order for it to deploy.
make deployBasicNftToAnvil
- To Mint an NFT
make mintBasicNftOnAnvil
make deployMoodNftToAnvil
- To Mint an NFT
make mintMoodNftOnAnvil
- Setup environment variables
-
You'll want to set your
SEPOLIA_RPC_URL
in environment variables. You can add them to a.env
file, similar to what you see in.env.example
. -
SEPOLIA_RPC_URL
: This is url of the sepolia testnet node you're working with. You can get setup with one for free from Alchemy
- Use wallet options to Encrypt Private Keys
Optionally, add your ETHERSCAN_API_KEY
if you want to verify your contract on Etherscan.
- Get testnet ETH
Head over to faucets.chain.link and get some testnet ETH. You should see the ETH show up in your metamask.
- Deploy
make deployBasicNftToSepolia
- To Interact with it
make mintBasicNftOnAnvil
make deployMoodNftToSepolia
- To Interact with it
make mintMoodNftOnSepolia
- Unit
- Integration
- Forked
forge test
or
forge test --fork-url $SEPOLIA_RPC_URL
forge coverage
forge coverage --report debug > coverage.txt
- To generate lcov report
make generateTestReport
You can estimate how much gas things cost by running:
forge snapshot
And you'll see an output file called .gas-snapshot
To run code formatting:
forge fmt