From b476c681edbb1283363b466006f3d9c91d5acda6 Mon Sep 17 00:00:00 2001 From: Jared Flatow Date: Thu, 3 Mar 2022 18:03:52 -0800 Subject: [PATCH] Use viaIR Also pin `hardhat-etherscan` to 3.0.0 exactly, or else it bumps itself to 3.0.3 (currently). Once we upgrade there's a switch from `node-fetch` to `undici` which breaks our mocking. --- hardhat.config.ts | 3 +- package.json | 4 +-- yarn.lock | 83 ++++++++++++++++++++++++++++++----------------- 3 files changed, 56 insertions(+), 34 deletions(-) diff --git a/hardhat.config.ts b/hardhat.config.ts index 7323d7032..75d9b6669 100644 --- a/hardhat.config.ts +++ b/hardhat.config.ts @@ -116,8 +116,7 @@ const config: HardhatUserConfig = { "*": ["evm.deployedBytecode.sourceMap"] }, }, - // XXX for when we enable viaIR in a future merge: - //viaIR: process.env['OPTIMIZER_DISABLED'] ? false : true, + viaIR: process.env['OPTIMIZER_DISABLED'] ? false : true, }, }, diff --git a/package.json b/package.json index aa996dd17..39270b9eb 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,7 @@ "devDependencies": { "@compound-finance/hardhat-import": "^1.0.3", "@nomiclabs/hardhat-ethers": "^2.0.4", - "@nomiclabs/hardhat-etherscan": "^3.0.0", + "@nomiclabs/hardhat-etherscan": "3.0.0", "@nomiclabs/hardhat-waffle": "^2.0.2", "@typechain/ethers-v5": "^8.0.2", "@typechain/hardhat": "^3.0.0", @@ -39,7 +39,7 @@ "ethereum-waffle": "^3.4.0", "ethers": "^5.5.1", "fast-glob": "^3.2.7", - "hardhat": "2.8.3", + "hardhat": "https://github.com/jflatow/hardhat/releases/download/viaIR/hardhat-v2.8.4.tgz", "hardhat-contract-sizer": "^2.4.0", "hardhat-cover": "compound-finance/hardhat-cover", "hardhat-gas-reporter": "^1.0.7", diff --git a/yarn.lock b/yarn.lock index b3c125f8c..ac5a1f77b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -550,6 +550,17 @@ "@types/yargs" "^16.0.0" chalk "^4.0.0" +"@metamask/eth-sig-util@^4.0.0": + version "4.0.0" + resolved "https://registry.yarnpkg.com/@metamask/eth-sig-util/-/eth-sig-util-4.0.0.tgz#11553ba06de0d1352332c1bde28c8edd00e0dcf6" + integrity sha512-LczOjjxY4A7XYloxzyxJIHONELmUxVZncpOLoClpEcTiebiVdM46KRPYXGuULro9oNNR2xdVx3yoKiQjdfWmoA== + dependencies: + ethereumjs-abi "^0.6.8" + ethereumjs-util "^6.2.1" + ethjs-util "^0.1.6" + tweetnacl "^1.0.3" + tweetnacl-util "^0.15.1" + "@nodelib/fs.scandir@2.1.5": version "2.1.5" resolved "https://registry.yarnpkg.com/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz#7619c2eb21b25483f6d167548b4cfd5a7488c3d5" @@ -576,7 +587,7 @@ resolved "https://registry.yarnpkg.com/@nomiclabs/hardhat-ethers/-/hardhat-ethers-2.0.4.tgz#288889c338acaf47cabd29020e561d0077b7efcf" integrity sha512-7LMR344TkdCYkMVF9LuC9VU2NBIi84akQiwqm7OufpWaDgHbWhuanY53rk3SVAW0E4HBk5xn5wl5+bN5f+Mq5w== -"@nomiclabs/hardhat-etherscan@^3.0.0": +"@nomiclabs/hardhat-etherscan@3.0.0": version "3.0.0" resolved "https://registry.yarnpkg.com/@nomiclabs/hardhat-etherscan/-/hardhat-etherscan-3.0.0.tgz#06e0d59787f01f1296d829e8d43fece50e7ffff1" integrity sha512-E5s35dCHmzuY6pFqlgTdDGQr2xIyUJ3f91m6e7HYlPGz0FGzad9Nem/y0L7L3FHG4LPYg1UObkQVUzqBjtyAOA== @@ -735,6 +746,13 @@ dependencies: antlr4ts "^0.5.0-alpha.4" +"@solidity-parser/parser@^0.14.1": + version "0.14.1" + resolved "https://registry.yarnpkg.com/@solidity-parser/parser/-/parser-0.14.1.tgz#179afb29f4e295a77cc141151f26b3848abc3c46" + integrity sha512-eLjj2L6AuQjBB6s/ibwCAc0DwrR5Ge+ys+wgWo+bviU7fV2nTMQhU63CGaDKXg9iTmMxwhkyoggdIR7ZGRfMgw== + dependencies: + antlr4ts "^0.5.0-alpha.4" + "@szmarczak/http-timer@^1.1.2": version "1.1.2" resolved "https://registry.yarnpkg.com/@szmarczak/http-timer/-/http-timer-1.1.2.tgz#b1665e2c461a2cd92f4c1bbf50d5454de0d4b421" @@ -3652,7 +3670,7 @@ ethereumjs-util@6.2.0: rlp "^2.2.3" secp256k1 "^3.0.1" -ethereumjs-util@6.2.1, ethereumjs-util@^6.0.0, ethereumjs-util@^6.1.0, ethereumjs-util@^6.2.0: +ethereumjs-util@6.2.1, ethereumjs-util@^6.0.0, ethereumjs-util@^6.1.0, ethereumjs-util@^6.2.0, ethereumjs-util@^6.2.1: version "6.2.1" resolved "https://registry.yarnpkg.com/ethereumjs-util/-/ethereumjs-util-6.2.1.tgz#fcb4e4dd5ceacb9d2305426ab1a5cd93e3163b69" integrity sha512-W2Ktez4L01Vexijrm5EB6w7dg4n/TgpoYU4avuT5T3Vmnw/eCRtiBrJfQYS/DCSvDIOLn2k57GcHdeBcgVxAqw== @@ -3812,7 +3830,7 @@ ethjs-unit@0.1.6: bn.js "4.11.6" number-to-bn "1.7.0" -ethjs-util@0.1.6, ethjs-util@^0.1.3: +ethjs-util@0.1.6, ethjs-util@^0.1.3, ethjs-util@^0.1.6: version "0.1.6" resolved "https://registry.yarnpkg.com/ethjs-util/-/ethjs-util-0.1.6.tgz#f308b62f185f9fe6237132fb2a9818866a5cd536" integrity sha512-CUnVOQq7gSpDHZVVrQW8ExxUETWrnrvXYvYz55wOU8Uj4VCgw56XC2B/fVqQN+f7gmrnRHSLVnFAwsCuNwji8w== @@ -4538,16 +4556,16 @@ hardhat-gas-reporter@^1.0.7: eth-gas-reporter "^0.2.24" sha1 "^1.1.1" -hardhat@2.8.3: - version "2.8.3" - resolved "https://registry.yarnpkg.com/hardhat/-/hardhat-2.8.3.tgz#94cccc92d18c6361d9fbbc5d77a4fabf0166a396" - integrity sha512-VxqiVTSayRoeLHly8zKnlvtWoG8sroTP4vl8GHuj7OjfAdrHu4Blk7NBJ5+Rl8cmMEp6CuZtDaDmcHJIRTwEPA== +hardhat@^2.0.4: + version "2.7.0" + resolved "https://registry.yarnpkg.com/hardhat/-/hardhat-2.7.0.tgz#d8f01bc07bdd88ccaa00719ddb18618bc59a73b5" + integrity sha512-DqweY3KH5gwExoZ8EtsAfioj0Hk0NBXWXT3fMXWkiQNfyYBoZLrqdPNkbJ/E2LD4mZ+BKF7v/1chYR9ZCn2Z+g== dependencies: - "@ethereumjs/block" "^3.6.0" - "@ethereumjs/blockchain" "^5.5.0" - "@ethereumjs/common" "^2.6.0" - "@ethereumjs/tx" "^3.4.0" - "@ethereumjs/vm" "^5.6.0" + "@ethereumjs/block" "^3.4.0" + "@ethereumjs/blockchain" "^5.4.0" + "@ethereumjs/common" "^2.4.0" + "@ethereumjs/tx" "^3.3.0" + "@ethereumjs/vm" "^5.5.2" "@ethersproject/abi" "^5.1.2" "@sentry/node" "^5.18.1" "@solidity-parser/parser" "^0.14.0" @@ -4565,7 +4583,7 @@ hardhat@2.8.3: eth-sig-util "^2.5.2" ethereum-cryptography "^0.1.2" ethereumjs-abi "^0.6.8" - ethereumjs-util "^7.1.3" + ethereumjs-util "^7.1.0" find-up "^2.1.0" fp-ts "1.19.3" fs-extra "^7.0.1" @@ -4574,9 +4592,9 @@ hardhat@2.8.3: immutable "^4.0.0-rc.12" io-ts "1.10.4" lodash "^4.17.11" - merkle-patricia-tree "^4.2.2" + merkle-patricia-tree "^4.2.0" mnemonist "^0.38.0" - mocha "^7.2.0" + mocha "^7.1.2" node-fetch "^2.6.0" qs "^6.7.0" raw-body "^2.4.1" @@ -4591,19 +4609,19 @@ hardhat@2.8.3: uuid "^8.3.2" ws "^7.4.6" -hardhat@^2.0.4: - version "2.7.0" - resolved "https://registry.yarnpkg.com/hardhat/-/hardhat-2.7.0.tgz#d8f01bc07bdd88ccaa00719ddb18618bc59a73b5" - integrity sha512-DqweY3KH5gwExoZ8EtsAfioj0Hk0NBXWXT3fMXWkiQNfyYBoZLrqdPNkbJ/E2LD4mZ+BKF7v/1chYR9ZCn2Z+g== +"hardhat@https://github.com/jflatow/hardhat/releases/download/viaIR/hardhat-v2.8.4.tgz": + version "2.8.4" + resolved "https://github.com/jflatow/hardhat/releases/download/viaIR/hardhat-v2.8.4.tgz#3454382dcc8686e6167edf3d36208b5682a284d1" dependencies: - "@ethereumjs/block" "^3.4.0" - "@ethereumjs/blockchain" "^5.4.0" - "@ethereumjs/common" "^2.4.0" - "@ethereumjs/tx" "^3.3.0" - "@ethereumjs/vm" "^5.5.2" + "@ethereumjs/block" "^3.6.0" + "@ethereumjs/blockchain" "^5.5.0" + "@ethereumjs/common" "^2.6.0" + "@ethereumjs/tx" "^3.4.0" + "@ethereumjs/vm" "^5.6.0" "@ethersproject/abi" "^5.1.2" + "@metamask/eth-sig-util" "^4.0.0" "@sentry/node" "^5.18.1" - "@solidity-parser/parser" "^0.14.0" + "@solidity-parser/parser" "^0.14.1" "@types/bn.js" "^5.1.0" "@types/lru-cache" "^5.1.0" abort-controller "^3.0.0" @@ -4615,10 +4633,9 @@ hardhat@^2.0.4: debug "^4.1.1" enquirer "^2.3.0" env-paths "^2.2.0" - eth-sig-util "^2.5.2" ethereum-cryptography "^0.1.2" ethereumjs-abi "^0.6.8" - ethereumjs-util "^7.1.0" + ethereumjs-util "^7.1.3" find-up "^2.1.0" fp-ts "1.19.3" fs-extra "^7.0.1" @@ -4627,9 +4644,9 @@ hardhat@^2.0.4: immutable "^4.0.0-rc.12" io-ts "1.10.4" lodash "^4.17.11" - merkle-patricia-tree "^4.2.0" + merkle-patricia-tree "^4.2.2" mnemonist "^0.38.0" - mocha "^7.1.2" + mocha "^7.2.0" node-fetch "^2.6.0" qs "^6.7.0" raw-body "^2.4.1" @@ -4641,6 +4658,7 @@ hardhat@^2.0.4: stacktrace-parser "^0.1.10" "true-case-path" "^2.2.1" tsort "0.0.1" + undici "^4.13.0" uuid "^8.3.2" ws "^7.4.6" @@ -8460,7 +8478,7 @@ tunnel-agent@^0.6.0: dependencies: safe-buffer "^5.0.1" -tweetnacl-util@^0.15.0: +tweetnacl-util@^0.15.0, tweetnacl-util@^0.15.1: version "0.15.1" resolved "https://registry.yarnpkg.com/tweetnacl-util/-/tweetnacl-util-0.15.1.tgz#b80fcdb5c97bcc508be18c44a4be50f022eea00b" integrity sha512-RKJBIj8lySrShN4w6i/BonWp2Z/uxwC3h4y7xsRrpP59ZboCd0GpEVsOnMDYLMmKBpYhb5TgHzZXy7wTfYFBRw== @@ -8613,6 +8631,11 @@ underscore@1.9.1: resolved "https://registry.yarnpkg.com/underscore/-/underscore-1.9.1.tgz#06dce34a0e68a7babc29b365b8e74b8925203961" integrity sha512-5/4etnCkd9c8gwgowi5/om/mYO5ajCaOgdzj/oW+0eQV9WxKBDZw5+ycmKmeaTXjInS/W0BzpGLo2xR2aBwZdg== +undici@^4.13.0: + version "4.16.0" + resolved "https://registry.yarnpkg.com/undici/-/undici-4.16.0.tgz#469bb87b3b918818d3d7843d91a1d08da357d5ff" + integrity sha512-tkZSECUYi+/T1i4u+4+lwZmQgLXd4BLGlrc7KZPcLIW7Jpq99+Xpc30ONv7nS6F5UNOxp/HBZSSL9MafUrvJbw== + union-value@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/union-value/-/union-value-1.0.1.tgz#0b6fe7b835aecda61c6ea4d4f02c14221e109847"