Closed SKYBITDev3 closed 5 months ago
Hi @SKYBITDev3, I think you are mixing up two concepts here.
The EVM target of solc is a different thing. This is what kind of opcodes will be used in the bytecode generated by solc. In this case, a paris
target means that solc won't use transient storage opcodes (or any opcode introduced after paris
).
The reason for this is that not all chains enable hardforks immediately. This was a problem, for example, when PUSH0
was introduced: if you used the latest version of solc with their default EVM target (which used PUSH0
) but then deployed in a chain that didn't have the opcode yet, your contract will not work. So we decided to be conservative about this.
Ideally Hardhat would have a good alignment between the solc EVM target, the local hardhat network hardfork, and the (minimum) hardfork of the chains where you intend to deploy, but we are not there yet.
Now, it's true that paris
is kind of an old hardfork now. We might have to upgrade the default EVM target, but we don't really have a policy of how and when to do that (see https://github.com/NomicFoundation/hardhat/issues/4264)
Version of Hardhat
2.22.4
What happened?
If
evmVersion
version isn't explicitly set in hardhat config then compilation result is:After explicitly setting
evmVersion
tocancun
like this:then it says the evm target was
cancun
as expected:Did you guys check that https://github.com/NomicFoundation/hardhat/issues/4851 actually worked?
Minimal reproduction steps
Don't explicitly set
evmVersion
in hardhat config and runyarn hardhat compile
.Search terms
No response