How can I put different parts of my contract in its own separate file (to keep sane)?
Programs tends to grow and being able to structure the code in different files feels like a basic language feature.
How can I put different parts of my contract in its own separate file (to keep sane)?
Programs tends to grow and being able to structure the code in different files feels like a basic language feature.
You canβt split your contract into multiple files, but you can split your code into multiple contacts that can be deployed under the same account.
Hi @pdahlberg! Donβt know if I correctly understand the question but I can say that under development I followed the kitty-items repository structure. You can check it here GitHub - onflow/kitty-items: Based on CryptoKitties, Kitty Items is an example of a full-stack dapp built on Flow.
If you look inside the kitty-items-cadence/cadence folder you can see how smart contracts are managed in different folders and file. I find it an intuitive organization.
You can also check the Decentologyβs Dapp-Starter https://dappstarter.decentology.com Here you can create a repository that itβs already structured and configured, give it a try!
Thanks for the link Fabius. I would have wished for a bit more freedom in separating things into separate files, but I can also see the reason for the current setup. Iβm PoC:ing a game so I probably have a few more pieces than the kitty example I guess.