Best practice for avoiding cyclic dependencies?

@shark0der asked on Telegram

What’s the best practice to avoid cyclic dependencies? I’m having trouble verifying my contracts using oz verify…
It will be quite hard to create a minimum example as I have over 30 contracts and I’m not sure where it’s coming from
I’ve dugged into the source code and saw that oz uses truffle-flattener
It has an open issue regarding this: https://github.com/nomiclabs/truffle-flattener/issues/14
I’m thinking thag declaring interfaces for all my classes might solve this issue, however this will hurt code navigation quite badly

Hi @shark0der,

Unfortunately it doesn’t look like there is a silver bullet for this.

Interfaces should resolve this but may hurt navigability.

You could try solidity-flattener to flatten.

@shark0der advised they have created a PR for truffle-flattener which handled cyclic dependencies.

cc @Skyler_Fly you may want to look at this.