diff --git a/static/images/tutorials/42-robot-nft-ethereum/botcolors.png b/static/images/tutorials/42-robot-nft-ethereum/botcolors.png new file mode 100644 index 00000000..08f3c5ed Binary files /dev/null and b/static/images/tutorials/42-robot-nft-ethereum/botcolors.png differ diff --git a/static/images/tutorials/42-robot-nft-ethereum/confirmdeploy.png b/static/images/tutorials/42-robot-nft-ethereum/confirmdeploy.png new file mode 100644 index 00000000..dac9344e Binary files /dev/null and b/static/images/tutorials/42-robot-nft-ethereum/confirmdeploy.png differ diff --git a/static/images/tutorials/42-robot-nft-ethereum/deploy.png b/static/images/tutorials/42-robot-nft-ethereum/deploy.png new file mode 100644 index 00000000..669cb320 Binary files /dev/null and b/static/images/tutorials/42-robot-nft-ethereum/deploy.png differ diff --git a/static/images/tutorials/42-robot-nft-ethereum/expand.mp4 b/static/images/tutorials/42-robot-nft-ethereum/expand.mp4 new file mode 100644 index 00000000..dd2128b7 Binary files /dev/null and b/static/images/tutorials/42-robot-nft-ethereum/expand.mp4 differ diff --git a/static/images/tutorials/42-robot-nft-ethereum/get-one.png b/static/images/tutorials/42-robot-nft-ethereum/get-one.png index 20aada5c..438e0d56 100644 Binary files a/static/images/tutorials/42-robot-nft-ethereum/get-one.png and b/static/images/tutorials/42-robot-nft-ethereum/get-one.png differ diff --git a/static/images/tutorials/42-robot-nft-ethereum/mint.mp4 b/static/images/tutorials/42-robot-nft-ethereum/mint.mp4 new file mode 100644 index 00000000..a3b74fbc Binary files /dev/null and b/static/images/tutorials/42-robot-nft-ethereum/mint.mp4 differ diff --git a/tutorials/42-build-a-robot-nft.md b/tutorials/42-build-a-robot-nft.md index d9a6666a..40c1ac95 100644 --- a/tutorials/42-build-a-robot-nft.md +++ b/tutorials/42-build-a-robot-nft.md @@ -80,7 +80,7 @@ Let's start on our NFT contract code. Open `contract.sol`, delete the file's con ```solidity // // SPDX-License-Identifier: MIT -pragma solidity ^0.8.13; +pragma solidity ^0.8.8; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol"; import "@openzeppelin/contracts/utils/Strings.sol"; @@ -154,7 +154,7 @@ We'll start by defining a string array for each type of accessory. Add the follo ```solidity string[] private headgear = [ "Cowboy Hat", - "Afro", + "Fro", "Baseball Cap", "Viking Helmet" ]; @@ -360,16 +360,33 @@ Connect your MetaMask wallet to the web interface and switch to the Replit Testn ![Switching to test](/images/tutorials/42-robot-nft-ethereum/switch-to-test.png) ![Getting one Ether](/images/tutorials/42-robot-nft-ethereum/get-one.png) -Now you can deploy your contracts. Select "ReplBot" from the drop-down box and click "Deploy". Approve the MetaMask pop-up that appears. +Now you can deploy your contracts. Select "ReplBots" from the drop-down box and click "Deploy". Approve the MetaMask pop-up that appears. + +![Deploy the contract](/images/tutorials/42-robot-nft-ethereum/deploy.png) + + + Once this contract has been deployed, it will show up as an expandable box below the drop-down box. Expand it and take a look at all the different functions available. + + Mint your first NFT by navigating to the `mint` function. Click on your wallet address in the top right corner of the page to copy it, and then paste it into the `recipient` field. Then run the function and approve the MetaMask pop-up that appears. + + After a few seconds, you should see a pop-up indicating that your transaction has gone through. Congratulations, you're the proud owner of a ReplBot NFT! Check out its colors and accessories by entering ID 0 into `botColors` and `botAccessories`. If you mint again, you should receive a ReplBot with ID 1 and a different set of colors and accessories. +![Bot colors](/images/tutorials/42-robot-nft-ethereum/botcolors.png) + ## Breeding bots We can now mint ReplBots with random characteristics, which fulfills the specification we laid out at the start of this tutorial. But with a bit of additional code, we can introduce a second way to create ReplBots, breeding. @@ -460,7 +477,7 @@ Next comes our bot creation code, which will be similar to the code in our `mint uint8 faceIdx = uint8(_random(tokenId, "asdfg") % facegear.length); // Create bot - replbots[tokenId] = ReplBot(frameCol, visorCol, backgroundCol, headIdx, earIdx, faceIdx, parentOne.generation + 1); + replbots[tokenId] = ReplBot(frameCol, visorCol, backgroundCol, headIdx, earIdx, faceIdx, parentOne.generation + 1, parentOneId, parentTwoId); // Mint token _safeMint(recipient, tokenId);