Hardhat Deploy ProviderError: stack-underflow

Yes, this is because Solc Version 0.8.20 has switched the default target EVM version to Shanghai:

IMPORTANT NOTE: This compiler switches the default target EVM version to Shanghai, which means that the generated bytecode will include PUSH0 opcodes. Be sure to select the appropriate EVM version in case you intend to deploy on a chain other than mainnet like L2 chains that may not yet support PUSH0, otherwise deployment of your contracts will fail.

And the default target EVM version is set to Shanghai only starting from HardHat Version 2.14.0:

This release sets Shanghai as the default hardfork used by the Hardhat Network.

So you must choose either one of the following options:

  • Solc < 0.8.20 and HardHat < 2.14.0
  • Solc >= 0.8.20 and HardHat >= 2.14.0
1 Like