Simple Summary
Add support for the chain ID opcode through a new environment variable
Motivation
Being able to know what chain a contract is located on is valuable for many different kinds of signature verification operations because it is often used as a domain separator for message signing. Creating an environment variable that queries this value means there will be no human error involved in maintaining this value within contracts, so that contracts developed on testnets don't allow replay attacks when they are deployed on the mainnet.
Specification
The feature is described in full via EIP-1344. In vyper, this should appear as the chain.id env var, as it is derived from the chain context of the Ethereum client that executes this call (through it's Genesis config). It should have a type of uint256 and a gas cost of G_base.
Backwards Compatibility
No backwards incompatibilities
Dependencies
No dependencies
Copyright
Copyright and related rights waived via CC0
Simple Summary
Add support for the chain ID opcode through a new environment variable
Motivation
Being able to know what chain a contract is located on is valuable for many different kinds of signature verification operations because it is often used as a domain separator for message signing. Creating an environment variable that queries this value means there will be no human error involved in maintaining this value within contracts, so that contracts developed on testnets don't allow replay attacks when they are deployed on the mainnet.
Specification
The feature is described in full via EIP-1344. In vyper, this should appear as the
chain.idenv var, as it is derived from the chain context of the Ethereum client that executes this call (through it's Genesis config). It should have a type ofuint256and a gas cost ofG_base.Backwards Compatibility
No backwards incompatibilities
Dependencies
No dependencies
Copyright
Copyright and related rights waived via CC0