This EIP proposes a standardized approach to struct inheritance using composition over inheritance. It introduces the concept of extended-mapping, extended-array, and extended-functions, allowing for the extension of structs and type-casting between base and derived structs.
Medium - Struct Inheritance In Solidity
EIP Draft - Struct Inheritance
Github - Struct Inheritance
While working on a large project over the past year, I encountered certain limitations with structs in Solidity. To overcome these limitations, I developed an innovative solution by combining struct inheritance with mapping type. Recognizing the potential usefulness of this approach in projects with numerous similar structs, I decided to generalize my solution to dynamic arrays and overloaded functions.
I have written a draft EIP and implemented a solution to address challenges in struct inheritance. I invite the community to review, contribute, and provide insights to refine this proposal.
Let’s collaborate and start conversation!