diff --git a/.changeset/silly-flowers-tickle.md b/.changeset/silly-flowers-tickle.md new file mode 100644 index 0000000000..31bee7eb2f --- /dev/null +++ b/.changeset/silly-flowers-tickle.md @@ -0,0 +1,5 @@ +--- +"hardhat": patch +--- + +Added support for solc versions 0.8.28 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 f89c10f7ad..b445ee806b 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.27 +- Any 0.8.x version up to and including 0.8.28 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 e1e1ebe5e3..12207575c7 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.27"; + const recommendedSolcVersion = "0.8.28"; 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 0c81557faa..2f385f70ed 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.27; +pragma solidity ^0.8.28; // 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 2cbdac3498..b63f0c2f2e 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.27", + solidity: "0.8.28", }; diff --git a/packages/hardhat-core/sample-projects/javascript/contracts/Lock.sol b/packages/hardhat-core/sample-projects/javascript/contracts/Lock.sol index 0c81557faa..2f385f70ed 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.27; +pragma solidity ^0.8.28; // 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 2cbdac3498..b63f0c2f2e 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.27", + solidity: "0.8.28", }; 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 0c81557faa..2f385f70ed 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.27; +pragma solidity ^0.8.28; // 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 f905c763fb..325c09af70 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 type { HardhatUserConfig } from "hardhat/config"; import "@nomicfoundation/hardhat-toolbox-viem"; const config: HardhatUserConfig = { - solidity: "0.8.27", + solidity: "0.8.28", }; 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 0c81557faa..2f385f70ed 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.27; +pragma solidity ^0.8.28; // 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 72cffac114..0e8962a6ef 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.27", + solidity: "0.8.28", }; 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 1d3a10c841..24cb7a3d4c 100644 --- a/packages/hardhat-core/src/internal/cli/project-creation.ts +++ b/packages/hardhat-core/src/internal/cli/project-creation.ts @@ -260,7 +260,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.27", + solidity: "0.8.28", }; `; 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 d451851c0d..6b1f64bdc2 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.27"; +export const SUPPORTED_SOLIDITY_VERSION_RANGE = "<=0.8.28"; 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 c7ced925df..b5358e5a4d 100644 --- a/packages/hardhat-core/src/internal/solidity/compiler/solc-info.ts +++ b/packages/hardhat-core/src/internal/solidity/compiler/solc-info.ts @@ -64,6 +64,7 @@ const defaultEvmTargets: { [key: string]: string } = { "0.8.25": "cancun", "0.8.26": "cancun", "0.8.27": "cancun", + "0.8.28": "cancun", }; 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 3cdd32a38e..a1f073c314 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.27; +pragma solidity ^0.8.28; 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 9fdde9a93e..4783642e98 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.27", + solidity: "0.8.28", }; 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 0a6f06f0be..f839c4d8af 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 @@ -256,7 +256,6 @@ export const solidityCompilers: SolidityCompiler[] = [ { solidityVersion: "0.8.25", compilerPath: "soljson-v0.8.25+commit.b61c2a91.js", - latestSolcVersion: true, }, { solidityVersion: "0.8.25", @@ -265,7 +264,6 @@ export const solidityCompilers: SolidityCompiler[] = [ runs: 200, viaIR: true, }, - latestSolcVersion: true, }, { solidityVersion: "0.8.26", @@ -295,6 +293,20 @@ export const solidityCompilers: SolidityCompiler[] = [ }, latestSolcVersion: true, }, + { + solidityVersion: "0.8.28", + compilerPath: "soljson-v0.8.28+commit.7893614a.js", + latestSolcVersion: true, + }, + { + solidityVersion: "0.8.28", + compilerPath: "soljson-v0.8.28+commit.7893614a.js", + optimizer: { + runs: 200, + viaIR: true, + }, + latestSolcVersion: true, + }, ]; export const getLatestSupportedVersion = () =>