Structs vs. nested Contracts

qqwyqqwy Posts: 15Member
When is it better to create a struct inside a contract, and when is it better to split off your logic over multiple contracts (and thus create contracts of kind B from within Contract A)?

Best Answers


  • qqwyqqwy Posts: 15Member
    What a wonderful in-depth answer, @o0ragman0o . Thank you!

    So if I understand correctly, when using separate contracts, you can build something where e.g. new contracts that inherit from the correct abstract contracts can be used in the place of e.g. older obsolete contracts?

    As for the separation of concerns: Where do libraries enter this picture? At first I thought they only were a way to 'namespace' functions and archieve separation of concerns/code clarity by structuring your things inside them, but they seem to have some extra rules of which I don't fully grasp the implications.
Sign In or Register to comment.