Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

8. Get your Batch Graduation NFT! #3

Open
phipsae opened this issue Oct 9, 2024 · 2 comments
Open

8. Get your Batch Graduation NFT! #3

phipsae opened this issue Oct 9, 2024 · 2 comments

Comments

@phipsae
Copy link
Collaborator

phipsae commented Oct 9, 2024

Goal

Get your graduation NFT! 🎓

💡 This issue doesn't require you to raise a PR, just get yourself the completion NFT. Create a local branch to work on this.

WARNING: You are only able to mint one NFT on mainnet, so be careful when adjusting metadata and testing to only graduate once on mainnet.

BatchGraduationNFT contract

The BatchGraduationNFT contract is deployed on Optimism.

Check it out on Etherscan
Check it out on abi.ninja

You can find the contract code in packages/hardhat/contracts/BatchGraduationNFT.sol. It's also available in the externalContracts.ts file in packages/nextjs/contracts/ (for front-end use in future issues).

Get your Batch Graduation NFT

1. Create your own branch

Before you begin, make sure you're working on a separate branch. Here's how:

  1. Clone the repo to your local machine (If you haven't already)
  2. Navigate to the cloned directory in your terminal.
  3. Create a new branch using git checkout -b [your-branch-name]

2. Spin up Your Local SE-2

Set up your local environment:

  1. Run yarn install (install dependencies)
  2. Run yarn start (starts SE2 front-end)
  3. Go to http://localhost:3000/. You should see SE-2 app.

💡 You'll notice that the dApp points to the Optimism chain. Check the scaffold.config.ts file to see how it's configured.

3. Understand the graduate Function


Check out the graduate function in the BatchRegistry.sol contract. After performing some validation checks, this function calls the mint function of the BatchGraduationNFT.sol contract to mint your NFT. Review the BatchGraduationNFT.sol contract to see how it works.

4. Set Up a Metadata Contract


You’ll need to deploy a Metadata Contract to set attributes (like color and name) for your personal NFT.

  1. Create a Metadata.sol contract in packages/hardhat/contracts/.
  2. You can interact with the BatchGraduationNFT in the /debug page.

5. Deploy and Interact

  1. Update the BatchGraduationNFT.sol contract with the address of your Metadata Contract.

Once everything is set up, you can call the graduate function on the BatchRegistry contract.

6. View Your NFT:

Check if it appears on OpenSea or other platforms!

✅ Congrats you have now completed the Graduation NFT Challenge! Make sure to share it in the telegram! 🎉


Outline:

  • Alongside the BatchRegistry contract, a BatchGraduationNFT was deploy, you can see it in the hardhat/contracts folder
  • Check the graduate function on the BatchRegistry Contract. After doing some checks, it calls the mint function of the NFT contract
  • As you can see you'd need to deploy a Metadata Contract where you can set some attributes (color and name) for your personal NFT
  • You can interact with the BatchGraduationNFT in the /debug page (added in externalContracts.ts)
  • Once you set the address of the Metadata in the BatchGraduationNFT contract, you should be able to call graduate on the BatchRegistry contract.
  • Explain how they can see their minted NFT (getting the base64 contract, parse and render.... vs opensea?). We (as admins) could also provide some means to it (a hook / page)

(Everything is very open to suggestions!)

@aspiringLilCoder
Copy link
Contributor

Metadata contract: https://optimistic.etherscan.io/address/0x34c0622ca8CBd351b06282B6eed9d40A40606C44
Set Metadata Contract Tx: https://optimistic.etherscan.io/tx/0x1352423070dd4b1289e09482a04d89b86491db0851d8fd16cbe50ad133040661
Graduate Tx: https://optimistic.etherscan.io/tx/0xb5a2b36697635507eb6081443e64bc9ce42f3669315a31de7fbdebe16bea2510
NFT: https://optimistic.etherscan.io/nft/0x3dcc07603ba28e29e63faee903c76466926aa258/5

I have successfully graduated 🥳

This introduction to open source collaboration in the field of dApp development has been nothing but such a supportive and encouraging journey. Huge thank you to both @phipsae and @derrekcoleman for being the best batch dads 💖. I've learned a ton and will be putting everything I've gained into practice.

I wish the whole batch an amazing last few months of the year.

@Michael-Nwachukwu
Copy link
Contributor

Thank you for a great experience @phipsae and @derrekcoleman

I've successfully minted my graduation nft.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants