Structuring Your Contract
Last updated
Last updated
The way you structure your smart contract is really a matter of personal preference. However, I've created a boilerplate contract with the structure that I personally use.
You don't have to use my structure, but if you're stuck and don't know where to start, this can be helpful for you. The boilerplate contract is located at the following Github URL.
As I mentioned, this is all a matter of personal preference. Many contract developers like to keep all of the logic in 1 or 2 files, as you can see with something like the .
My personal preference - especially since my contracts can grow quite large, is to separate different purposes into different files. I like having contract actions in 1 file, regular functions in another file, constants in another file, etc.