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
This sample shows how to create a very simple ERC-1155 token, using OpenZeppelin.
{% hint style="info" %} Required: Node plus Yarn and Git {% endhint %}
git clone https://github.com/scaffold-eth/scaffold-eth-examples.git simple-erc1155-nft-example
cd simple-erc1155-nft-example
git checkout simple-erc1155-nft-example
yarn install
yarn start
in a second terminal window:
cd simple-erc1155-nft-example
yarn chain
in a third terminal window:
cd simple-erc1155-nft-example
yarn deploy
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
inpackages/hardhat/scripts
and update thetoAddress
to your frontend address (wallet address in the top right or localhost:3000).
in a terminal window run the mint script:
yarn mint
👀 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