I have changed my ERC721 contracts to the new version v0.8.20.
When trying to deploy to the BSC-Testnet network I get the following error:
invalid opcode: PUSH0
OR the EVM version used by the selected environment is not compatible with the compiler EVM version.
First time I have had an error of this kind. Any idea what it could be?
Solidity version 0.8.20 is not supported on BSC. Use 0.8.19
Or in the advanced compiler settings, change the EVM version to one that is supported by your chain.
Thank you. I have tried the london
version and it also works.
Do you know how to configure this in Hardhat?
like this?:
optimizer: {
enabled: true,
runs: 1000,
},
evmVersion: {
version : "london"
},
like this:
optimizer: {
enabled: true,
runs: 1000,
},
evmVersion: "london",
1 Like
Will it work on BSC Mainnet or do i need to lower the compiler version there also. Even I faced the same issue
Let's hope so because otherwise we will have a big problem.
I tried on mainnet.
{Gas estimation errored with the following message (see below). The transaction execution will likely fail. Do you want to force sending?
Returned error: invalid opcode: opcode 0x5f not defined
OR the EVM version used by the selected environment is not compatible with the compiler EVM version. }
Faced the same issue .
Can you try from your end ?
I was using the solidity version above 20 for ERC721 contract
If you launch from remix, try selecting a different compiled version in advanted configuration:
See the image and select it there:
london
works for me in testnet but you can try with paris
more new.
If you use hardhat, put the same in it configuration file.
I won't be attacking mainnet for a few weeks and I can't tell you if it works for me.
thanks.
what was your compiler version?
london
works for me in testnet.