Skip to content

Commit

Permalink
Merge pull request #4137 from NomicFoundation/use-solc-0-8-19
Browse files Browse the repository at this point in the history
Use solc 0.8.19 in docs and sample projects
  • Loading branch information
fvictorio committed Jul 12, 2023
2 parents 23fe516 + e93189b commit b3661a0
Show file tree
Hide file tree
Showing 14 changed files with 20 additions and 137 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ task("balance", "Prints an account's balance").setAction(async () => {});

/** @type import('hardhat/config').HardhatUserConfig */
module.exports = {
solidity: "{LATEST_SOLC_VERSION}",
solidity: "{RECOMMENDED_SOLC_VERSION}",
};
```

Expand Down
6 changes: 3 additions & 3 deletions docs/src/content/hardhat-runner/docs/config/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ module.exports = {
}
},
solidity: {
version: "{LATEST_SOLC_VERSION}",
version: "{RECOMMENDED_SOLC_VERSION}",
settings: {
optimizer: {
enabled: true,
Expand Down Expand Up @@ -62,7 +62,7 @@ module.exports = {
}
},
solidity: {
version: "{LATEST_SOLC_VERSION}",
version: "{RECOMMENDED_SOLC_VERSION}",
settings: {
optimizer: {
enabled: true,
Expand Down Expand Up @@ -176,7 +176,7 @@ module.exports = {

The `solidity` config is an optional field that can be one of the following:

- A solc version to use, e.g. `"{LATEST_SOLC_VERSION}"`.
- A solc version to use, e.g. `"{RECOMMENDED_SOLC_VERSION}"`.

- An object which describes the configuration for a single compiler. It contains the following keys:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ If you need to customize the Solidity compiler options, then you can do so throu

```js
module.exports = {
solidity: "{LATEST_SOLC_VERSION}",
solidity: "{RECOMMENDED_SOLC_VERSION}",
};
```

Expand All @@ -44,7 +44,7 @@ The expanded usage allows for more control of the compiler:
```js
module.exports = {
solidity: {
version: "{LATEST_SOLC_VERSION}",
version: "{RECOMMENDED_SOLC_VERSION}",
settings: {
optimizer: {
enabled: true,
Expand Down
6 changes: 3 additions & 3 deletions docs/src/content/hardhat-runner/docs/guides/project-setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ If you select _Create an empty hardhat.config.js_, Hardhat will create a `hardha
```js
/** @type import('hardhat/config').HardhatUserConfig */
module.exports = {
solidity: "{LATEST_SOLC_VERSION}",
solidity: "{RECOMMENDED_SOLC_VERSION}",
};
```

Expand Down Expand Up @@ -154,7 +154,7 @@ To use a plugin, the first step is always to install it using npm or yarn, follo
import "@nomicfoundation/hardhat-toolbox";

export default {
solidity: "{LATEST_SOLC_VERSION}",
solidity: "{RECOMMENDED_SOLC_VERSION}",
};
```

Expand All @@ -166,7 +166,7 @@ export default {
require("@nomicfoundation/hardhat-toolbox");

module.exports = {
solidity: "{LATEST_SOLC_VERSION}",
solidity: "{RECOMMENDED_SOLC_VERSION}",
};
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ If you use the `viaIR` option, we recommend you set the [optimization step seque

```
solidity: {
version: "{LATEST_SOLC_VERSION}", // any version you want
version: "{RECOMMENDED_SOLC_VERSION}", // any version you want
settings: {
viaIR: true,
optimizer: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,6 @@ require("@nomicfoundation/hardhat-toolbox");
/** @type import('hardhat/config').HardhatUserConfig */
module.exports = {
solidity: "{LATEST_SOLC_VERSION}",
solidity: "{RECOMMENDED_SOLC_VERSION}",
};
```
4 changes: 2 additions & 2 deletions docs/src/content/tutorial/deploying-to-a-live-network.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ const INFURA_API_KEY = "KEY";
const SEPOLIA_PRIVATE_KEY = "YOUR SEPOLIA PRIVATE KEY";
module.exports = {
solidity: "{LATEST_SOLC_VERSION}",
solidity: "{RECOMMENDED_SOLC_VERSION}",
networks: {
sepolia: {
url: `https://sepolia.infura.io/v3/${INFURA_API_KEY}`,
Expand Down Expand Up @@ -97,7 +97,7 @@ const ALCHEMY_API_KEY = "KEY";
const SEPOLIA_PRIVATE_KEY = "YOUR SEPOLIA PRIVATE KEY";
module.exports = {
solidity: "{LATEST_SOLC_VERSION}",
solidity: "{RECOMMENDED_SOLC_VERSION}",
networks: {
sepolia: {
url: `https://eth-sepolia.g.alchemy.com/v2/${ALCHEMY_API_KEY}`,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ To compile the contract run `npx hardhat compile` in your terminal. The `compile

```
$ npx hardhat compile
Compiling 1 file with {LATEST_SOLC_VERSION}
Compiling 1 file with {RECOMMENDED_SOLC_VERSION}
Compilation finished successfully
```

Expand Down
4 changes: 2 additions & 2 deletions docs/src/model/markdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ export const withoutComments = (content: string) => {
};

export const replacePlaceholders = (content: string) => {
const latestSolcVersion = "0.8.20";
const recommendedSolcVersion = "0.8.19";
const latestPragma = "^0.8.0";
const hardhatPackageJson = fs
.readFileSync(
Expand All @@ -123,7 +123,7 @@ export const replacePlaceholders = (content: string) => {
const hardhatVersion = JSON.parse(hardhatPackageJson).version;

return content
.replaceAll("{LATEST_SOLC_VERSION}", latestSolcVersion)
.replaceAll("{RECOMMENDED_SOLC_VERSION}", recommendedSolcVersion)
.replaceAll("{LATEST_PRAGMA}", latestPragma)
.replaceAll("{HARDHAT_VERSION}", hardhatVersion);
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ require("@nomicfoundation/hardhat-toolbox");

/** @type import('hardhat/config').HardhatUserConfig */
module.exports = {
solidity: "0.8.20",
solidity: "0.8.19",
};
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ require("@nomicfoundation/hardhat-toolbox");

/** @type import('hardhat/config').HardhatUserConfig */
module.exports = {
solidity: "0.8.20",
solidity: "0.8.19",
};
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { HardhatUserConfig } from "hardhat/config";
import "@nomicfoundation/hardhat-toolbox";

const config: HardhatUserConfig = {
solidity: "0.8.20",
solidity: "0.8.19",
};

export default config;
2 changes: 1 addition & 1 deletion packages/hardhat-core/src/internal/cli/project-creation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,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.20",
solidity: "0.8.19",
};
`;

Expand Down
117 changes: 0 additions & 117 deletions packages/hardhat-core/test/sample-projects/solidity-version.ts

This file was deleted.

0 comments on commit b3661a0

Please sign in to comment.