Git Product home page Git Product logo

hardhat-fund-me's Introduction

Hardhat FundMe Backend

Environment Setting-up

Noting that hardhat.config.js is the entry point for each .js file, then remeber to import packages by the "require" syntax in the configuration file.


In this project, we will use the package hardhat-deploy to facilitate the process of contracts deployment, testing and other excellent functions. The package can be added to your working context by the following action:

yarn add --dev hardhat-deploy

where the official docs for its utilization can be found: https://github.com/wighawag/hardhat-deploy

If you are using ethers.js we recommend you also install hardhat-deploy-ethers which add extra features to access deployments as ethers contract.

Since hardhat-deploy-ethers is a fork of @nomiclabs/hardhat-ethers and that other plugin might have an hardcoded dependency on @nomiclabs/hardhat-ethers the best way to install hardhat-deploy-ethers and ensure compatibility is the following:

yarn add --dev  @nomiclabs/hardhat-ethers@npm:hardhat-deploy-ethers ethers

Installing libraries defined in smart contracts


For example

"The library @chainlink/contracts, imported from contracts/FundMe.sol, is not installed. Try installing it using npm."

Solution:

yarn add --dev @chainlink/contracts

yarn add --dev @nomiclabs/hardhat-ethers@npm:hardhat-deploy-ethers ethers

Which means you then need to do require("@nomiclabs/hardhat-ethers") instead of require("hardhat-deploy-ethers") in your hardhat.config.js file.

Networks

Note that hardhat local chains and `mainnet forking chains are temporary as they are destoryed instantly at the completment of codes.


Usage of hardhat-deploy

Configuration

  1. Create a new folder called deploy where the executions of running yarn hardhat deploy will be defined

How to configure the version of solidity when there exist different version of solidity files to be compiled?


In hardhat.config.js file, one can change the configuration of solidity from one value (e.g. "^0.8.0") to a mapping object.

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.