Skip to content

Commit

Permalink
Merge pull request NomicFoundation#1962 from nomiclabs/solidity-0.8.5
Browse files Browse the repository at this point in the history
Support Solidity 0.8.5
  • Loading branch information
feuGeneA authored Oct 22, 2021
2 parents b9e6b92 + c7493e0 commit 08f3705
Show file tree
Hide file tree
Showing 8 changed files with 34 additions and 10 deletions.
5 changes: 5 additions & 0 deletions .changeset/ten-swans-wave.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"hardhat": patch
---

Add support for Solidity 0.8.5.
2 changes: 1 addition & 1 deletion docs/reference/solidity-support.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.4
- Any 0.8.x version up to and including 0.8.5

We recommend against using Hardhat with newer, unsupported versions of Solidity. But if you need to do so; please read on.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,25 @@ export class ErrorInferrer {
return true;
}

// look TWO frames ahead to determine if this is a specific occurrence of
// a redundant CALLSTACK_ENTRY frame observed when using Solidity 0.8.5:
if (
frame.type === StackTraceEntryType.CALLSTACK_ENTRY &&
i + 2 < stacktrace.length &&
stacktrace[i + 2].sourceReference !== undefined &&
stacktrace[i + 2].type === StackTraceEntryType.RETURNDATA_SIZE_ERROR
) {
// ! below for tsc. we confirmed existence in the enclosing conditional.
const thatSrcRef = stacktrace[i + 2].sourceReference!;
if (
frame.sourceReference.range[0] === thatSrcRef.range[0] &&
frame.sourceReference.range[1] === thatSrcRef.range[1] &&
frame.sourceReference.line === thatSrcRef.line
) {
return false;
}
}

// constructors contain the whole contract, so we ignore them
if (
frame.sourceReference.function === "constructor" &&
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import {
StackTraceEntryType,
} from "./solidity-stack-trace";

export const SUPPORTED_SOLIDITY_VERSION_RANGE = "<=0.8.4";
export const SUPPORTED_SOLIDITY_VERSION_RANGE = "<=0.8.5";
export const FIRST_SOLC_VERSION_SUPPORTED = "0.5.1";

export class SolidityTracer {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ module.exports = {
solidity: {
compilers: [
{
version: "0.8.5",
version: "0.8.6",
},
{
version: "0.8.6",
version: "0.8.7",
},
],
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module.exports = {
solidity: "0.8.5",
solidity: "0.8.6",
};
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ module.exports = {
},
],
overrides: {
"contracts/Foo.sol": { version: "0.8.5" },
"contracts/Foo.sol": { version: "0.8.6" },
},
},
};
Original file line number Diff line number Diff line change
Expand Up @@ -737,10 +737,10 @@ const solidityCompilers = [
solidityVersion: "0.8.4",
compilerPath: "soljson-v0.8.4+commit.c7e474f2.js",
},
// {
// solidityVersion: "0.8.5",
// compilerPath: "soljson-v0.8.5+commit.a4f2e591.js",
// },
{
solidityVersion: "0.8.5",
compilerPath: "soljson-v0.8.5+commit.a4f2e591.js",
},
];

const solidity05Compilers = solidityCompilers.filter(({ solidityVersion }) =>
Expand Down

0 comments on commit 08f3705

Please sign in to comment.