From d93435ddfcbcfa41ec8edf92e5d01889abca16fe Mon Sep 17 00:00:00 2001 From: Ruidy Date: Thu, 7 Apr 2022 06:43:28 -0400 Subject: [PATCH] init project --- .gitignore | 9 + README.md | 8 + contracts/Greeter.sol | 22 + hardhat.config.js | 21 + package.json | 20 + scripts/sample-script.js | 32 + test/sample-test.js | 19 + yarn-error.log | 55 + yarn.lock | 7785 ++++++++++++++++++++++++++++++++++++++ 9 files changed, 7971 insertions(+) create mode 100644 .gitignore create mode 100644 README.md create mode 100644 contracts/Greeter.sol create mode 100644 hardhat.config.js create mode 100644 package.json create mode 100644 scripts/sample-script.js create mode 100644 test/sample-test.js create mode 100644 yarn-error.log create mode 100644 yarn.lock diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..36077f2 --- /dev/null +++ b/.gitignore @@ -0,0 +1,9 @@ +node_modules +.env +coverage +coverage.json +typechain + +#Hardhat files +cache +artifacts diff --git a/README.md b/README.md new file mode 100644 index 0000000..5f617e5 --- /dev/null +++ b/README.md @@ -0,0 +1,8 @@ +# My NFT Collection + +Demo NFT collection for learning purposes. + +## Built With + +- [Solidity](https://soliditylang.org/) +- [Hardhat](https://hardhat.org/) diff --git a/contracts/Greeter.sol b/contracts/Greeter.sol new file mode 100644 index 0000000..efffb8f --- /dev/null +++ b/contracts/Greeter.sol @@ -0,0 +1,22 @@ +//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/hardhat.config.js b/hardhat.config.js new file mode 100644 index 0000000..cfeed55 --- /dev/null +++ b/hardhat.config.js @@ -0,0 +1,21 @@ +require("@nomiclabs/hardhat-waffle"); + +// This is a sample Hardhat task. To learn how to create your own go to +// https://hardhat.org/guides/create-task.html +task("accounts", "Prints the list of accounts", async (taskArgs, hre) => { + const accounts = await hre.ethers.getSigners(); + + for (const account of accounts) { + console.log(account.address); + } +}); + +// You need to export an object to set up your config +// Go to https://hardhat.org/config/ to learn more + +/** + * @type import('hardhat/config').HardhatUserConfig + */ +module.exports = { + solidity: "0.8.4", +}; diff --git a/package.json b/package.json new file mode 100644 index 0000000..99c4df7 --- /dev/null +++ b/package.json @@ -0,0 +1,20 @@ +{ + "name": "nft-collection", + "version": "1.0.0", + "main": "index.js", + "license": "MIT", + "scripts": { + "dev": "npx hardhat run scripts/sample-script.js" + }, + "devDependencies": { + "@nomiclabs/hardhat-ethers": "^2.0.0", + "@nomiclabs/hardhat-waffle": "^2.0.0", + "chai": "^4.2.0", + "ethereum-waffle": "^3.0.0", + "ethers": "^5.0.0", + "hardhat": "^2.9.3" + }, + "dependencies": { + "@openzeppelin/contracts": "^4.5.0" + } +} diff --git a/scripts/sample-script.js b/scripts/sample-script.js new file mode 100644 index 0000000..90cd819 --- /dev/null +++ b/scripts/sample-script.js @@ -0,0 +1,32 @@ +// We require the Hardhat Runtime Environment explicitly here. This is optional +// but useful for running the script in a standalone fashion through `node