Replies: 2 comments 4 replies
-
|
I have the same concern. I'm trying to use Compose in my own project so the storage will be consistent so code can be reused. And the replication of storage library code into the Facets seems like a needless complication. Why not just import the storage libraries, and use them in the Facets? Make the Facets just a wrapper around the library functions to expose them for us in a proxy? Still no inheritance and still readable because all the logic is in the library. I know the point is devs should just use the deployed instance. But they will still need to include the storage libraries in their code so they can access the same storage. Trying to solve this with a custom build step to generate code is further complicating the problem. |
Beta Was this translation helpful? Give feedback.
-
Once we deploy ERC20Facet and other facets to blockchains, I don't plan to change them anymore. So we won't have to worry about maintaining them in the future. Compose standard library of facets is written for users creating their projects -- and the end users will use them onchain, not off chain, though perhaps some will. But when the users want to look at the source code of facets I want it to be as easy and straight forward as possible.
@cyotee I suggest you do that if you want to. The inheritance and other rules only apply to Compose, they don't apply to what people want to do in their own projects. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
gm, since we want to create this library without inheritance there is and will be duplicated code, e.g., between
ERC20Facet.solandLibERC20.sol. When updating this in the future, it might lead to divergent code within different files if not carefully maintained. I think right now it's fine but as the library grows and gets more complex there might be cases where changes are missed.What are your thoughts about that? Do you see it as a potential issue?
I thought, how about we create a code generation pipeline and syntax so that code only is written once and then automatically applied everywhere needed via this pipeline.
Beta Was this translation helpful? Give feedback.
All reactions