Replies: 1 comment 5 replies
-
Think of contracts as first class citizens of the EVM execution environment (because they are), akin to object instances of classes ( If instead, you have separate functionality that each contract is performing (let's say that A and B are two different types of interactions, and C is a router that works with A and B to coordinate the higher level workflow of the application) then yes it makes more sense to keep them separate. Until modules are implemented the current best practice is to re-write all of the types and interfaces you are using in each file that is using them, which will add some additional overhead for writing it (but again not for reading it since each file stands by itself as monolithic code, which makes it easier to audit). Once modules are implemented, my recommendation would be to put re-usable types, functions, and interfaces into a common library module that all of A, B, and C can use, and then build out each separate functionality into separate contracts that use the common library module to implement them (remember, |
Beta Was this translation helpful? Give feedback.
-
Hello,
I have a decentralized system in mind that i envision requiring three contracts:
A, B, and C are similar contracts, they store information about aType, bType, and cType items in the respective contracts through getters and setters, and some special logic per contract this means the app needs to communicate with multiple contracts but they remain very simple and contained
In general is this modular approach the correct design to envision, or is it better to build one God Contract which is a conglomerate of all three contracts? What are the tradeoffs to consider at this level?
Beta Was this translation helpful? Give feedback.
All reactions