浏览代码

feat: upgrade to solc@0.8.1

build: upgrade hardhat and its plugins to the latest version
Paul Razvan Berg 4 年之前
父节点
当前提交
98fbf71e87
共有 5 个文件被更改,包括 47 次插入46 次删除
  1. 1 1
      .solhint.json
  2. 1 2
      contracts/Greeter.sol
  3. 1 1
      hardhat.config.ts
  4. 7 5
      package.json
  5. 37 37
      yarn.lock

+ 1 - 1
.solhint.json

@@ -3,7 +3,7 @@
   "plugins": ["prettier"],
   "plugins": ["prettier"],
   "rules": {
   "rules": {
     "code-complexity": ["error", 7],
     "code-complexity": ["error", 7],
-    "compiler-version": ["error", "^0.7.0"],
+    "compiler-version": ["error", "^0.8.0"],
     "const-name-snakecase": "off",
     "const-name-snakecase": "off",
     "constructor-syntax": "error",
     "constructor-syntax": "error",
     "func-visibility": ["error", { "ignoreConstructors": true }],
     "func-visibility": ["error", { "ignoreConstructors": true }],

+ 1 - 2
contracts/Greeter.sol

@@ -1,6 +1,5 @@
 // SPDX-License-Identifier: MIT
 // SPDX-License-Identifier: MIT
-
-pragma solidity ^0.7.0;
+pragma solidity ^0.8.0;
 
 
 import "hardhat/console.sol";
 import "hardhat/console.sol";
 
 

+ 1 - 1
hardhat.config.ts

@@ -71,7 +71,7 @@ const config: HardhatUserConfig = {
     tests: "./test",
     tests: "./test",
   },
   },
   solidity: {
   solidity: {
-    version: "0.7.4",
+    version: "0.8.1",
     settings: {
     settings: {
       // https://hardhat.org/hardhat-network/#solidity-optimizer-support
       // https://hardhat.org/hardhat-network/#solidity-optimizer-support
       optimizer: {
       optimizer: {

+ 7 - 5
package.json

@@ -11,8 +11,8 @@
     "@commitlint/config-conventional": "^9.1.2",
     "@commitlint/config-conventional": "^9.1.2",
     "@ethersproject/abstract-signer": "^5.0.6",
     "@ethersproject/abstract-signer": "^5.0.6",
     "@ethersproject/bignumber": "^5.0.8",
     "@ethersproject/bignumber": "^5.0.8",
-    "@nomiclabs/hardhat-ethers": "^2.0.0",
-    "@nomiclabs/hardhat-waffle": "^2.0.0",
+    "@nomiclabs/hardhat-ethers": "^2.0.1",
+    "@nomiclabs/hardhat-waffle": "^2.0.1",
     "@typechain/ethers-v5": "^5.0.0",
     "@typechain/ethers-v5": "^5.0.0",
     "@types/chai": "^4.2.13",
     "@types/chai": "^4.2.13",
     "@types/fs-extra": "^9.0.1",
     "@types/fs-extra": "^9.0.1",
@@ -29,14 +29,13 @@
     "ethereum-waffle": "^3.2.0",
     "ethereum-waffle": "^3.2.0",
     "ethers": "^5.0.24",
     "ethers": "^5.0.24",
     "fs-extra": "^9.0.1",
     "fs-extra": "^9.0.1",
-    "hardhat": "^2.0.6",
-    "hardhat-typechain": "^0.3.4",
+    "hardhat": "^2.0.10",
+    "hardhat-typechain": "^0.3.5",
     "husky": "^4.3.0",
     "husky": "^4.3.0",
     "mocha": "^8.1.3",
     "mocha": "^8.1.3",
     "prettier": "^2.1.2",
     "prettier": "^2.1.2",
     "prettier-plugin-solidity": "^1.0.0-beta.1",
     "prettier-plugin-solidity": "^1.0.0-beta.1",
     "shelljs": "^0.8.4",
     "shelljs": "^0.8.4",
-    "solc": "0.7.4",
     "solhint": "^3.2.1",
     "solhint": "^3.2.1",
     "solhint-plugin-prettier": "^0.0.5",
     "solhint-plugin-prettier": "^0.0.5",
     "solidity-coverage": "^0.7.12",
     "solidity-coverage": "^0.7.12",
@@ -71,5 +70,8 @@
     "prettier:list-different": "prettier --config .prettierrc --list-different \"**/*.{js,json,md,sol,ts}\"",
     "prettier:list-different": "prettier --config .prettierrc --list-different \"**/*.{js,json,md,sol,ts}\"",
     "test": "hardhat test",
     "test": "hardhat test",
     "typechain": "hardhat typechain"
     "typechain": "hardhat typechain"
+  },
+  "dependencies": {
+    "solc": "0.8.1"
   }
   }
 }
 }

+ 37 - 37
yarn.lock

@@ -986,10 +986,10 @@
     "@nodelib/fs.scandir" "2.1.3"
     "@nodelib/fs.scandir" "2.1.3"
     fastq "^1.6.0"
     fastq "^1.6.0"
 
 
-"@nomiclabs/ethereumjs-vm@^4.1.1":
-  version "4.2.0"
-  resolved "https://registry.yarnpkg.com/@nomiclabs/ethereumjs-vm/-/ethereumjs-vm-4.2.0.tgz#a853bdb4fb032529f810f32bb767551d19d7ce57"
-  integrity sha512-+XwqoO941bILTO4KDLIUJ37U42ySxw6it7jyoi0tKv0/VUcOrWKF1TCQWMv6dBDRlxpPQd273n9o5SVlYYLRWQ==
+"@nomiclabs/ethereumjs-vm@4.2.2":
+  version "4.2.2"
+  resolved "https://registry.npmjs.org/@nomiclabs/ethereumjs-vm/-/ethereumjs-vm-4.2.2.tgz#2f8817113ca0fb6c44c1b870d0a809f0e026a6cc"
+  integrity sha512-8WmX94mMcJaZ7/m7yBbyuS6B+wuOul+eF+RY9fBpGhNaUpyMR/vFIcDojqcWQ4Yafe1tMKY5LDu2yfT4NZgV4Q==
   dependencies:
   dependencies:
     async "^2.1.2"
     async "^2.1.2"
     async-eventemitter "^0.2.2"
     async-eventemitter "^0.2.2"
@@ -1002,20 +1002,20 @@
     ethereumjs-util "^6.2.0"
     ethereumjs-util "^6.2.0"
     fake-merkle-patricia-tree "^1.0.1"
     fake-merkle-patricia-tree "^1.0.1"
     functional-red-black-tree "^1.0.1"
     functional-red-black-tree "^1.0.1"
-    merkle-patricia-tree "^2.3.2"
+    merkle-patricia-tree "3.0.0"
     rustbn.js "~0.2.0"
     rustbn.js "~0.2.0"
     safe-buffer "^5.1.1"
     safe-buffer "^5.1.1"
     util.promisify "^1.0.0"
     util.promisify "^1.0.0"
 
 
-"@nomiclabs/hardhat-ethers@^2.0.0":
-  version "2.0.0"
-  resolved "https://registry.yarnpkg.com/@nomiclabs/hardhat-ethers/-/hardhat-ethers-2.0.0.tgz#ebab032b3aed03945ea560f56bb67aec56a30cbc"
-  integrity sha512-fIi6XP9PgKqwSNVcLDr6S5hvGlc21PendaLD5eGdXEXc9aYQ0OJX8Mk3evs+p78x7W9n9U3ZcKtTiGc1+YScDw==
+"@nomiclabs/hardhat-ethers@^2.0.1":
+  version "2.0.1"
+  resolved "https://registry.npmjs.org/@nomiclabs/hardhat-ethers/-/hardhat-ethers-2.0.1.tgz#f86a6fa210dbe6270adffccc75e93ed60a856904"
+  integrity sha512-uTFHDhhvJ+UjfvvMeQxD3ZALuzuI3FXzTYT1Z5N3ebyZL5z4Ogwt55GB0R9tdKY0p5HhDhBjU/gsCjUEwIVoaw==
 
 
-"@nomiclabs/hardhat-waffle@^2.0.0":
-  version "2.0.0"
-  resolved "https://registry.yarnpkg.com/@nomiclabs/hardhat-waffle/-/hardhat-waffle-2.0.0.tgz#b06533c802da1a9d614e432f719d2816384df9b3"
-  integrity sha512-CnG9JC0rgqa68LTgyETxBUEWYAovvNGVs5abqaXjG80eF7iMLjDjM8IjOM87siAaxaxFCf6VBMJmtueqVq7jZw==
+"@nomiclabs/hardhat-waffle@^2.0.1":
+  version "2.0.1"
+  resolved "https://registry.npmjs.org/@nomiclabs/hardhat-waffle/-/hardhat-waffle-2.0.1.tgz#5d43654fba780720c5033dea240fe14f70ef4bd2"
+  integrity sha512-2YR2V5zTiztSH9n8BYWgtv3Q+EL0N5Ltm1PAr5z20uAY4SkkfylJ98CIqt18XFvxTD5x4K2wKBzddjV9ViDAZQ==
   dependencies:
   dependencies:
     "@types/sinon-chai" "^3.2.3"
     "@types/sinon-chai" "^3.2.3"
     "@types/web3" "1.0.19"
     "@types/web3" "1.0.19"
@@ -1130,10 +1130,10 @@
   resolved "https://registry.yarnpkg.com/@sindresorhus/is/-/is-0.14.0.tgz#9fb3a3cf3132328151f353de4632e01e52102bea"
   resolved "https://registry.yarnpkg.com/@sindresorhus/is/-/is-0.14.0.tgz#9fb3a3cf3132328151f353de4632e01e52102bea"
   integrity sha512-9NET910DNaIPngYnLLPeg+Ogzqsi9uM4mSboU5y6p8S5DzMTVEsJZrawi+BoDNUVBa2DhJqQYUFvMDfgU062LQ==
   integrity sha512-9NET910DNaIPngYnLLPeg+Ogzqsi9uM4mSboU5y6p8S5DzMTVEsJZrawi+BoDNUVBa2DhJqQYUFvMDfgU062LQ==
 
 
-"@solidity-parser/parser@^0.7.1":
-  version "0.7.1"
-  resolved "https://registry.yarnpkg.com/@solidity-parser/parser/-/parser-0.7.1.tgz#660210130e4237476cb55e2882064809f80f861e"
-  integrity sha512-5ma2uuwPAEX1TPl2rAPAAuGlBkKnn2oUKQvnhTFlDIB8U/KDWX77FpHtL6Rcz+OwqSCWx9IClxACgyIEJ/GhIw==
+"@solidity-parser/parser@^0.11.0":
+  version "0.11.1"
+  resolved "https://registry.npmjs.org/@solidity-parser/parser/-/parser-0.11.1.tgz#fa840af64840c930f24a9c82c08d4a092a068add"
+  integrity sha512-H8BSBoKE8EubJa0ONqecA2TviT3TnHeC4NpgnAHSUiuhZoQBfPB4L2P9bs8R6AoTW10Endvh3vc+fomVMIDIYQ==
 
 
 "@solidity-parser/parser@^0.8.1":
 "@solidity-parser/parser@^0.8.1":
   version "0.8.1"
   version "0.8.1"
@@ -4178,7 +4178,7 @@ ethereumjs-account@^2.0.3:
     rlp "^2.0.0"
     rlp "^2.0.0"
     safe-buffer "^5.1.1"
     safe-buffer "^5.1.1"
 
 
-ethereumjs-block@2.2.2, ethereumjs-block@^2.2.0, ethereumjs-block@^2.2.2, ethereumjs-block@~2.2.0, ethereumjs-block@~2.2.2:
+ethereumjs-block@2.2.2, ethereumjs-block@^2.2.2, ethereumjs-block@~2.2.0, ethereumjs-block@~2.2.2:
   version "2.2.2"
   version "2.2.2"
   resolved "https://registry.yarnpkg.com/ethereumjs-block/-/ethereumjs-block-2.2.2.tgz#c7654be7e22df489fda206139ecd63e2e9c04965"
   resolved "https://registry.yarnpkg.com/ethereumjs-block/-/ethereumjs-block-2.2.2.tgz#c7654be7e22df489fda206139ecd63e2e9c04965"
   integrity sha512-2p49ifhek3h2zeg/+da6XpdFR3GlqY3BIEiqxGF8j9aSRIgkb7M1Ky+yULBKJOu8PAZxfhsYA+HxUk2aCQp3vg==
   integrity sha512-2p49ifhek3h2zeg/+da6XpdFR3GlqY3BIEiqxGF8j9aSRIgkb7M1Ky+yULBKJOu8PAZxfhsYA+HxUk2aCQp3vg==
@@ -5292,19 +5292,19 @@ hard-rejection@^2.1.0:
   resolved "https://registry.yarnpkg.com/hard-rejection/-/hard-rejection-2.1.0.tgz#1c6eda5c1685c63942766d79bb40ae773cecd883"
   resolved "https://registry.yarnpkg.com/hard-rejection/-/hard-rejection-2.1.0.tgz#1c6eda5c1685c63942766d79bb40ae773cecd883"
   integrity sha512-VIZB+ibDhx7ObhAe7OVtoEbuP4h/MuOTHJ+J8h/eBXotJYl0fBgR72xDFCKgIh22OJZIOVNxBMWuhAr10r8HdA==
   integrity sha512-VIZB+ibDhx7ObhAe7OVtoEbuP4h/MuOTHJ+J8h/eBXotJYl0fBgR72xDFCKgIh22OJZIOVNxBMWuhAr10r8HdA==
 
 
-hardhat-typechain@^0.3.4:
-  version "0.3.4"
-  resolved "https://registry.npmjs.org/hardhat-typechain/-/hardhat-typechain-0.3.4.tgz#6d7d86184152b5a3c83bde0fbbb26224b6fbfd70"
-  integrity sha512-oI9YSutDfZnRlAV1bYTpLkBHw4rkhz9JDWAEXz2PR34ylpgLWxPFbPiHT5QXadGTlBqJUAT6JSTxCK1kADMkjA==
+hardhat-typechain@^0.3.5:
+  version "0.3.5"
+  resolved "https://registry.npmjs.org/hardhat-typechain/-/hardhat-typechain-0.3.5.tgz#8e50616a9da348b33bd001168c8fda9c66b7b4af"
+  integrity sha512-w9lm8sxqTJACY+V7vijiH+NkPExnmtiQEjsV9JKD1KgMdVk2q8y+RhvU/c4B7+7b1+HylRUCxpOIvFuB3rE4+w==
 
 
-hardhat@^2.0.6:
-  version "2.0.6"
-  resolved "https://registry.npmjs.org/hardhat/-/hardhat-2.0.6.tgz#51f161e00b3c03f03fbf32027009d0ca50ad56db"
-  integrity sha512-wFTamcSUBMGwpgFxWu7ptg5o07FQyr8Ce8072rzE+QjpwM0uD3GRdhlqn+O1w+awQZ7AhK44njpAoRPUelOf/Q==
+hardhat@^2.0.10:
+  version "2.0.10"
+  resolved "https://registry.npmjs.org/hardhat/-/hardhat-2.0.10.tgz#9b50da13b6915bb9b61b7f38f8f2b9b352447462"
+  integrity sha512-ZAcC+9Nb1AEb22/2hWj/zLPyIRLD9y1O3LW2KhbONpxn1bf0qWLW8QegB9J3KP9Bvt8LbW9pWuSyRQJU0vUWqA==
   dependencies:
   dependencies:
-    "@nomiclabs/ethereumjs-vm" "^4.1.1"
+    "@nomiclabs/ethereumjs-vm" "4.2.2"
     "@sentry/node" "^5.18.1"
     "@sentry/node" "^5.18.1"
-    "@solidity-parser/parser" "^0.7.1"
+    "@solidity-parser/parser" "^0.11.0"
     "@types/bn.js" "^4.11.5"
     "@types/bn.js" "^4.11.5"
     "@types/lru-cache" "^5.1.0"
     "@types/lru-cache" "^5.1.0"
     abort-controller "^3.0.0"
     abort-controller "^3.0.0"
@@ -5320,10 +5320,10 @@ hardhat@^2.0.6:
     ethereum-cryptography "^0.1.2"
     ethereum-cryptography "^0.1.2"
     ethereumjs-abi "^0.6.8"
     ethereumjs-abi "^0.6.8"
     ethereumjs-account "^3.0.0"
     ethereumjs-account "^3.0.0"
-    ethereumjs-block "^2.2.0"
+    ethereumjs-block "^2.2.2"
     ethereumjs-common "^1.5.0"
     ethereumjs-common "^1.5.0"
-    ethereumjs-tx "^2.1.1"
-    ethereumjs-util "^6.1.0"
+    ethereumjs-tx "^2.1.2"
+    ethereumjs-util "^6.2.0"
     find-up "^2.1.0"
     find-up "^2.1.0"
     fp-ts "1.19.3"
     fp-ts "1.19.3"
     fs-extra "^7.0.1"
     fs-extra "^7.0.1"
@@ -5331,7 +5331,7 @@ hardhat@^2.0.6:
     immutable "^4.0.0-rc.12"
     immutable "^4.0.0-rc.12"
     io-ts "1.10.4"
     io-ts "1.10.4"
     lodash "^4.17.11"
     lodash "^4.17.11"
-    merkle-patricia-tree "^3.0.0"
+    merkle-patricia-tree "3.0.0"
     mocha "^7.1.2"
     mocha "^7.1.2"
     node-fetch "^2.6.0"
     node-fetch "^2.6.0"
     qs "^6.7.0"
     qs "^6.7.0"
@@ -6709,7 +6709,7 @@ merge@^1.2.1:
   resolved "https://registry.yarnpkg.com/merge/-/merge-1.2.1.tgz#38bebf80c3220a8a487b6fcfb3941bb11720c145"
   resolved "https://registry.yarnpkg.com/merge/-/merge-1.2.1.tgz#38bebf80c3220a8a487b6fcfb3941bb11720c145"
   integrity sha512-VjFo4P5Whtj4vsLzsYBu5ayHhoHJ0UqNm7ibvShmbmoz7tGi0vXaoJbGdB+GmDMLUdg8DpQXEIeVDAe8MaABvQ==
   integrity sha512-VjFo4P5Whtj4vsLzsYBu5ayHhoHJ0UqNm7ibvShmbmoz7tGi0vXaoJbGdB+GmDMLUdg8DpQXEIeVDAe8MaABvQ==
 
 
-merkle-patricia-tree@3.0.0, merkle-patricia-tree@^3.0.0:
+merkle-patricia-tree@3.0.0:
   version "3.0.0"
   version "3.0.0"
   resolved "https://registry.yarnpkg.com/merkle-patricia-tree/-/merkle-patricia-tree-3.0.0.tgz#448d85415565df72febc33ca362b8b614f5a58f8"
   resolved "https://registry.yarnpkg.com/merkle-patricia-tree/-/merkle-patricia-tree-3.0.0.tgz#448d85415565df72febc33ca362b8b614f5a58f8"
   integrity sha512-soRaMuNf/ILmw3KWbybaCjhx86EYeBbD8ph0edQCTed0JN/rxDt1EBN52Ajre3VyGo+91f8+/rfPIRQnnGMqmQ==
   integrity sha512-soRaMuNf/ILmw3KWbybaCjhx86EYeBbD8ph0edQCTed0JN/rxDt1EBN52Ajre3VyGo+91f8+/rfPIRQnnGMqmQ==
@@ -8632,10 +8632,10 @@ solc@0.7.3:
     semver "^5.5.0"
     semver "^5.5.0"
     tmp "0.0.33"
     tmp "0.0.33"
 
 
-solc@0.7.4:
-  version "0.7.4"
-  resolved "https://registry.npmjs.org/solc/-/solc-0.7.4.tgz#9c5ed81ae0692e3e614e47cd5b500b0f9485b98d"
-  integrity sha512-IVLqAfUkJqgTS0JIgFPeC50ehUeBXu2eE+iU+rqb6UeOyf6w/BB/EsNcTSTpjtUti8BTG/sCd2qVhrWVYy7p0g==
+solc@0.8.1:
+  version "0.8.1"
+  resolved "https://registry.npmjs.org/solc/-/solc-0.8.1.tgz#cbdba8fea6fbfae463f382cecb59c51de0269472"
+  integrity sha512-rqB8wlL20I/k+ibCgNGqXaoXBngKTUb3JCsCazwEvxJ9C9RcXNGRsiqgB1xZs37IjINMp0E3xGiuMjGYTBQnUg==
   dependencies:
   dependencies:
     command-exists "^1.2.8"
     command-exists "^1.2.8"
     commander "3.0.2"
     commander "3.0.2"