Cluster 1 -- Week 1
Last updated
Last updated
Cluster one will focus on all concepts below. The materials below shall be reviewed on your own time and will be referenced throughout the cluster. Assignments can always be found in these sections.
1) Ownership/ Borrowing
2) Structs
3) Enums
4) Types, Traits/ Attributes
5) Storage, Vectors, Maps
6) Solana CLI and Builds/ File/Crate/ Package/ Program Mgmt
Mastery of a skill comes from immersing yourself in the study and use of it in many different ways.
For the Code Study Journal, you will need to complete 3 code journals the first week for codebases from Native Rust. Second week is the same example programs in Anchor. For the third week, you will do a compare and contrast video between the Native and the Anchor versions all of these are due by Sunday midnight UTC at the end of each week). You will send these to GitHub-as prescribed for all Cohort work [NOTE: each journal entry should focus on 30-50 lines of code- meaning your total annotations should be between 90-150. If you end up doing a single contract that is 90-150 lines, that works for all 3 that week]
Here are the steps to complete each one:
Select a piece of code/ smart contract. The first week, we will continue to focus on Native Rust code in Solana Programs- then we will move to Anchor in week two. Week three will be a video walkthrough of the comparison between the two. Please choose from these repos for the process. Choose from the following options since these all have both Native and Anchor examples for programs
Native Versions
Annotate the code- in other words, make notes on the document explaining what is happening through the code.
What are the concepts (borrowing, ownership, vectors etc)
What is the organization?
What is the contract doing? What is the mechanism?
How could it be better? More efficient? Safer?
As we shift to week 2 (CLUSTER II- this one is two weeks long), your lens of Native Rust -> Anchor should be explored, annotated, and analyzed.
3. Make a video of your code study,for week three (CLUSTER II), you will make a video comparing and contrasting Native vs. Anchor programs, and show an example of how you made the code better, test, compile, and deploy it on video.
We ask that you interpret and apply these instructions in the way you understand them. Not everyone will do so the same way. There are no wrong answers- the only way to fail this part is to not do it and ship on time.
Engagement through reading, thinking, and writing about code in this way leads to your own discovery of the how, what, where, when, why of smart contracts- architecture & mechanism .
We are interested in how YOU do this process. The more you immerse and think deeply about the code, the more expert you will become.
All Code Journals must completed in the WBA Organization repo in GitHub! Video should be submitted via Google Classroom on the assignment link therein
Copy the questions below and provide the answer for each Code Journal you complete.
What are the concepts (borrowing, ownership, vectors etc)
What is the organization?
What is the contract doing? What is the mechanism?
How could it be better? More efficient? Safer?
The code could be safer and better if…..
Ultimately, write everything that comes to your mind as much as you can- by reading, thinking about what you see, processing it, and outputting your thoughts, questions, comments, revision-suggestions, you are gaining mastery of the concepts.
Make sure you push your hacked code from class to the WBA Github with correct naming conventions.
You Capstone LOI will be due at the end of the next cluster (3 weeks into course).