Strengthen the definition of ``pure`` potentially disallowing e.g. ``codecopy`` - or "the future of ``pure``".
- 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/issues/3835, in particular https://github.com/ethereum/solidity/issues/3835#issuecomment-574854014 states the issue.
The main question is: since ``view`` already allows ``staticcall``, is there any use for the coarse definition of ``pure``, that allows for expressions that are *not* compile-time constant?
Personally, I'd say we should officially strengthen pure, so that everything pure can be used in place of compile-time-constant expressions, e.g. the most basic definition of pure is "everything that can be used as array size of a statically sized array".
We *could* also move towards the opposite direction and e.g. *allow* reading the address of ``this`` in ``pure`` functions and weaken ``pure`` to mainly mean "does not read from storage". But then we need yet another stricter concept for compile-time-constant expressions. So I'm not a fan of that course of action :-).
Contributor guide
Research direction
Start by reading issue 3835 and the linked comment, then compare the two proposed meanings of ``pure`` in this issue. Done means reaching and implementing a decided language-semantics change, including the relationship between ``pure``, compile-time constants, ``view``, and ``staticcall``.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- solidity
- Domain
- compilers
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100