Lift restrictions on immutables.
- Dominant language
- C++
- Stars
- 25.7k
- Forks
- 6.2k
- Avg merge
- 1d 11h
- Merged PRs (30d)
- 21
Description
As it turns out that we have several bugs in the ``ImmutableValidator``, we prepone our plan of lifting the "assign-once" restrictions during creation that was originally only planned with https://github.com/ethereum/solidity/issues/13723.
Goal is to allow uninitialized immutables (defaulting to zero-value) and multiple assignments to immutable (behaving like regular variables) during creation. At first we can retain the restriction of immutable initializtion (other than direct initialiation at the declaration) having to happen inside the constructor body.
In a subsequent step we can allow assignments to immutables in arbitrary functions, while making it an error if a function writing to any immutable occurs in the call graph of the deployed contract (that is, the function can be called from an external function or indirectly ends up in the internal dispatch due to being taken as function pointer expression potentially even only during creation).
Contributor guide
Research direction
No files or tests are named. Start by tracing ImmutableValidator and the compiler paths for immutable initialization during contract creation. The first step should cover uninitialized immutables and repeated creation-time assignments; later work must address arbitrary functions and call-graph restrictions, with compiler tests demonstrating each rule.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp, solidity
- Domain
- blockchain, compilers
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100