๐ŸŽซ
Simple ERC-1155 NFT

Branch Info

Author: Pablo Ruiz Source code: https://github.com/scaffold-eth/scaffold-eth-examples/tree/simple-erc1155-example Intended audience: Beginners/Intermediate Topics: Scaffold-eth basics, NFTs, IPFS, ERC-1155

Introduction

This sample shows how to create a very simple ERC-1155 token, using OpenZeppelin.

๐Ÿƒโ€โ™€๏ธ Quick Start

Required: Node plus Yarn and Gitโ€‹
1
git clone https://github.com/scaffold-eth/scaffold-eth-examples.git simple-erc1155-nft-example
Copied!
1
โ€‹
2
cd simple-erc1155-nft-example
3
โ€‹
4
git checkout simple-erc1155-nft-example
Copied!
1
yarn install
Copied!
1
yarn start
Copied!
in a second terminal window:
1
cd simple-erc1155-nft-example
2
yarn chain
Copied!
in a third terminal window:
1
cd simple-erc1155-nft-example
2
yarn deploy
Copied!
In the deployment script (/packages/hardhat/deploy/00_deploy_your_contract.js), you will notice we are uploading the erc1155metadata folder (in /packages/hardhat/erc1155metadata) so we store the CID for the contract URI:
๐Ÿ“ฑ Open http://localhost:3000 to see the app
โœ๏ธ Edit the mint script mint.js in packages/hardhat/scripts and update the toAddress to your frontend address (wallet address in the top right or localhost:3000).
in a terminal window run the mint script:
1
yarn mint
Copied!
๐Ÿ‘€ You should see your collectibles show up if you minted to the correct address:
๐Ÿ‘› Open an incognito window and navigate to http://localhost:3000 (You'll notice it has a new wallet address).โ›ฝ๏ธ Grab some gas for each account using the faucet:
๐ŸŽŸ Send an NFT to the incognito window address:
Edit your deployment script deploy.js in packages/hardhat/scripts
๐Ÿ” Edit your smart contract YourCollectible.sol in packages/hardhat/contracts
๐Ÿ“ Edit your frontend App.jsx in packages/react-app/src
๐Ÿ”‘ Create wallet links to your app with yarn wallet and yarn fundedwallet
โฌ‡๏ธ Installing a new package to your frontend? You need to cd packages/react-app and then yarn add PACKAGE