I'm trying to get the chain_id of the current chain evaluating a transaction or containing the smart contract with smartPy, but I got always error in init and in entrypoints when I try to affect the chainId to a ver in storage, can you anyone give us a small example on how to get the chain_id in the smart contract? or how to initiate a var in storage with the chain_id where the contract is deployed?
Looking at https://smartpy.io/dev/reference.html#_chain_id, you can see that you can basically currently do three things in SmartPy:
Define chain_id constants with things like
Get the current chain_id for your chain
Verify that they match with
There are no helper lists of chain_id constants that I know of, which would be helpful.