GithubHelp home page GithubHelp logo

hardhat's Introduction

Get Start

$ mkdir Greeting
$ cd Greeting
$ yarn init  # 包管理
$ yarn add --dev hardhat
$ npx hardhat # 初始化项目
$ npx hardhat compile  # 编译
$ yarn add @openzeppelin/[email protected] # 安装OpenZeppelin(指定版本)

After doing this running hh will be equivalent to running npx hardhat. For example, instead of running npx hardhat compile you can run hh compile.

$ npx hardhat test
# equivalent to
$ hh test

list_function 外部检查函数生成

在项目的根目录下复制工具文件 list_functions ,然后在根目录下执行 ./list_functions 合约存放地址

$ ./list_functions -h   # help

例如:

liuxi@liuxideMacBook-Pro PNB % ./list_functions contracts/PinkBNB.sol
zsh: permission denied: ./list_functions
# 解决权限问题
liuxi@liuxideMacBook-Pro PNB % chmod +x ./list_functions
liuxi@liuxideMacBook-Pro PNB % ./list_functions contracts/PinkBNB.sol
Success! The result is written to PinkBNB.sol.md
# 被写入到根目录下了

Hardhat 常用功能命令

npx hardhat flatten contracts/Foo.sol > Flattened.sol # 导出单一文件命令

OpenZeppelin - Solidity 版本对应关系

OpenZeppelin Doc: https://docs.openzeppelin.com/contracts/4.x/

Solidity OpenZeppelin
0.5.x 2.3.x - 2.5.x
0.6.x 3.0.x - 3.1.x 或 3.4
0.7.x 3.2.x - 3.3.x 或 3.4
0.8.x 4.0.x - 4.5.x

OpenZeppelin v3.4 兼容 sol v0.6 和 sol v0.7

hardhat's People

Contributors

lxiiiixi avatar

Watchers

 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.