diff --git a/.changeset/plenty-roses-enjoy.md b/.changeset/plenty-roses-enjoy.md new file mode 100644 index 0000000000..fb2134a95f --- /dev/null +++ b/.changeset/plenty-roses-enjoy.md @@ -0,0 +1,5 @@ +--- +"hardhat": patch +--- + +Added support for solc 0.8.24 diff --git a/docs/src/content/hardhat-runner/docs/reference/solidity-support.md b/docs/src/content/hardhat-runner/docs/reference/solidity-support.md index d0aa7b4259..109300c335 100644 --- a/docs/src/content/hardhat-runner/docs/reference/solidity-support.md +++ b/docs/src/content/hardhat-runner/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.23 +- Any 0.8.x version up to and including 0.8.24 We recommend against using Hardhat with newer, unsupported versions of Solidity. But if you need to do so; please read on. diff --git a/docs/src/model/markdown.tsx b/docs/src/model/markdown.tsx index f0946c54c2..e97790d389 100644 --- a/docs/src/model/markdown.tsx +++ b/docs/src/model/markdown.tsx @@ -104,7 +104,7 @@ export const withoutComments = (content: string) => { }; export const replacePlaceholders = (content: string) => { - const recommendedSolcVersion = "0.8.23"; + const recommendedSolcVersion = "0.8.24"; const latestPragma = "^0.8.0"; const hardhatPackageJson = fs .readFileSync( diff --git a/packages/hardhat-core/sample-projects/javascript-esm/contracts/Lock.sol b/packages/hardhat-core/sample-projects/javascript-esm/contracts/Lock.sol index 50935f61fd..1efbef3f37 100644 --- a/packages/hardhat-core/sample-projects/javascript-esm/contracts/Lock.sol +++ b/packages/hardhat-core/sample-projects/javascript-esm/contracts/Lock.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: UNLICENSED -pragma solidity ^0.8.9; +pragma solidity ^0.8.24; // Uncomment this line to use console.log // import "hardhat/console.sol"; diff --git a/packages/hardhat-core/sample-projects/javascript-esm/hardhat.config.cjs b/packages/hardhat-core/sample-projects/javascript-esm/hardhat.config.cjs index 87c52f5f17..8ba99bc91c 100644 --- a/packages/hardhat-core/sample-projects/javascript-esm/hardhat.config.cjs +++ b/packages/hardhat-core/sample-projects/javascript-esm/hardhat.config.cjs @@ -2,5 +2,5 @@ require("@nomicfoundation/hardhat-toolbox"); /** @type import('hardhat/config').HardhatUserConfig */ module.exports = { - solidity: "0.8.19", + solidity: "0.8.24", }; diff --git a/packages/hardhat-core/sample-projects/javascript/contracts/Lock.sol b/packages/hardhat-core/sample-projects/javascript/contracts/Lock.sol index 50935f61fd..1efbef3f37 100644 --- a/packages/hardhat-core/sample-projects/javascript/contracts/Lock.sol +++ b/packages/hardhat-core/sample-projects/javascript/contracts/Lock.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: UNLICENSED -pragma solidity ^0.8.9; +pragma solidity ^0.8.24; // Uncomment this line to use console.log // import "hardhat/console.sol"; diff --git a/packages/hardhat-core/sample-projects/javascript/hardhat.config.js b/packages/hardhat-core/sample-projects/javascript/hardhat.config.js index 87c52f5f17..8ba99bc91c 100644 --- a/packages/hardhat-core/sample-projects/javascript/hardhat.config.js +++ b/packages/hardhat-core/sample-projects/javascript/hardhat.config.js @@ -2,5 +2,5 @@ require("@nomicfoundation/hardhat-toolbox"); /** @type import('hardhat/config').HardhatUserConfig */ module.exports = { - solidity: "0.8.19", + solidity: "0.8.24", }; diff --git a/packages/hardhat-core/sample-projects/typescript-viem/contracts/Lock.sol b/packages/hardhat-core/sample-projects/typescript-viem/contracts/Lock.sol index 50935f61fd..1efbef3f37 100644 --- a/packages/hardhat-core/sample-projects/typescript-viem/contracts/Lock.sol +++ b/packages/hardhat-core/sample-projects/typescript-viem/contracts/Lock.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: UNLICENSED -pragma solidity ^0.8.9; +pragma solidity ^0.8.24; // Uncomment this line to use console.log // import "hardhat/console.sol"; diff --git a/packages/hardhat-core/sample-projects/typescript-viem/hardhat.config.ts b/packages/hardhat-core/sample-projects/typescript-viem/hardhat.config.ts index 814b1ebce3..4b56e3cd50 100644 --- a/packages/hardhat-core/sample-projects/typescript-viem/hardhat.config.ts +++ b/packages/hardhat-core/sample-projects/typescript-viem/hardhat.config.ts @@ -2,7 +2,7 @@ import { HardhatUserConfig } from "hardhat/config"; import "@nomicfoundation/hardhat-toolbox-viem"; const config: HardhatUserConfig = { - solidity: "0.8.19", + solidity: "0.8.24", }; export default config; diff --git a/packages/hardhat-core/sample-projects/typescript/contracts/Lock.sol b/packages/hardhat-core/sample-projects/typescript/contracts/Lock.sol index 50935f61fd..1efbef3f37 100644 --- a/packages/hardhat-core/sample-projects/typescript/contracts/Lock.sol +++ b/packages/hardhat-core/sample-projects/typescript/contracts/Lock.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: UNLICENSED -pragma solidity ^0.8.9; +pragma solidity ^0.8.24; // Uncomment this line to use console.log // import "hardhat/console.sol"; diff --git a/packages/hardhat-core/sample-projects/typescript/hardhat.config.ts b/packages/hardhat-core/sample-projects/typescript/hardhat.config.ts index c4ef851c04..3bd6862e98 100644 --- a/packages/hardhat-core/sample-projects/typescript/hardhat.config.ts +++ b/packages/hardhat-core/sample-projects/typescript/hardhat.config.ts @@ -2,7 +2,7 @@ import { HardhatUserConfig } from "hardhat/config"; import "@nomicfoundation/hardhat-toolbox"; const config: HardhatUserConfig = { - solidity: "0.8.19", + solidity: "0.8.24", }; export default config; diff --git a/packages/hardhat-core/src/internal/cli/project-creation.ts b/packages/hardhat-core/src/internal/cli/project-creation.ts index 54c0e002c8..15bc1030b0 100644 --- a/packages/hardhat-core/src/internal/cli/project-creation.ts +++ b/packages/hardhat-core/src/internal/cli/project-creation.ts @@ -251,7 +251,7 @@ async function printRecommendedDepsInstallationInstructions( // exported so we can test that it uses the latest supported version of solidity export const EMPTY_HARDHAT_CONFIG = `/** @type import('hardhat/config').HardhatUserConfig */ module.exports = { - solidity: "0.8.19", + solidity: "0.8.24", }; `; diff --git a/packages/hardhat-core/src/internal/hardhat-network/stack-traces/constants.ts b/packages/hardhat-core/src/internal/hardhat-network/stack-traces/constants.ts index c737fa3570..4a77fa4647 100644 --- a/packages/hardhat-core/src/internal/hardhat-network/stack-traces/constants.ts +++ b/packages/hardhat-core/src/internal/hardhat-network/stack-traces/constants.ts @@ -1,2 +1,2 @@ -export const SUPPORTED_SOLIDITY_VERSION_RANGE = "<=0.8.23"; +export const SUPPORTED_SOLIDITY_VERSION_RANGE = "<=0.8.24"; export const FIRST_SOLC_VERSION_SUPPORTED = "0.5.1"; diff --git a/packages/hardhat-core/src/internal/solidity/compiler/solc-info.ts b/packages/hardhat-core/src/internal/solidity/compiler/solc-info.ts index fd06e60c43..d657184481 100644 --- a/packages/hardhat-core/src/internal/solidity/compiler/solc-info.ts +++ b/packages/hardhat-core/src/internal/solidity/compiler/solc-info.ts @@ -60,6 +60,7 @@ const defaultEvmTargets: { [key: string]: string } = { "0.8.21": "shanghai", "0.8.22": "shanghai", "0.8.23": "shanghai", + "0.8.24": "shanghai", }; export function getEvmVersionFromSolcVersion( diff --git a/packages/hardhat-core/test/fixture-projects/compilation-latest-solc-version/contracts/A.sol b/packages/hardhat-core/test/fixture-projects/compilation-latest-solc-version/contracts/A.sol index cb72dc902a..5be0c05871 100644 --- a/packages/hardhat-core/test/fixture-projects/compilation-latest-solc-version/contracts/A.sol +++ b/packages/hardhat-core/test/fixture-projects/compilation-latest-solc-version/contracts/A.sol @@ -1,3 +1,3 @@ -pragma solidity ^0.8.23; +pragma solidity ^0.8.24; contract A {} diff --git a/packages/hardhat-core/test/fixture-projects/compilation-latest-solc-version/hardhat.config.js b/packages/hardhat-core/test/fixture-projects/compilation-latest-solc-version/hardhat.config.js index ea72c9f4de..31b010f16d 100644 --- a/packages/hardhat-core/test/fixture-projects/compilation-latest-solc-version/hardhat.config.js +++ b/packages/hardhat-core/test/fixture-projects/compilation-latest-solc-version/hardhat.config.js @@ -1,3 +1,3 @@ module.exports = { - solidity: "0.8.23", + solidity: "0.8.24", }; diff --git a/packages/hardhat-core/test/internal/hardhat-network/stack-traces/compilers-list.ts b/packages/hardhat-core/test/internal/hardhat-network/stack-traces/compilers-list.ts index ac4f193b25..9a74fd4876 100644 --- a/packages/hardhat-core/test/internal/hardhat-network/stack-traces/compilers-list.ts +++ b/packages/hardhat-core/test/internal/hardhat-network/stack-traces/compilers-list.ts @@ -208,7 +208,6 @@ export const solidityCompilers: SolidityCompiler[] = [ { solidityVersion: "0.8.21", compilerPath: "soljson-v0.8.21+commit.d9974bed.js", - latestSolcVersion: true, }, { solidityVersion: "0.8.21", @@ -217,7 +216,6 @@ export const solidityCompilers: SolidityCompiler[] = [ runs: 200, viaIR: true, }, - latestSolcVersion: true, }, { solidityVersion: "0.8.22", @@ -247,6 +245,20 @@ export const solidityCompilers: SolidityCompiler[] = [ }, latestSolcVersion: true, }, + { + solidityVersion: "0.8.24", + compilerPath: "soljson-v0.8.24+commit.e11b9ed9.js", + latestSolcVersion: true, + }, + { + solidityVersion: "0.8.24", + compilerPath: "soljson-v0.8.24+commit.e11b9ed9.js", + optimizer: { + runs: 200, + viaIR: true, + }, + latestSolcVersion: true, + }, ]; export const getLatestSupportedVersion = () =>