Is there a way to directly be able to retrieve CHAIN_ID information about the executing chain from a smart contract?

I know that for any chain that has EIP-155 implemented, CHAIN_IDs are retrievable from the v component of a signature but would require the passing of one for extraction.

Since CHAIN_ID is information about the chain I suspect that there should be a way to access this. Is there a way for Solidity to directly get this information?

  • 1
    Alternative: Because you are deploying the contract on a different chain you can give the chain id as a constructor parameter. – Mikko Ohtamaa Aug 17 '18 at 14:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.