Giter Site home page Giter Site logo

makevoid / cheapeth-wallet-hardhat Goto Github PK

View Code? Open in Web Editor NEW
1.0 3.0 1.0 977 KB

cheapETH sample wallet using hardhat

Solidity 4.56% TypeScript 80.54% HTML 6.44% CSS 4.36% JavaScript 4.11%
eth cheapeth hardhat hardhat-node cth ethereum web3 ethers ethers-js react

cheapeth-wallet-hardhat's Introduction

cheapeth-wallet

cheapETH sample wallet using hardhat

status: WIP

Prepare

cp hardhat.config.default.ts hardhat.config.ts

modify the default mnemonic with a test cTH mnemonic with a small amount of cTH to test transactions

Install

on the main directory run:

npm install

on the frontend directory run:

npm install

Run

on the main directory, run the backend app:

npm run node

and then on the same directory, run the frontend:

npm run frontend

a browser should open onto http://localhost:3000 and should show the Wallet UI

use Metamask to use the wallet functionality

@makevoid


original readme


Get started

  1. Clone the repo and cd into it git clone https://github.com/symfoni/hardhat-react-boilerplate.git MyProject && cd MyProject
  2. Install deps with yarn yarn or npm npm install
  3. Start hardhat npx hardhat node --watch

It runs up a Hardhat node, compile contracts, generates typescript interfaces, creates React context and instantiates your contract instances and factories with frontend provider.
  1. Open up a new terminal
  2. Enter the frontend directory: cd frontend
  3. Install dependencies: npm install
  4. Import seed phrase in Metamask. The default mnemonic currently used by hardhat is test test test test test test test test test test test junk
  5. Please note that you need to sign out from your current Metamask wallet to import a new one. Instead of logging out, you can use a new browser profile to do your Ethereum development:
  6. Click your profile icon in the top right corner of Chrome (right next to the hamburger menu icon)
  7. Click "Add"
  8. Give the profile a name and click "Add"
  9. In this new browser window, install Metamask and import the keyphrase above
  10. Ensure Metamask RPC is set to http://localhost:8545 and chainID 777.
  11. Start the React app: npm start

The frontend should open at http://localhost:3000/

Because of this default hardhat.config.ts it will first try to connect with an injected provider like Metamask (web3modal package does this).

If nothing found it will try to connect with your hardhat node. On localhost and hardhat nodes it will inject your mnemonic into the frontend so you have a "browser wallet" that can both call and send transactions. NB! Dont ever put a mnemonic with actual value here.

In hardhat.config.ts there is example on how to instruct your hardhat-network to use mnemonic or privatekey.

const config: HardhatUserConfig = {
  react: {
    providerPriority: ["web3modal", "hardhat"],
  },
};

Ensure you are useing RPC to http://localhost:8545.

cheapeth-wallet-hardhat's People

Contributors

makevoid avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.