Question
Hardhat CLI and Solc Compiler: Default Version Selection
Rahul Indigo
0 reputation · 07 Aug 2024, 15:46 UTC
78K views0
Goal: Identify the Solidity compiler version that Hardhat employs when no explicit `solidity` field is present in `hardhat.config.js`, and understand how this implicit choice influences plugins that rely on matching compiler versions for TypeChain artifact generation.
Constraints: Hardhat ships with a bundled solc version that may differ between releases, and certain plugins assume the compiler used to compile contracts matches the one used to generate their typings. This creates uncertainty about which solc version will be active after a Hardhat upgrade, potentially causing silent mismatches in generated code.
Questions: What solc version does Hardhat use by default in a given release? How can a team guarantee that the default compiler remains stable across Hardhat updates without explicitly locking a version? Which verification approach confirms the actual solc version invoked during a default compile?