From f72c22289c381c49bee0a7b191f8aad7e363496e Mon Sep 17 00:00:00 2001 From: "F. Eugene Aumson" Date: Thu, 28 Oct 2021 10:01:46 -0600 Subject: [PATCH 1/3] Support Solidity 0.8.6 --- docs/reference/solidity-support.md | 2 +- .../internal/hardhat-network/stack-traces/solidityTracer.ts | 2 +- .../solidity-config-warnings/multiple-unsupported-solc.js | 4 ++-- .../solidity-config-warnings/unsupported-new-solc.js | 2 +- .../solidity-config-warnings/unsupported-solc-in-override.js | 2 +- .../test/internal/hardhat-network/stack-traces/test.ts | 4 ++++ 6 files changed, 10 insertions(+), 6 deletions(-) diff --git a/docs/reference/solidity-support.md b/docs/reference/solidity-support.md index 40cc44e8c9..aedf099769 100644 --- a/docs/reference/solidity-support.md +++ b/docs/reference/solidity-support.md @@ -13,7 +13,7 @@ These are the versions of Solidity that you can expect to fully work with Hardha - Any 0.5.x version starting from 0.5.1 - Any 0.6.x version - Any 0.7.x version -- Any 0.8.x version up to and including 0.8.5 +- Any 0.8.x version up to and including 0.8.6 We recommend against using Hardhat with newer, unsupported versions of Solidity. But if you need to do so; please read on. diff --git a/packages/hardhat-core/src/internal/hardhat-network/stack-traces/solidityTracer.ts b/packages/hardhat-core/src/internal/hardhat-network/stack-traces/solidityTracer.ts index 148a170cde..9a10a0e31c 100644 --- a/packages/hardhat-core/src/internal/hardhat-network/stack-traces/solidityTracer.ts +++ b/packages/hardhat-core/src/internal/hardhat-network/stack-traces/solidityTracer.ts @@ -31,7 +31,7 @@ import { StackTraceEntryType, } from "./solidity-stack-trace"; -export const SUPPORTED_SOLIDITY_VERSION_RANGE = "<=0.8.5"; +export const SUPPORTED_SOLIDITY_VERSION_RANGE = "<=0.8.6"; export const FIRST_SOLC_VERSION_SUPPORTED = "0.5.1"; export class SolidityTracer { diff --git a/packages/hardhat-core/test/fixture-projects/solidity-config-warnings/multiple-unsupported-solc.js b/packages/hardhat-core/test/fixture-projects/solidity-config-warnings/multiple-unsupported-solc.js index 60511addee..f76c051130 100644 --- a/packages/hardhat-core/test/fixture-projects/solidity-config-warnings/multiple-unsupported-solc.js +++ b/packages/hardhat-core/test/fixture-projects/solidity-config-warnings/multiple-unsupported-solc.js @@ -2,10 +2,10 @@ module.exports = { solidity: { compilers: [ { - version: "0.8.6", + version: "0.8.7", }, { - version: "0.8.7", + version: "0.8.8", }, ], }, diff --git a/packages/hardhat-core/test/fixture-projects/solidity-config-warnings/unsupported-new-solc.js b/packages/hardhat-core/test/fixture-projects/solidity-config-warnings/unsupported-new-solc.js index f680b3981d..cdc7d0e8ae 100644 --- a/packages/hardhat-core/test/fixture-projects/solidity-config-warnings/unsupported-new-solc.js +++ b/packages/hardhat-core/test/fixture-projects/solidity-config-warnings/unsupported-new-solc.js @@ -1,3 +1,3 @@ module.exports = { - solidity: "0.8.6", + solidity: "0.8.7", }; diff --git a/packages/hardhat-core/test/fixture-projects/solidity-config-warnings/unsupported-solc-in-override.js b/packages/hardhat-core/test/fixture-projects/solidity-config-warnings/unsupported-solc-in-override.js index bc602fdff2..eb33770aca 100644 --- a/packages/hardhat-core/test/fixture-projects/solidity-config-warnings/unsupported-solc-in-override.js +++ b/packages/hardhat-core/test/fixture-projects/solidity-config-warnings/unsupported-solc-in-override.js @@ -6,7 +6,7 @@ module.exports = { }, ], overrides: { - "contracts/Foo.sol": { version: "0.8.6" }, + "contracts/Foo.sol": { version: "0.8.7" }, }, }, }; diff --git a/packages/hardhat-core/test/internal/hardhat-network/stack-traces/test.ts b/packages/hardhat-core/test/internal/hardhat-network/stack-traces/test.ts index cea47eccf9..fabbf788b6 100644 --- a/packages/hardhat-core/test/internal/hardhat-network/stack-traces/test.ts +++ b/packages/hardhat-core/test/internal/hardhat-network/stack-traces/test.ts @@ -741,6 +741,10 @@ const solidityCompilers = [ solidityVersion: "0.8.5", compilerPath: "soljson-v0.8.5+commit.a4f2e591.js", }, + { + solidityVersion: "0.8.6", + compilerPath: "soljson-v0.8.6+commit.11564f7e.js", + }, ]; const solidity05Compilers = solidityCompilers.filter(({ solidityVersion }) => From ae974a208c114b32384b71efd95ef8a06ea6d478 Mon Sep 17 00:00:00 2001 From: "F. Eugene Aumson" Date: Mon, 1 Nov 2021 08:12:45 -0600 Subject: [PATCH 2/3] test: loosen `closeTo()` decimal accuracy --- .../test/internal/hardhat-network/provider/forked-provider.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/hardhat-core/test/internal/hardhat-network/provider/forked-provider.ts b/packages/hardhat-core/test/internal/hardhat-network/provider/forked-provider.ts index b3d71931a6..eb3dae95a8 100644 --- a/packages/hardhat-core/test/internal/hardhat-network/provider/forked-provider.ts +++ b/packages/hardhat-core/test/internal/hardhat-network/provider/forked-provider.ts @@ -562,7 +562,7 @@ describe("Forked provider", function () { ); assert.equal(daiAfter.toString(), expectedDai.toString()); - assert.closeTo(ethLost, 0.5, 0.01); + assert.closeTo(ethLost, 0.5, 0.02); }); }); }); From c501e1ecb9effd0fdbdc2ea3f9960e3fd8f48e5a Mon Sep 17 00:00:00 2001 From: "F. Eugene Aumson" Date: Mon, 1 Nov 2021 09:00:39 -0600 Subject: [PATCH 3/3] Add changeset --- .changeset/lazy-bears-fly.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/lazy-bears-fly.md diff --git a/.changeset/lazy-bears-fly.md b/.changeset/lazy-bears-fly.md new file mode 100644 index 0000000000..9c48340efa --- /dev/null +++ b/.changeset/lazy-bears-fly.md @@ -0,0 +1,5 @@ +--- +"hardhat": patch +--- + +Added support for Solidity 0.8.6.