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.
I am using Ganache v6.9.1 (from docker trufflesuite/ganache-cli:v6.9.1) with --networkId=5777 and want to read the chain ID from within solidity using:
It is a bug in Ganache that is tricky to fix due to backcompat reasons. We'll be changing this behavior in the next major version of ganache-core (trufflesuite/ganache#451)
Note that chain ID !== network id (net_version). The bug is actually different than you have discovered, as the eth_chainId RPC actually returns 1337 right now, but 1 for the chainid opcode in the EVM.
Looking forward, as I am working on some 2-layer stuff and getting all the EIP712 bits working together (for which I need the chain ID to prevent replay attacks) is tricky .. some stuff required is still in the move/new/buggy ;)
I am using Ganache v6.9.1 (from docker
trufflesuite/ganache-cli:v6.9.1
) with--networkId=5777
and want to read the chain ID from within solidity using:source: wamp-proto/wamp-xbr#51 (comment)
The returned chain ID however is not 5777, but always 1.
Is this a know bug? Am I doing sth wrong?
I am using truffle 5.1.14 and pragma solidity ^0.5.12; in my contracts, as the CHAINID opcode was only intruduced in v0.5.12 https://solidity.readthedocs.io/en/v0.5.12/assembly.html#opcodes
The text was updated successfully, but these errors were encountered: