Structure of large smart contract

How have you envisioned the structure of big smart contracts to be?
It becomes quite hard to maintain an overview in the file, when the contract code and test code is getting bigger and bigger

Depending on what makes sense, following what is common in Rust.
For example one common setup would be that you would have


where, for example would define your common types, impls would implement functionality on those types, and would contain various tests.

In you would then just have top-level entrypoints, using functionality in

is that what you were asking?

Okay, I was just i doubt whether a smart contract would work if there code was outside the file. It seemed that all examples simply used only the But nice to know that we can just do it the common way.
Thank you for your quick reply :slight_smile:

1 Like