An open API service indexing awesome lists of open source software.

https://github.com/shrutakeerti/nft-challenge

This is for the challenge for the fellowship 1st assignment is done
https://github.com/shrutakeerti/nft-challenge

blockchain dapp ethereun typescript yarn

Last synced: 2 months ago
JSON representation

This is for the challenge for the fellowship 1st assignment is done

Awesome Lists containing this project

README

        

# ๐Ÿ— Scaffold-ETH 2


Documentation |
Website

๐Ÿงช An open-source, up-to-date toolkit for building decentralized applications (dapps) on the Ethereum blockchain. It's designed to make it easier for developers to create and deploy smart contracts and build user interfaces that interact with those contracts.

โš™๏ธ Built using NextJS, RainbowKit, Hardhat, Wagmi, Viem, and Typescript.

- โœ… **Contract Hot Reload**: Your frontend auto-adapts to your smart contract as you edit it.
- ๐Ÿช **[Custom hooks](https://docs.scaffoldeth.io/hooks/)**: Collection of React hooks wrapper around [wagmi](https://wagmi.sh/) to simplify interactions with smart contracts with typescript autocompletion.
- ๐Ÿงฑ [**Components**](https://docs.scaffoldeth.io/components/): Collection of common web3 components to quickly build your frontend.
- ๐Ÿ”ฅ **Burner Wallet & Local Faucet**: Quickly test your application with a burner wallet and local faucet.
- ๐Ÿ” **Integration with Wallet Providers**: Connect to different wallet providers and interact with the Ethereum network.

![Debug Contracts tab](https://github.com/scaffold-eth/scaffold-eth-2/assets/55535804/b237af0c-5027-4849-a5c1-2e31495cccb1)

## Requirements

Before you begin, you need to install the following tools:

- [Node (>= v18.18)](https://nodejs.org/en/download/)
- Yarn ([v1](https://classic.yarnpkg.com/en/docs/install/) or [v2+](https://yarnpkg.com/getting-started/install))
- [Git](https://git-scm.com/downloads)

# ๐Ÿšฉ Challenge #0: ๐ŸŽŸ Simple NFT Example

![readme-0](https://raw.githubusercontent.com/scaffold-eth/se-2-challenges/challenge-0-simple-nft/extension/packages/nextjs/public/hero.png)

๐Ÿ“š This tutorial is meant for developers that already understand the [ ๐Ÿ–๏ธ basics ](https://www.youtube.com/watch?v=MlJPjJQZtC8).

๐Ÿง‘โ€๐Ÿซ If you would like a more gentle introduction for developers, watch our 15 video [๐ŸŽฅ Web2 to Web3](https://www.youtube.com/playlist?list=PLJz1HruEnenAf80uOfDwBPqaliJkjKg69) series.

---

๐ŸŽซ Create a simple NFT:

๐Ÿ‘ทโ€โ™€๏ธ You'll compile and deploy your first smart contracts. Then, you'll use a template NextJS app full of important Ethereum components and hooks. Finally, you'll deploy an NFT to a public network to share with friends! ๐Ÿš€

๐ŸŒŸ The final deliverable is an app that lets users purchase and transfer NFTs. Deploy your contracts to a testnet, then build and upload your app to a public web server. Submit the url on [SpeedRunEthereum.com](https://speedrunethereum.com)!

๐Ÿ’ฌ Meet other builders working on this challenge and get help in the [Challenge 0 Telegram](https://t.me/+Y2vqXZZ_pEFhMGMx)!

๐Ÿค– If you have any question during your Challenge, you can try out the [Challenge AI assistant](https://scaffold-eth-assistant.streamlit.app/), and get answers to your Challenge/Scaffold-ETH questions. Please reach us in Telegram if something feels wrong!

## Checkpoint 0: ๐Ÿ“ฆ Environment ๐Ÿ“š

> Start your local network (a local instance of a blockchain):

```
yarn chain
```

> in a second terminal window, ๐Ÿ›ฐ deploy your contract (locally):

```
yarn deploy
```

> in a third terminal window, start your ๐Ÿ“ฑ frontend:

```
yarn start
```

๐Ÿ“ฑ Open [http://localhost:3000](http://localhost:3000) to see the app.

---

## Checkpoint 1: โ›ฝ๏ธ Gas & Wallets ๐Ÿ‘›

> โ›ฝ๏ธ You'll need to get some funds from the faucet for gas.

![gas&wallet](https://github.com/scaffold-eth/se-2-challenges/assets/80153681/912d0d4b-db34-49d3-bd7d-7ca0ab18eb66)

> ๐ŸฆŠ At first, **don't** connect MetaMask. If you are already connected, click **Disconnect**:




> ๐Ÿ”ฅ We'll use burner wallets on localhost.

> ๐Ÿ‘› Explore how burner wallets work in ๐Ÿ— Scaffold-ETH 2 by opening a new incognito window and navigate to http://localhost:3000. You'll notice it has a new wallet address in the top right. Copy the incognito browser's address and send localhost test funds to it from your first browser (using the **Faucet** button in the bottom left):

![icognito&webBrowser](https://github.com/scaffold-eth/se-2-challenges/assets/80153681/fd191447-a31f-4c03-a36f-936bfb70c2a1)

> ๐Ÿ‘จ๐Ÿปโ€๐Ÿš’ When you close the incognito window, the account is gone forever. Burner wallets are great for local development but you'll move to more permanent wallets when you interact with public networks.

---

## Checkpoint 2: ๐Ÿ–จ Minting

> โœ๏ธ Mint some NFTs! Click the **MINT NFT** button in the `My NFTs` tab.

![image](https://github.com/scaffold-eth/se-2-challenges/assets/80153681/74cf02f2-4c1b-4278-9841-f19f668e0b1e)

๐Ÿ‘€ You should see your NFTs start to show up:

![image](https://github.com/scaffold-eth/se-2-challenges/assets/80153681/63dabceb-ad42-4c09-8e5d-a0139939e32d)

๐Ÿ‘› Open an incognito window and navigate to http://localhost:3000

๐ŸŽŸ Transfer an NFT to the incognito window address using the UI:

![image](https://github.com/scaffold-eth/se-2-challenges/assets/80153681/3b92fb50-d43f-48a8-838c-c45c443b0b71)

๐Ÿ‘› Try to mint an NFT from the incognito window.

> Can you mint an NFT with no funds in this address? You might need to grab funds from the faucet to pay for the gas!

๐Ÿ•ต๐Ÿปโ€โ™‚๏ธ Inspect the `Debug Contracts` tab to figure out what address is the owner of YourCollectible?

๐Ÿ” You can also check out your smart contract `YourCollectible.sol` in `packages/hardhat/contracts`.

๐Ÿ’ผ Take a quick look at your deploy script `00_deploy_your_contract.js` in `packages/hardhat/deploy`.

๐Ÿ“ If you want to edit the frontend, navigate to `packages/nextjs/app` and open the specific page you want to modify. For instance: `/myNFTs/page.tsx`. For guidance on [routing](https://nextjs.org/docs/app/building-your-application/routing/defining-routes) and configuring [pages/layouts](https://nextjs.org/docs/app/building-your-application/routing/pages-and-layouts) checkout the Next.js documentation.

---

## Checkpoint 3: ๐Ÿ’พ Deploy your contract! ๐Ÿ›ฐ

๐Ÿ›ฐ Ready to deploy to a public testnet?!?

> Change the defaultNetwork in `packages/hardhat/hardhat.config.ts` to `sepolia`.

![chall-0-hardhat-config](https://github.com/scaffold-eth/se-2-challenges/assets/55535804/f94b47d8-aa51-46eb-9c9e-7536559a5d45)

๐Ÿ” Generate a deployer address with `yarn generate`. This creates a unique deployer address and saves the mnemonic locally.

> This local account will deploy your contracts, allowing you to avoid entering a personal private key.

![chall-0-yarn-generate](https://github.com/scaffold-eth/se-2-challenges/assets/2486142/133f5701-e575-4cc2-904f-cdc83ae86d94)

๐Ÿ‘ฉโ€๐Ÿš€ Use `yarn account` to view your deployer account balances.

![chall-0-yarn-account](https://github.com/scaffold-eth/se-2-challenges/assets/2486142/c34df8c9-9793-4a76-849b-170fae7fd0f0)

โ›ฝ๏ธ You will need to send ETH to your deployer address with your wallet, or get it from a public faucet of your chosen network.

> Some popular Sepolia faucets are the [Alchemy Faucet](https://sepoliafaucet.com/), [Infura Faucet](https://www.infura.io/faucet/sepolia), and [Google Cloud Faucet](https://cloud.google.com/application/web3/faucet/ethereum/sepolia).

> โš”๏ธ Side Quest: Keep a ๐Ÿง‘โ€๐ŸŽค [punkwallet.io](https://punkwallet.io) on your phone's home screen and keep it loaded with testnet eth. ๐Ÿง™โ€โ™‚๏ธ You'll look like a wizard when you can fund your deployer address from your phone in seconds.

๐Ÿš€ Deploy your NFT smart contract with `yarn deploy`.

> ๐Ÿ’ฌ Hint: You can set the `defaultNetwork` in `hardhat.config.ts` to `sepolia` **OR** you can `yarn deploy --network sepolia`.

---

## Checkpoint 4: ๐Ÿšข Ship your frontend! ๐Ÿš

> โœ๏ธ Edit your frontend config in `packages/nextjs/scaffold.config.ts` to change the `targetNetwork` to `chains.sepolia` :

![chall-0-scaffold-config](https://github.com/scaffold-eth/se-2-challenges/assets/12072395/ff03bda0-66c6-4907-a9ad-bc8587da8036)

> You should see the correct network in the frontend (http://localhost:3000):

![image](https://github.com/scaffold-eth/se-2-challenges/assets/80153681/50eef1f7-e1a3-4b3b-87e2-59c19362c4ff)

> ๐ŸฆŠ Since we have deployed to a public testnet, you will now need to connect using a wallet you own or use a burner wallet. By default ๐Ÿ”ฅ `burner wallets` are only available on `hardhat` . You can enable them on every chain by setting `onlyLocalBurnerWallet: false` in your frontend config (`scaffold.config.ts` in `packages/nextjs/`).

![image](https://github.com/scaffold-eth/se-2-challenges/assets/80153681/f582d311-9b57-4503-8143-bac60346ea33)

> ๐Ÿ’ฌ Hint: For faster loading of your transfer page, consider updating the `fromBlock` passed to `useScaffoldEventHistory` in `packages/nextjs/app/transfers/page.tsx` to `blocknumber - 10` at which your contract was deployed. Example: `fromBlock: 3750241n` (where `n` represents its a [BigInt](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt)). To find this blocknumber, search your contract's address on Etherscan and find the `Contract Creation` transaction line.

๐Ÿš€ Deploy your NextJS App

```
yarn vercel
```

> You might need to log in to Vercel first by running `yarn vercel:login`. Once you log in (email, GitHub, etc), the default options should work.

> If you want to redeploy to the same production URL you can run `yarn vercel --prod`. If you omit the `--prod` flag it will deploy it to a preview/test URL.

> Follow the steps to deploy to Vercel. It'll give you a public URL.

โš ๏ธ Run the automated testing function to make sure your app passes

```
yarn test
```

#### Configuration of Third-Party Services for Production-Grade Apps.

By default, ๐Ÿ— Scaffold-ETH 2 provides predefined API keys for popular services such as Alchemy and Etherscan. This allows you to begin developing and testing your applications more easily, avoiding the need to register for these services.
This is great to complete your **SpeedRunEthereum**.

For production-grade applications, it's recommended to obtain your own API keys (to prevent rate limiting issues). You can configure these at:

- ๐Ÿ”ท `ALCHEMY_API_KEY` variable in `packages/hardhat/.env` and `packages/nextjs/.env.local`. You can create API keys from the [Alchemy dashboard](https://dashboard.alchemy.com/).

- ๐Ÿ“ƒ `ETHERSCAN_API_KEY` variable in `packages/hardhat/.env` with your generated API key. You can get your key [here](https://etherscan.io/myapikey).

> ๐Ÿ’ฌ Hint: It's recommended to store env's for nextjs in Vercel/system env config for live apps and use .env.local for local testing.

---

## Checkpoint 5: ๐Ÿ“œ Contract Verification

You can verify your smart contract on Etherscan by running (`yarn verify --network network_name`) :

```
yarn verify --network sepolia
```

> It is okay if it says your contract is already verified. Copy the address of YourCollectable.sol and search it on sepolia Etherscan to find the correct URL you need to submit this challenge.

## Checkpoint 6: ๐Ÿ’ช Flex!

๐Ÿ‘ฉโ€โค๏ธโ€๐Ÿ‘จ Share your public url with a friend and ask them for their address to send them a collectible :)

![gif](https://github.com/scaffold-eth/se-2-challenges/assets/80153681/547612f6-97b9-4eb3-ab6d-9b6d2c0ac769)

## โš”๏ธ Side Quests

### ๐ŸŸ Open Sea

> ๐Ÿƒ Want to see your new NFTs on Opensea? Head to [Testnets Opensea](https://testnets.opensea.io/)

> ๐ŸŽซ Make sure you have minted some NFTs on your Vercel page, then connect to Opensea using that same wallet.

![image](https://github.com/scaffold-eth/se-2-challenges/assets/80153681/c752b365-b801-4a02-ba2e-62e0270b3795)

> You can see your collection of shiny new NFTs on a testnet!

(It can take a while before they show up, but here is an example:) https://testnets.opensea.io/assets/sepolia/0x17ed03686653917efa2194a5252c5f0a4f3dc49c/2

---

> ๐Ÿƒ Head to your next challenge [here](https://github.com/scaffold-eth/se-2-challenges).

> ๐Ÿ’ฌ Problems, questions, comments on the stack? Post them to the [๐Ÿ— scaffold-eth developers chat](https://t.me/joinchat/F7nCRK3kI93PoCOk)

## Documentation

Visit our [docs](https://docs.scaffoldeth.io) to learn how to start building with Scaffold-ETH 2.

To know more about its features, check out our [website](https://scaffoldeth.io).

## Contributing to Scaffold-ETH 2

We welcome contributions to Scaffold-ETH 2!

Please see [CONTRIBUTING.MD](https://github.com/scaffold-eth/scaffold-eth-2/blob/main/CONTRIBUTING.md) for more information and guidelines for contributing to Scaffold-ETH 2.