Hi OZ team, I have upgraded one of our projects to use OZ 2.4.0 release but run into a few problems when trying to build the project.
All our tests pass first time locally using truffle (local) but when running on a CI test runner (GitHub Actions) we hit the issues below:
Initial state - tests passing - OZ 2.3.0 (all good)
Bump to OZ 2.4.0 - test failing - this error makes sense, I needed to bump to a EVM with compatible instructions, error; I get is:
@openzeppelin/contracts/utils/Address.sol:29:32: Warning: The "extcodehash" instruction is not supported by the VM version "byzantium" you are currently compiling for. It will be interpreted as an invalid instruction on this VM.
assembly { codehash := extcodehash(account) }
After bumping to 0.5.5 and upwards I get the following: Error: while migrating Migrations: Returned error: VM Exception while processing transaction: invalid opcode
Tried solc 0.5.5 - 0.5.12 and ganache-cli latest and @instabul (beta version) with the same issues being raised.
I have also tried using OZ 2.3.0 with newer versions of solc without much luck - this also fail
I suspect its an issue with ganache-cli just wondered if you have come across it or know or any issues around using ganache-cli and OZ 2.4.0 ?
The issue appears to be the version of solidity-coverage which spins up itâs own testrpc (which I assume doesnât support the latest opcodes).
I get the same error when running locally:
$ npm run coverage
...
Using account [0x81945dA5e825E6694F6d73dF862f6777aC65930e] for network [coverage]
Error: Error: Error: while migrating Migrations: Returned error: VM Exception while processing transaction: invalid opcode
To resolve you could try using the solidity-coverage beta version: