Change ``setimmutable`` Yul builtin to reference code object, or use special ``codecopy`` version that does the replacement..
- Dominant language
- C++
- Stars
- 25.7k
- Forks
- 6.2k
- Avg merge
- 1d 11h
- Merged PRs (30d)
- 21
Description
Came up in https://github.com/ethereum/solidity/pull/8583#discussion_r419307365
It might be nice to generalize ``setimmutable``, resp. reduce the assumptions it makes. Two options came up so far:
Use additional arguments for the memory offsets of the code to-be-modified and the name of the code object in ``setimmutable``:
```
setimmutable(0 /* memory offset of code to be modified */, "", "", )
```
Or introduce a new variant of ``codecopy`` that implicitly replaces the immutables - however I'm not sure how this would specify the immutable values - would it take a long list of arbitrary arguments? Would it specify a memory area and an order in memory?
Contributor guide
Research direction
Start with the discussion linked from PR #8583, then compare the two proposed designs for generalizing setimmutable or introducing a special codecopy variant. The issue does not name files or tests; done would require an agreed design that specifies how the code object and immutable values are referenced.
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
- Needs clarification
- Newbie friendliness
- 25/100