EIP Draft: Struct Inheritance

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!


This is the wrong forum to discuss solidity. I recommend you open an issue against the ethereum/solidity github.

Your mention of the issue from certain aspects is correct because I have specifically investigated this issue in the Solidity language. However, we can also consider this issue from another perspective, which is the casting of smart contract entities in the memory and storage of the EVM.
thanks for your suggestion