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
{{ message }}
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.
The function that attempts to read the chain id fails with the following error:
Error: VM Exception while processing transaction: invalid opcode
at HttpProvider.send (node_modules/@nomiclabs/buidler/src/internal/core/providers/http.ts:36:34)
at /Users/paulrberg/Workspace/Pad/ganache-invalid-opcode/node_modules/@nomiclabs/buidler/src/internal/core/providers/gas-providers.ts:115:21
at Proxy.cloningSendWrapper (node_modules/@nomiclabs/buidler/src/internal/core/providers/wrapper.ts:9:12)
at /Users/paulrberg/Workspace/Pad/ganache-invalid-opcode/node_modules/@nomiclabs/buidler/src/internal/core/providers/accounts.ts:219:21
at Proxy.cloningSendWrapper (node_modules/@nomiclabs/buidler/src/internal/core/providers/wrapper.ts:9:12)
at /Users/paulrberg/Workspace/Pad/ganache-invalid-opcode/node_modules/@nomiclabs/buidler/src/internal/core/providers/gas-providers.ts:63:21
at Proxy.cloningSendWrapper (node_modules/@nomiclabs/buidler/src/internal/core/providers/wrapper.ts:9:12)
at /Users/paulrberg/Workspace/Pad/ganache-invalid-opcode/node_modules/@nomiclabs/buidler/src/internal/core/providers/gas-providers.ts:41:21
at Proxy.cloningSendWrapper (node_modules/@nomiclabs/buidler/src/internal/core/providers/wrapper.ts:9:12)
at EthersProviderWrapper.send (node_modules/@nomiclabs/buidler-ethers/src/ethers-provider-wrapper.ts:13:48)
at EthersProviderWrapper.<anonymous> (node_modules/@ethersproject/providers/src.ts/json-rpc-provider.ts:439:31)
at step (node_modules/@ethersproject/providers/lib/json-rpc-provider.js:46:23)
at Object.next (node_modules/@ethersproject/providers/lib/json-rpc-provider.js:27:53)
at /Users/paulrberg/Workspace/Pad/ganache-invalid-opcode/node_modules/@ethersproject/providers/lib/json-rpc-provider.js:21:71
at new Promise (<anonymous>)
at __awaiter (node_modules/@ethersproject/providers/lib/json-rpc-provider.js:17:12)
Run the tests with yarn run test and get the same error as above
Context
I'm running Ganache via a Hardhat (formerly Buidler) plugin called @nomiclabs/buidler-ganache, yet I don't see why Hardhat would be the culprit, so that's why I opened the issue here. If you disable the plugin and run the latest version of ganache-cli in a parallel console session, you get the exact same error.Update: this is actually a bug with Hardhat, see below.
Finally, I know about #515 and the plan to patch the bug in v3.0, but I hadn't seen people complaining that reading the chain id reverts, as it happens in my case.
Your Environment
@nomiclabs/buidler-ganache@1.3.3
ganache-cli@6.9.0
node@12.16.3
macOS@10.15.7
The text was updated successfully, but these errors were encountered:
PaulRBerg
changed the title
"invalid opcode" when readin chain id from inline assembly
"invalid opcode" when reading chain id from inline assembly
Oct 24, 2020
I cannot reproduce the bug if I disable the @nomiclabs/buidler-ganache plugin, as in, there is no "invalid opcode" with either ganache-cli v6.9.0 or 6.12.0.
Sorry, it may be the case that Hardhat has a bug, not Ganache. I'll keep this issue open only for a few hours to confirm my findings.
Expected Behavior
The chain id should be accessible via inline assembly, as this is a feature available since solidity 0.5.12.
Current Behavior
The function that attempts to read the chain id fails with the following error:
Steps to Reproduce
yarn run typechain
yarn run test
and get the same error as aboveContext
I'm running Ganache via a Hardhat (formerly Buidler) plugin called @nomiclabs/buidler-ganache, yet I don't see why Hardhat would be the culprit, so that's why I opened the issue here. If you disable the plugin and run the latest version ofUpdate: this is actually a bug with Hardhat, see below.ganache-cli
in a parallel console session, you get the exact same error.Finally, I know about #515 and the plan to patch the bug in v3.0, but I hadn't seen people complaining that reading the chain id reverts, as it happens in my case.
Your Environment
The text was updated successfully, but these errors were encountered: