-
-
Notifications
You must be signed in to change notification settings - Fork 810
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
VIP: Add support for Chain ID Opcode #1652
Labels
Comments
fubuloubu
added
the
Easy Pickings
Used to denote issues that should be easy to implement
label
Oct 24, 2019
Note: might be best to add this feature via #1230 ruleset switch so there it fails to compile under pre-Istanbul rules |
fubuloubu
changed the title
Add support for Chain ID Opcode
VIP: Add support for Chain ID Opcode
Oct 27, 2019
This was referenced Oct 27, 2019
fubuloubu
added a commit
to fubuloubu/vyper
that referenced
this issue
Dec 12, 2019
Merged
fubuloubu
added a commit
to fubuloubu/vyper
that referenced
this issue
Dec 12, 2019
Note that #1763 will implement the opcode, but not in the preferred method of supporting multiple rulesets. |
Merged
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
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 ofuint256
and a gas cost ofG_base
.Backwards Compatibility
No backwards incompatibilities
Dependencies
No dependencies
Copyright
Copyright and related rights waived via CC0
The text was updated successfully, but these errors were encountered: