-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Print the evm versions used when compiling (#4414)
- Loading branch information
1 parent
78dd09b
commit 03edea6
Showing
10 changed files
with
164 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"hardhat": patch | ||
--- | ||
|
||
Updated the compilation logs to include the targeted EVM versions. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
67 changes: 67 additions & 0 deletions
67
packages/hardhat-core/src/internal/solidity/compiler/solc-info.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
const defaultEvmTargets: { [key: string]: string } = { | ||
"0.5.1": "byzantium", | ||
"0.5.2": "byzantium", | ||
"0.5.3": "byzantium", | ||
"0.5.4": "byzantium", | ||
"0.5.5": "petersburg", | ||
"0.5.6": "petersburg", | ||
"0.5.7": "petersburg", | ||
"0.5.8": "petersburg", | ||
"0.5.9": "petersburg", | ||
"0.5.10": "petersburg", | ||
"0.5.11": "petersburg", | ||
"0.5.12": "petersburg", | ||
"0.5.13": "petersburg", | ||
"0.5.14": "istanbul", | ||
"0.5.15": "istanbul", | ||
"0.5.16": "istanbul", | ||
"0.5.17": "istanbul", | ||
"0.6.0": "istanbul", | ||
"0.6.1": "istanbul", | ||
"0.6.2": "istanbul", | ||
"0.6.3": "istanbul", | ||
"0.6.4": "istanbul", | ||
"0.6.5": "istanbul", | ||
"0.6.6": "istanbul", | ||
"0.6.7": "istanbul", | ||
"0.6.8": "istanbul", | ||
"0.6.9": "istanbul", | ||
"0.6.10": "istanbul", | ||
"0.6.11": "istanbul", | ||
"0.6.12": "istanbul", | ||
"0.7.0": "istanbul", | ||
"0.7.1": "istanbul", | ||
"0.7.2": "istanbul", | ||
"0.7.3": "istanbul", | ||
"0.7.4": "istanbul", | ||
"0.7.5": "istanbul", | ||
"0.7.6": "istanbul", | ||
"0.8.0": "istanbul", | ||
"0.8.1": "istanbul", | ||
"0.8.2": "istanbul", | ||
"0.8.3": "istanbul", | ||
"0.8.4": "istanbul", | ||
"0.8.5": "berlin", | ||
"0.8.6": "berlin", | ||
"0.8.7": "london", | ||
"0.8.8": "london", | ||
"0.8.9": "london", | ||
"0.8.10": "london", | ||
"0.8.11": "london", | ||
"0.8.12": "london", | ||
"0.8.13": "london", | ||
"0.8.14": "london", | ||
"0.8.15": "london", | ||
"0.8.16": "london", | ||
"0.8.17": "london", | ||
"0.8.18": "paris", | ||
"0.8.19": "paris", | ||
"0.8.20": "shanghai", | ||
"0.8.21": "shanghai", | ||
}; | ||
|
||
export function getEvmVersionFromSolcVersion( | ||
solcVersion: string | ||
): string | undefined { | ||
return defaultEvmTargets[solcVersion]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
...t-core/test/fixture-projects/compilation-multiple-files-different-evm-versions/.gitignore
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
artifacts/ | ||
cache/ |
4 changes: 4 additions & 0 deletions
4
...e/test/fixture-projects/compilation-multiple-files-different-evm-versions/contracts/A.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
// SPDX-License-Identifier: UNLICENSED | ||
pragma solidity 0.8.21; | ||
|
||
contract A {} |
4 changes: 4 additions & 0 deletions
4
...e/test/fixture-projects/compilation-multiple-files-different-evm-versions/contracts/B.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
// SPDX-License-Identifier: UNLICENSED | ||
pragma solidity 0.8.20; | ||
|
||
contract B {} |
4 changes: 4 additions & 0 deletions
4
...e/test/fixture-projects/compilation-multiple-files-different-evm-versions/contracts/C.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
// SPDX-License-Identifier: UNLICENSED | ||
pragma solidity 0.4.11; | ||
|
||
contract C {} |
4 changes: 4 additions & 0 deletions
4
...e/test/fixture-projects/compilation-multiple-files-different-evm-versions/contracts/D.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
// SPDX-License-Identifier: UNLICENSED | ||
pragma solidity 0.5.5; | ||
|
||
contract D {} |
24 changes: 24 additions & 0 deletions
24
...test/fixture-projects/compilation-multiple-files-different-evm-versions/hardhat.config.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
module.exports = { | ||
solidity: { | ||
compilers: [ | ||
{ | ||
version: "0.4.11", // Value not present in solc-info.ts file | ||
}, | ||
{ | ||
version: "0.5.5", // Value taken from solc-info.ts file | ||
}, | ||
{ | ||
version: "0.8.20", | ||
settings: { | ||
evmVersion: "paris", // Overwrite default value in solc-info.ts file | ||
}, | ||
}, | ||
{ | ||
version: "0.8.21", | ||
settings: { | ||
evmVersion: "shanghai", // Same as default value in solc-info.ts file | ||
}, | ||
}, | ||
], | ||
}, | ||
}; |