This repository has been archived by the owner on Feb 26, 2024. It is now read-only.
Allow non-numeric immutable keys in contract-schema and add test of Yul immutable recognition #4746
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
As of Solidity 0.8.12, we can now get
immutableReferences
from Yul contracts that use immutables. However, the keys for these are not numeric AST IDs, but rather simply the names of the immutables. So, I'm taking out thepatternProperties
and replacing it withadditionalProperties
, since the keys can now be anything.This PR doesn't do the work of allowing us to actually do things with Yul immutables, like decode them. I figure that can come later (I've put up issue #4747 for that). This is just updating the contract schema.
Note: I checked our existing immutable-handling code and as best I can tell this shouldn't screw any of it up.
Edit: Actually, you know what, I was a little bit unsatisfied with this, so I went back and added a test -- not a test of the
contract-schema
change of course, that should have no functional effect at the moment; but a test that yes, the debugger can indeed use Yul's immutableReferences to correctly recognize Yul code with immutables in it (without any code changes to codec or the debugger necessary :) ). Obviously this required updating the debugger tests to Solidity 0.8.12...