Skip to content

Commit 74b1bfe

Browse files
authored
Merge pull request #5740 from NomicFoundation/support-solc-0.8.27
feat: add support for solc versions 0.8.25, 0.8.26, and 0.8.27
2 parents d725c09 + 0e30f4c commit 74b1bfe

File tree

19 files changed

+67
-23
lines changed

19 files changed

+67
-23
lines changed

.changeset/dull-icons-float.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"hardhat": patch
3+
---
4+
5+
Added support for solc versions 0.8.25, 0.8.26, and 0.8.27

docs/src/content/hardhat-runner/docs/reference/solidity-support.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ These are the versions of Solidity that you can expect to fully work with Hardha
1313
- Any 0.5.x version starting from 0.5.1
1414
- Any 0.6.x version
1515
- Any 0.7.x version
16-
- Any 0.8.x version up to and including 0.8.24
16+
- Any 0.8.x version up to and including 0.8.27
1717

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

docs/src/model/markdown.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ export const withoutComments = (content: string) => {
104104
};
105105

106106
export const replacePlaceholders = (content: string) => {
107-
const recommendedSolcVersion = "0.8.24";
107+
const recommendedSolcVersion = "0.8.27";
108108
const latestPragma = "^0.8.0";
109109
const hardhatPackageJson = fs
110110
.readFileSync(

packages/hardhat-core/sample-projects/javascript-esm/contracts/Lock.sol

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// SPDX-License-Identifier: UNLICENSED
2-
pragma solidity ^0.8.24;
2+
pragma solidity ^0.8.27;
33

44
// Uncomment this line to use console.log
55
// import "hardhat/console.sol";

packages/hardhat-core/sample-projects/javascript-esm/hardhat.config.cjs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@ require("@nomicfoundation/hardhat-toolbox");
22

33
/** @type import('hardhat/config').HardhatUserConfig */
44
module.exports = {
5-
solidity: "0.8.24",
5+
solidity: "0.8.27",
66
};

packages/hardhat-core/sample-projects/javascript/contracts/Lock.sol

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// SPDX-License-Identifier: UNLICENSED
2-
pragma solidity ^0.8.24;
2+
pragma solidity ^0.8.27;
33

44
// Uncomment this line to use console.log
55
// import "hardhat/console.sol";

packages/hardhat-core/sample-projects/javascript/hardhat.config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@ require("@nomicfoundation/hardhat-toolbox");
22

33
/** @type import('hardhat/config').HardhatUserConfig */
44
module.exports = {
5-
solidity: "0.8.24",
5+
solidity: "0.8.27",
66
};

packages/hardhat-core/sample-projects/typescript-viem/contracts/Lock.sol

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// SPDX-License-Identifier: UNLICENSED
2-
pragma solidity ^0.8.24;
2+
pragma solidity ^0.8.27;
33

44
// Uncomment this line to use console.log
55
// import "hardhat/console.sol";

packages/hardhat-core/sample-projects/typescript-viem/hardhat.config.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import type { HardhatUserConfig } from "hardhat/config";
22
import "@nomicfoundation/hardhat-toolbox-viem";
33

44
const config: HardhatUserConfig = {
5-
solidity: "0.8.24",
5+
solidity: "0.8.27",
66
};
77

88
export default config;

packages/hardhat-core/sample-projects/typescript/contracts/Lock.sol

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// SPDX-License-Identifier: UNLICENSED
2-
pragma solidity ^0.8.24;
2+
pragma solidity ^0.8.27;
33

44
// Uncomment this line to use console.log
55
// import "hardhat/console.sol";

packages/hardhat-core/sample-projects/typescript/hardhat.config.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { HardhatUserConfig } from "hardhat/config";
22
import "@nomicfoundation/hardhat-toolbox";
33

44
const config: HardhatUserConfig = {
5-
solidity: "0.8.24",
5+
solidity: "0.8.27",
66
};
77

88
export default config;

packages/hardhat-core/src/internal/cli/project-creation.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ async function printRecommendedDepsInstallationInstructions(
254254
// exported so we can test that it uses the latest supported version of solidity
255255
export const EMPTY_HARDHAT_CONFIG = `/** @type import('hardhat/config').HardhatUserConfig */
256256
module.exports = {
257-
solidity: "0.8.24",
257+
solidity: "0.8.27",
258258
};
259259
`;
260260

Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
export const SUPPORTED_SOLIDITY_VERSION_RANGE = "<=0.8.24";
1+
export const SUPPORTED_SOLIDITY_VERSION_RANGE = "<=0.8.27";
22
export const FIRST_SOLC_VERSION_SUPPORTED = "0.5.1";

packages/hardhat-core/src/internal/solidity/compiler/solc-info.ts

+3
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,9 @@ const defaultEvmTargets: { [key: string]: string } = {
6161
"0.8.22": "shanghai",
6262
"0.8.23": "shanghai",
6363
"0.8.24": "shanghai",
64+
"0.8.25": "cancun",
65+
"0.8.26": "cancun",
66+
"0.8.27": "cancun",
6467
};
6568

6669
export function getEvmVersionFromSolcVersion(
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
pragma solidity ^0.8.24;
1+
pragma solidity ^0.8.27;
22

33
contract A {}
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
module.exports = {
2-
solidity: "0.8.24",
2+
solidity: "0.8.27",
33
};

packages/hardhat-core/test/internal/hardhat-network/stack-traces/compilers-list.ts

+41-5
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,6 @@ export const solidityCompilers: SolidityCompiler[] = [
220220
{
221221
solidityVersion: "0.8.22",
222222
compilerPath: "soljson-v0.8.22+commit.4fc1097e.js",
223-
latestSolcVersion: true,
224223
},
225224
{
226225
solidityVersion: "0.8.22",
@@ -229,12 +228,10 @@ export const solidityCompilers: SolidityCompiler[] = [
229228
runs: 200,
230229
viaIR: true,
231230
},
232-
latestSolcVersion: true,
233231
},
234232
{
235233
solidityVersion: "0.8.23",
236234
compilerPath: "soljson-v0.8.23+commit.f704f362.js",
237-
latestSolcVersion: true,
238235
},
239236
{
240237
solidityVersion: "0.8.23",
@@ -243,12 +240,10 @@ export const solidityCompilers: SolidityCompiler[] = [
243240
runs: 200,
244241
viaIR: true,
245242
},
246-
latestSolcVersion: true,
247243
},
248244
{
249245
solidityVersion: "0.8.24",
250246
compilerPath: "soljson-v0.8.24+commit.e11b9ed9.js",
251-
latestSolcVersion: true,
252247
},
253248
{
254249
solidityVersion: "0.8.24",
@@ -257,6 +252,47 @@ export const solidityCompilers: SolidityCompiler[] = [
257252
runs: 200,
258253
viaIR: true,
259254
},
255+
},
256+
{
257+
solidityVersion: "0.8.25",
258+
compilerPath: "soljson-v0.8.25+commit.b61c2a91.js",
259+
latestSolcVersion: true,
260+
},
261+
{
262+
solidityVersion: "0.8.25",
263+
compilerPath: "soljson-v0.8.25+commit.b61c2a91.js",
264+
optimizer: {
265+
runs: 200,
266+
viaIR: true,
267+
},
268+
latestSolcVersion: true,
269+
},
270+
{
271+
solidityVersion: "0.8.26",
272+
compilerPath: "soljson-v0.8.26+commit.8a97fa7a.js",
273+
latestSolcVersion: true,
274+
},
275+
{
276+
solidityVersion: "0.8.26",
277+
compilerPath: "soljson-v0.8.26+commit.8a97fa7a.js",
278+
optimizer: {
279+
runs: 200,
280+
viaIR: true,
281+
},
282+
latestSolcVersion: true,
283+
},
284+
{
285+
solidityVersion: "0.8.27",
286+
compilerPath: "soljson-v0.8.27+commit.40a35a09.js",
287+
latestSolcVersion: true,
288+
},
289+
{
290+
solidityVersion: "0.8.27",
291+
compilerPath: "soljson-v0.8.27+commit.40a35a09.js",
292+
optimizer: {
293+
runs: 200,
294+
viaIR: true,
295+
},
260296
latestSolcVersion: true,
261297
},
262298
];

packages/hardhat-core/test/internal/hardhat-network/stack-traces/execution.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export async function instantiateProvider(
3131
tracingConfig: TracingConfig
3232
): Promise<EdrProviderWrapper> {
3333
const config = {
34-
hardfork: "shanghai",
34+
hardfork: "cancun",
3535
chainId: 1,
3636
networkId: 1,
3737
blockGasLimit: 10_000_000,

packages/hardhat-core/test/internal/hardhat-network/stack-traces/test.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -544,16 +544,14 @@ async function runTest(
544544
);
545545
}
546546

547-
compareConsoleLogs(logger.lines, tx.consoleLogs);
548-
549547
const vmTraceDecoder = (provider as any)._vmTraceDecoder as VmTraceDecoder;
550548
const decodedTrace = vmTraceDecoder.tryToDecodeMessageTrace(trace);
551549

552550
try {
553551
if (tx.stackTrace === undefined) {
554552
assert.isFalse(
555553
trace.exit.isError(),
556-
`Transaction ${txIndex} shouldn't have failed`
554+
`Transaction ${txIndex} shouldn't have failed (${trace.exit.getReason()})`
557555
);
558556
} else {
559557
assert.isDefined(
@@ -588,6 +586,8 @@ async function runTest(
588586
throw err;
589587
}
590588
}
589+
590+
compareConsoleLogs(logger.lines, tx.consoleLogs);
591591
}
592592
}
593593

0 commit comments

Comments
 (0)