From 22a7e7a8b9749fe0b9e79c64a6694b8608e2491c Mon Sep 17 00:00:00 2001 From: yanukadeneth99 Date: Fri, 9 Sep 2022 22:56:33 +0530 Subject: [PATCH] Name Fix --- README.md | 25 ++++++++++------------- contracts/Greeter.sol | 22 -------------------- contracts/{NFTea.sol => NFTee.sol} | 7 +++---- scripts/deploy.js | 2 +- scripts/sample-script.js | 32 ------------------------------ test/sample-test.js | 19 ------------------ 6 files changed, 15 insertions(+), 92 deletions(-) delete mode 100644 contracts/Greeter.sol rename contracts/{NFTea.sol => NFTee.sol} (59%) delete mode 100644 scripts/sample-script.js delete mode 100644 test/sample-test.js diff --git a/README.md b/README.md index c9a068f..dd11670 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,9 @@ -# Level 9 - NFT-Tutorial +# Level 9 - NFT-Tutorial Deploy a NFT project on Ethereum ## Prefer a Video? + If you would rather learn from a video, we have a recording available of this tutorial on our YouTube. Watch the video by clicking on the screenshot below, or go ahead and read the tutorial! [![Cryptocurrency Tutorial](https://i.imgur.com/klHysek.png)](https://www.youtube.com/watch?v=uwnAXAsd428 "NFT Tutorial") @@ -59,8 +60,8 @@ Lets install Open Zeppelin contracts, In the terminal window execute this comman npm install @openzeppelin/contracts ``` -- In the contracts folder, create a new solidity file called NFTee.sol -- Now we would write some code in the NFTee.sol file. We would be importing [Openzeppelin's ERC721 Contract](https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC721/ERC721.sol). ERC721 is the most common standard for creating NFT's. In the freshman track, we would only be using ERC721. In the sophomore track, you would learn more about ERC721's in detail. So dont worry, if you dont understand everything :) +- In the contracts folder, create a new solidity file called `NFTee.sol` +- Now we would write some code in the `NFTee.sol` file. We would be importing [Openzeppelin's ERC721 Contract](https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC721/ERC721.sol). ERC721 is the most common standard for creating NFT's. In the freshman track, we would only be using ERC721. In the sophomore track, you would learn more about ERC721's in detail. So dont worry, if you dont understand everything :) ```js // SPDX-License-Identifier: MIT @@ -69,14 +70,13 @@ pragma solidity ^0.8.0; // Import the openzepplin contracts import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; -// GameItem is ERC721 signifies that the contract we are creating imports ERC721 and follows ERC721 contract from openzeppelin -contract GameItem is ERC721 { - +// NFTee is ERC721 signifies that the contract we are creating imports ERC721 and follows ERC721 contract from openzeppelin +contract NFTee is ERC721 { constructor() ERC721("GameItem", "ITM") { - // mint an NFT to yourself _mint(msg.sender, 1); } } + ``` - Compile the contract, open up a terminal and execute these commands @@ -97,16 +97,13 @@ const { ethers } = require("hardhat"); async function main() { /* -A ContractFactory in ethers.js is an abstraction used to deploy new smart contracts, -so nftContract here is a factory for instances of our GameItem contract. -*/ - const nftContract = await ethers.getContractFactory("GameItem"); + A ContractFactory in ethers.js is an abstraction used to deploy new smart contracts, + so nftContract here is a factory for instances of our GameItem contract. + */ + const nftContract = await ethers.getContractFactory("NFTee"); // here we deploy the contract const deployedNFTContract = await nftContract.deploy(); - - // wait for the contract to deploy - await deployedNFTContract.deployed(); // print the address of the deployed contract console.log("NFT Contract Address:", deployedNFTContract.address); diff --git a/contracts/Greeter.sol b/contracts/Greeter.sol deleted file mode 100644 index efffb8f..0000000 --- a/contracts/Greeter.sol +++ /dev/null @@ -1,22 +0,0 @@ -//SPDX-License-Identifier: Unlicense -pragma solidity ^0.8.0; - -import "hardhat/console.sol"; - -contract Greeter { - string private greeting; - - constructor(string memory _greeting) { - console.log("Deploying a Greeter with greeting:", _greeting); - greeting = _greeting; - } - - function greet() public view returns (string memory) { - return greeting; - } - - function setGreeting(string memory _greeting) public { - console.log("Changing greeting from '%s' to '%s'", greeting, _greeting); - greeting = _greeting; - } -} diff --git a/contracts/NFTea.sol b/contracts/NFTee.sol similarity index 59% rename from contracts/NFTea.sol rename to contracts/NFTee.sol index 5ac86bc..c367a58 100644 --- a/contracts/NFTea.sol +++ b/contracts/NFTee.sol @@ -4,10 +4,9 @@ pragma solidity ^0.8.0; // Import the openzepplin contracts import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; -// GameItem is ERC721 signifies that the contract we are creating imports ERC721 and follows ERC721 contract from openzeppelin -contract GameItem is ERC721 { - +// NFTee is ERC721 signifies that the contract we are creating imports ERC721 and follows ERC721 contract from openzeppelin +contract NFTee is ERC721 { constructor() ERC721("GameItem", "ITM") { _mint(msg.sender, 1); } -} \ No newline at end of file +} diff --git a/scripts/deploy.js b/scripts/deploy.js index b8417b7..94ac19c 100644 --- a/scripts/deploy.js +++ b/scripts/deploy.js @@ -6,7 +6,7 @@ async function main() { A ContractFactory in ethers.js is an abstraction used to deploy new smart contracts, so nftContract here is a factory for instances of our GameItem contract. */ - const nftContract = await ethers.getContractFactory("GameItem"); + const nftContract = await ethers.getContractFactory("NFTee"); // here we deploy the contract const deployedNFTContract = await nftContract.deploy(); diff --git a/scripts/sample-script.js b/scripts/sample-script.js deleted file mode 100644 index 90cd819..0000000 --- a/scripts/sample-script.js +++ /dev/null @@ -1,32 +0,0 @@ -// We require the Hardhat Runtime Environment explicitly here. This is optional -// but useful for running the script in a standalone fashion through `node