Open
Description
I'm pretty sure there are issues about this scattered across the project, but this has come up recently, so I'll create a new one.
Since linking is a bit cumbersome, it has been brought up that libraries should be explicit immutable state variables, so that linking happens at construction time instead of before deployment. If we also open this up to non-immutable state variables for libraries, it will create a high-level interface for delegatecall and proxies, even though the library interface cannot be changed after compilation (i.e. for a truly generic proxy, we would need .delegatecall
anyway).
Pros:
- easier recompilation (no issue about using the compiler to link or substituting manually)
Cons:
- it is more complicated for off-chain tools to get the library address (it is not directly in the metadata file, but has to be extracted from the constructor)
- "using for" does not work