0

A noob question: is it possible or a good practice to put interfaces into one master interface such that all contracts in a DApp only import one interface?

1

It is possible for an interface to inherit from multiple interfaces in Solidity. Is it good practice? It depends. See SOLID. Sometimes these principles are negligible though in the dApp development because of gas optimization and other restrictions such as a limit on the amount of bytecode, but as Solidity is object(contract)-oriented you may find these principles useful.

1
  • Thanks for the answer. Putting all into one is one possible solution I had in mind. I was also wondering if there is a better practice of interface management. Imagine importing and declaring 10+ interfaces (may not be a lot), this is a little component that takes disproportional amount of effort to manage.
    – Maxareo
    Jul 14 '21 at 6:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.