Instead of going back to an older version of Solidity compiler, in hardhat to prevent use of PUSH0
you can try setting evmVersion
to a previous version (e.g. paris
, which is the one before shanghai
) whilst still using the latest compiler version (0.8.21 currently):
solidity: {
compilers: [
{
version: `0.8.21`,
settings: {
optimizer: {
enabled: true,
runs: 15000
},
evmVersion: `paris`
}
},
],
},
Polygon announced last week that they’ve just implemented PUSH0
on their zkEVM blockchain. I’ve tested the testnet and it works. zkEVM mainnet will work from 2023-09-10: Polygon zkEVM: Dragon Fruit Upgrade (with New Opcode) Coming to Mainnet Beta
I also tested 140 blockchains today and only found these ones (16%) that support PUSH0
currently:
- auroraTestnet
- edgeware
- edgewareTestnet
- gnosis
- chiado
- goerli
- mainnet
- moonbaseAlpha
- moonbeam
- moonriver
- polygonZkEvmTestnet
- pulsechain
- pulsechainV4
- sapphire
- sapphireTestnet
- scrollSepolia
- sepolia
- syscoin
- syscoinTestnet
- taikoTestnetSepolia
Hopefully the many other blockchains will follow, as developers want to be able to use the latest version.