chainid
opcode returns an error
#1494
-
System informationGeth version: Expected behaviourRead chain id when Actual behaviourError received when attempting to call this in remix connected to local quorum RPC: Steps to reproduce the behaviour`pragma solidity ^0.7.0; contract ChainIdCaller {
Backtrace
When submitting logs: please submit them as text and not screenshots. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 15 replies
-
Hi @frank-part ,
function getChainId() public view returns (uint256) {
return block.chainid;
} You also need to ensure that you are running on the istanbul fork and that you have specified |
Beta Was this translation helpful? Give feedback.
Hi @frank-part ,
There are two solutions to fix the issue:
--evm-version istanbul
flag docs. You have the same config in remix under advanced configuration.^0.8.0
and you can useblock.chainid
directly without assembly code.You also need to ensure that you are running on the istanbul fork and that you have specified
istanbulBlock
in your genesis.