Skip to content

curiosi-T/full-stack-ethereum-dapp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Simple Ethereum Dapp

This project demonstrates the use of Hardhat + React + Ethers.js by developing a simple ERC20 contract. Follow the steps here: The Complete Guide to Full Stack Ethereum Development

Notes:

Setup project:

npx create-react-app react-dapp
(change into react-dapp directory) 
npm install ethers hardhat @nomiclabs/hardhat-waffle ethereum-waffle chai @nomiclabs/hardhat-ethers
npx hardhat
  • Make necessary changes in hardhat.config.js
module.exports = {
  solidity: "0.8.4",
  paths: {
    artifacts: './src/artifacts',
  },
  networks: {
    hardhat: {
      chainId: 1337
    }
  }
};
  • Configure hardhat.config.js to use env file:
require("dotenv").config({ path: __dirname + "/.env" });
const { API_URL, PRIVATE_KEY } = process.env;

Run project:

(start hardhat network) npx hardhat node
(compile) npx hardhat compile
(run script) npx hardhat run scripts/deploy.js --network localhost
(start REACT server) npm start