Smart Contract Repo File Structure
This is a beta version of the Solana Toolkit, and is still a WIP. Please post all feedback as a GitHub issue here.
Typically Solana smart contracts (aka programs) workspaces will be have the following file structure:
The main smart contract is the lib.rs
file, which lives insides the programs
directory, as shown below:
As the smart contract gets more cumbersome, you'll typically want to separate the logic into multiple files, as shown below:
For native rust smart contract development, you need to explicitly write out the entrypoint and processor for the program, so you'll need a few more files: