-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
Introduce solidity.evmVersion() to query the target EVM #10283
Comments
Is there currently any way to query the EVM to find out what version it is? |
A more refined statement would be Potentially this |
The proper way of doing this would probably be to expose this as a special yul builtin and then actually expose it to solidity via stdlib? The funny thing here is: is this compile-time constant :-)? It is, if we produce evm bytecode directly... if we first go to Yul, though, we can still generate code for a different evm version from that, that's a bit messy... on the other hand, Yul code is implicitly generated for specific evm versions, it just doesn't make this explicit... |
Not sure I follow the reasoning for why it should be a Yul builtin, but also see this:
|
Well, it kind of depends whether we consider Yul code to target a fixed evm version. And yeah - actually also only works, if we had a Yul dialect with all builtins, but could still change the evmversion... i.e. you'd need to have shifts as builtins to formulate post-constantinople code. So yeah, maybe indeed better not to bother with it on the Yul level, nevermind. |
This issue has been marked as stale due to inactivity for the last 90 days. |
Hi everyone! This issue has been automatically closed due to inactivity. |
This would still be very useful. |
This issue has been marked as stale due to inactivity for the last 90 days. |
Introduce
solidity.evmVersion()
function which returns an enum ofenum solidity.EvmVersion { Homstead, TangerineWhistle, SpuriousDragon, ... }
.This would mean the
solidity
identifier is reserved for "language magic", but we could consider such functions to be explicitly importable instead from the special solidity source:This would be useful for implementing features in #10282.
The text was updated successfully, but these errors were encountered: