You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi @SKYBITDev3, I think you are mixing up two concepts here.
#4851 is about using Cancun as the default hardfork of the Hardhat Network. That means that, for example, that transient storage opcodes are available by default. We did check that it works 🙂
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 #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 #4851 actually worked?
Minimal reproduction steps
Don't explicitly set
evmVersion
in hardhat config and runyarn hardhat compile
.Search terms
No response
The text was updated successfully, but these errors were encountered: