Awesome
<div align="center"> <h1> Blockchain Developer, Vyper Smart Contract & Python Career Path - Powered By AI - Beginner to Expert Course</h1>| Moccasin Edition 2025 |
<p align="center"><strong>Learn smart contract development, and level up your career </strong></p> <p align="center"> <br /> <a href="https://cyfrin.io/"> <img src=".github/images/poweredbycyfrinbluehigher.png" width="145" alt=""/></a> <a href="https://updraft.cyfrin.io/courses/moccasin"> <img src=".github/images/coursebadge.png" width="242.3" alt=""/></a> <br /> </p> </div>This repository houses course resources and discussions for the course.
Please refer to this for an in-depth explanation of the content:
- Website - Join Cyfrin Updraft and enjoy 50+ hours of smart contract development courses
- Twitter - Stay updated with the latest course releases
- LinkedIn - Add Updraft to your learning experiences
- Discord - Join a community of 3000+ developers and auditors
- Codehawks - Smart contracts auditing competitions to help secure web3
Required Prerequisites
Nice to have:
- A little understanding of python
Table of Contents
<details> <summary>Resources</summary> <ol> <li><a href="#required-prerequisites">Required Prerequisites</a></li> <li><a href="#table-of-contents">Table of Contents</a> <ul> <li><a href="#recommended-tools">Recommended Tools</a></li> </ul> </li> <li><a href="#testnet-faucets">Testnet Faucets</a> <ul> <li><a href="#chainlist">Chainlist</a></li> </ul> </li> <li><a href="#resources-for-this-course">Resources For This Course</a></li> <ul> <li><a href="#important-notes-for-zksync">Important Notes for ZKsync</a></li> <li><a href="#bridging-to-zksync">Bridging to ZKsync</a></li> </ul> </li> </ol> </details> <details> <summary>Welcome & Course Introduction</summary> <ol> <li><a href="#welcome-to-the-course-repo">Welcome to the Course Repo</a> <ul> <li><a href="#best-practices">Best Practices</a></li> </ul> </li> <li><a href="#section-0-welcome-to-the-course">Section 0: Welcome to the Course!</a></li> <li><a href="#section-1-blockchain-basics">Section 1: Blockchain Basics</a></li> </ol> </details> <details> <summary>Vyper 101</summary> <ol> <li><a href="#section-1-welcome-to-remix---favorites-list">Section 1: Welcome to Remix - Favorite's List</a> <ul> <li><a href="#-tweet-me-add-your-contract-in">πΈπ¦ Tweet Me (add your contract in)!</a></li> <li><a href="#workshop">Workshop</a></li> </ul> </li> <li><a href="#section-2-remix-buy-me-a-coffee">Section 2: Remix Buy Me A Coffee</a> <ul> <li><a href="#workshop-1">Workshop</a></li> </ul> </li> <li><a href="#section-3-ai-prompting-asking-questions-and-researching">Section 3: AI Prompting, Asking Questions, and Researching</a> <ul> <li><a href="#workshop-2">Workshop</a></li> </ul> </li> </ol> </details> <details> <summary>Moccasin Fundamentals</summary> <ol> <li><a href="#section-1-python-crash-course">Section 1: Python Crash Course</a> <ul> <li><a href="#google-collab">Google Collab</a></li> <li><a href="#installation--setup-macos--linux">Installation & Setup (MacOS & Linux)</a></li> <li><a href="#installation--setup-windowswsl">Installation & Setup (Windows/WSL)</a></li> <li><a href="#gitpod-or-codespaces">Gitpod or CodeSpaces</a></li> <li><a href="#install-python-windows-wsllinuxubuntu">Install Python (Windows WSL/Linux/Ubuntu)</a></li> </ul> </li> <li><a href="#local-development-introduction">Local Development Introduction</a> <ul> <li><a href="#workshop-3">Workshop</a></li> <li><a href="#python-in-updraft">Python in Updraft</a></li> </ul> </li> <li><a href="#section-2-web3py-favorites-list">Section 2: Web3.py Favorite's List</a> <ul> <li><a href="#workshop-4">Workshop</a></li> </ul> </li> <li><a href="#section-3-titanoboa-favorites-list">Section 3: Titanoboa Favorite's List</a> <ul> <li><a href="#workshop-5">Workshop</a></li> </ul> </li> <li><a href="#moccasin-version">Moccasin Version</a> <ul> <li><a href="#install-command">Install command</a></li> </ul> </li> <li><a href="#section-4-moccasin-favorites-list">Section 4: Moccasin Favorite's List</a> <ul> <li><a href="#-tweet-me-add-your-contract-in-1">πΈπ¦ Tweet Me (add your contract in)!</a></li> <li><a href="#sign-up-for-alchemy">Sign up for Alchemy</a></li> <li><a href="#workshop-6">Workshop</a></li> </ul> </li> <li><a href="#section-5-moccasin-five-more">Section 5: Moccasin Five More</a> <ul> <li><a href="#workshop-7">Workshop</a></li> </ul> </li> <li><a href="#οΈ-section-6-moccasin-buy-me-a-coffee-get-here">βοΈ Section 6: Moccasin Buy Me A Coffee (GET HERE!)</a> <ul> <li><a href="#test-types">Test types</a></li> <li><a href="#workshops">Workshops</a> <ul> <li><a href="#workshop-1">Workshop 1</a></li> <li><a href="#workshop-2">Workshop 2</a></li> </ul> </li> </ul> </li> <li><a href="#section-7-htmljs-buy-me-a-coffee">Section 7: HTML/JS Buy Me A Coffee</a> <ul> <li><a href="#workshop-8">Workshop</a></li> </ul> </li> <li><a href="#section-8-moccasin-erc20">Section 8: Moccasin ERC20</a> <ul> <li><a href="#workshop-9">Workshop</a></li> </ul> </li> <li><a href="#section-9-how-to-get-hired">Section 9: How to get hired</a> <ul> <li><a href="#workshop-10">Workshop</a></li> </ul> </li> </ol> </details> <details> <summary>Advanced Moccasin</summary> <ol> <li><a href="#section-1-moccasin-nfts">Section 1: Moccasin NFTs</a> <ul> <li><a href="#workshop-12">Workshop</a></li> </ul> </li> <li><a href="#section-2-moccasin-defi--algorithmic-trading">Section 2: Moccasin DeFi | Algorithmic Trading</a> <ul> <li><a href="#workshop-13">Workshop</a></li> </ul> </li> <li><a href="#οΈ-section-3-moccasin-defi--stablecoin-get-here">βοΈ Section 3: Moccasin DeFi | Stablecoin (GET HERE!)</a> <ul> <li><a href="#workshop-14">Workshop</a></li> </ul> </li> <li><a href="#section-4-moccasin-signatures">Section 4: Moccasin Signatures</a> <ul> <li><a href="#workshop-15">Workshop</a></li> </ul> </li> <li><a href="#section-5-moccasin-upgrades">Section 5: Moccasin Upgrades</a> <ul> <li><a href="#workshop-16">Workshop</a></li> </ul> </li> </ol> </details> <details> <summary>Course Completion</summary> <ol> <li><a href="#congratulations">Congratulations</a> <ul> <li><a href="#where-do-i-go-now">Where do I go now?</a> <ul> <li><a href="#learning-more">Learning More</a></li> <li><a href="#community">Community</a></li> <li><a href="#hackathons">Hackathons</a></li> </ul> </li> </ul> </li> <li><a href="#disclosures">Disclosures</a></li> <li><a href="#sponsors">Sponsors</a></li> <li><a href="#thank-you">Thank you</a> <ul> <li><a href="#license">License</a></li> </ul> </li> </ol> </details> <!-- - [Required Prerequisites](#required-prerequisites) - [Table of Contents](#table-of-contents) - [Recommended Tools](#recommended-tools) - [Testnet Faucets](#testnet-faucets) - [Chainlist](#chainlist) - [Resources For This Course](#resources-for-this-course) - [Bonus NFTs](#bonus-nfts) - [Important Notes for ZKsync](#important-notes-for-zksync) - [Bridging to ZKsync](#bridging-to-zksync) - [Welcome to the Course Repo](#welcome-to-the-course-repo) - [Best Practices](#best-practices) - [Section 0: Welcome to the Course!](#section-0-welcome-to-the-course) - [Section 1: Blockchain Basics](#section-1-blockchain-basics) - [Vyper 101](#vyper-101) - [Section 1: Welcome to Remix - Favorite's List](#section-1-welcome-to-remix---favorites-list) - [πΈπ¦ Tweet Me (add your contract in)!](#-tweet-me-add-your-contract-in) - [Workshop](#workshop) - [Section 2: Remix Buy Me A Coffee](#section-2-remix-buy-me-a-coffee) - [Workshop](#workshop-1) - [Section 3: AI Prompting, Asking Questions, and Researching](#section-3-ai-prompting-asking-questions-and-researching) - [Workshop](#workshop-2) - [Moccasin Fundamentals](#moccasin-fundamentals) - [Section 1: Python Crash Course](#section-1-python-crash-course) - [Google Collab](#google-collab) - [Installation \& Setup (MacOS \& Linux)](#installation--setup-macos--linux) - [Installation \& Setup (Windows/WSL)](#installation--setup-windowswsl) - [Gitpod or CodeSpaces](#gitpod-or-codespaces) - [Install Python (Windows WSL/Linux/Ubuntu)](#install-python-windows-wsllinuxubuntu) - [Local Development Introduction](#local-development-introduction) - [Workshop](#workshop-3) - [Python in Updraft](#python-in-updraft) - [Section 2: Web3.py Favorite's List](#section-2-web3py-favorites-list) - [Workshop](#workshop-4) - [Section 3: Titanoboa Favorite's List](#section-3-titanoboa-favorites-list) - [Workshop](#workshop-5) - [Moccasin Version](#moccasin-version) - [Install command](#install-command) - [Section 4: Moccasin Favorite's List](#section-4-moccasin-favorites-list) - [πΈπ¦ Tweet Me (add your contract in)!](#-tweet-me-add-your-contract-in-1) - [Sign up for Alchemy](#sign-up-for-alchemy) - [Workshop](#workshop-6) - [Section 5: Moccasin Five More](#section-5-moccasin-five-more) - [Workshop](#workshop-7) - [βοΈ Section 6: Moccasin Buy Me A Coffee (GET HERE!)](#οΈ-section-6-moccasin-buy-me-a-coffee-get-here) - [Test types](#test-types) - [Workshops](#workshops) - [Workshop 1](#workshop-1) - [Workshop 2](#workshop-2) - [Section 7: HTML/JS Buy Me A Coffee](#section-7-htmljs-buy-me-a-coffee) - [Workshop](#workshop-8) - [Section 8: Moccasin Raffle](#section-8-moccasin-raffle) - [Workshop](#workshop-9) - [Section 9: How to get hired](#section-9-how-to-get-hired) - [Workshop](#workshop-10) - [Advanced Moccasin](#advanced-moccasin) - [Section 1: Moccasin ERC20](#section-1-moccasin-erc20) - [Workshop](#workshop-11) - [Section 2: Moccasin NFTs](#section-2-moccasin-nfts) - [Workshop](#workshop-12) - [Section 3: Moccasin DeFi | Algorithmic Trading](#section-3-moccasin-defi--algorithmic-trading) - [Workshop](#workshop-13) - [βοΈ Section 4: Moccasin DeFi | Stablecoin (GET HERE!)](#οΈ-section-4-moccasin-defi--stablecoin-get-here) - [Workshop](#workshop-14) - [Section 5: Moccasin Signatures](#section-5-moccasin-signatures) - [Workshop](#workshop-15) - [Section 6: Moccasin Upgrades](#section-6-moccasin-upgrades) - [Workshop](#workshop-16) - [Congratulations](#congratulations) - [Where do I go now?](#where-do-i-go-now) - [Learning More](#learning-more) - [Community](#community) - [Hackathons](#hackathons) - [Disclosures](#disclosures) - [Sponsors](#sponsors) - [Thank you](#thank-you) - [License](#license) -->All the sections on this repo are for several courses on the Vyper Developer Career path of Cyfrin Updraft.
Recommended Tools
- Recommended Testnet: Sepolia (Or Tenderly Virtual Network)
Testnet Faucets
If you receive a flag pop-up requiring you to have 0.001 ETH on mainnet, you may be able to wait 10 to 20 minutes and try again to avoid adding the 0.001 ETH on the mainnet.
- Main (Sepolia): <a href="https://cloud.google.com/application/web3/faucet/ethereum/sepolia" target="_blank"> Sepolia GCP Faucet </a>
- Tenderly Virtual Testnet: <a href="https://tenderly.co/?mtm_campaign=partner&mtm_kwd=cyfrin" target="_blank"> Tenderly </a>
- Alchemy Faucet (Sepolia):<a href="https://sepoliafaucet.com/" target="_blank"> https://sepoliafaucet.com/</a>
- Infura Faucet (Sepolia):<a href="https://www.infura.io/faucet/sepolia" target="_blank" > https://www.infura.io/faucet/sepolia</a>
- Chainlink Faucet (Sepolia):<a href="https://faucets.chain.link/sepolia" target="_blank" > https://faucets.chain.link/sepolia</a>
- No need for 0.001 ETH on mainnet
- ZKsync Faucets (ZKsync Sepolia):<a href="https://docs.zksync.io/build/tooling/network-faucets.html" target="_blank"> https://docs.zksync.io/build/tooling/network-faucets.html</a>
- ZKsync Bridge:<a href="https://portal.zksync.io/bridge/" target="_blank"> https://portal.zksync.io/bridge/</a>
β οΈ All code associated with this course is for demo purposes only. They have not been audited and should not be considered production ready. Please use at your own risk.
Chainlist
Resources For This Course
- vyper-by-example
- Tenderly
- AI Frens
- claude.ai
- cursor IDE
- ChatGPT
- Phind
- Like ChatGPT, but it searches the web
- Google Gemini
- Other AI extensions
- Github Discussions
- Ask questions and chat about the course here!
- Stack Exchange Ethereum
- Great place for asking technical questions about Ethereum
- Peeranha
- Decentralized Stack Exchange!
- Cookbook
- A smart contract registry and co-pilot
Bridging to ZKsync
If you want to work with real funds on ZKsync for any challenges that we deploy there, you can follow this list.
Please do not use real funds unless you are confident of what you are doing, especially when it comes to private key safety.
- The process for bridging looks like the following:
- Send ETH -> one of your wallets like:
- Use the ZKsync Bridge
Welcome to the Course Repo
Best Practices
- Follow the repository: While going through the course be 100% certain to follow along with the github repository. If you run into an issue check the chronological-updates in the repo.
- Be Active in the community: Ask questions and engage with other developers going through the course in the discussions tab, be sure to go and say hello or gm! This space is different from the other industries, you don't have to be secretive; communicate, network and learn with others :)
- Learn at your own pace: It doesn't matter if it takes you a day, a week, a month or even a year. Progress >>> Perfection
- Take Breaks: You will exhaust your mind and recall less if you go all out and watch the entire course in one sitting. Suggested Strategy every 25 minutes take a 5 min break, and every 2 hours take a longer 30 min break
- Refer to Documentation: Things are constantly being updated, so whenever Patrick opens up some documentation, open it on your end and maybe even have the code sample next to you.
- Use ChatGPT and/or the course chat
Section 0: Welcome to the Course!
Section 1: Blockchain Basics
[!IMPORTANT] Please be sure to go through blockchain basics before coming here! The GitHub repository for that curriculum can be found here:
π± GitHub repository : https://github.com/Cyfrin/blockchain-basics-cu
<p align="right">(<a href="#table-of-contents">back to top</a>) β¬οΈ</p>Vyper 101
Section 1: Welcome to Remix - Favorite's List
π» Code: https://github.com/Cyfrin/remix-favorites-cu
πΈπ¦ Tweet Me (add your contract in)!
Workshop
Spend at most 25 minutes on all of these prompts without the aide of AI. If you're unable to solve them after 25 minutes, stop, take a break, and then work with an AI or the discussions to help you solve them. Good luck!
- Create a function called
add
that adds1
to whatever is inself.favorite_number
- Have the starting favorite number different from
7
, check to make sure it's the number you set! - (Challenging) Create a new type using the "struct" keyword, and create a function that will save a new variable of that type to a state/storage variable.
Section 2: Remix Buy Me A Coffee
π» Code: https://github.com/Cyfrin/remix-buy-me-a-coffee-cu
Workshop
Spend at most 25 minutes on all of these prompts without the aide of AI. If you're unable to solve them after 25 minutes, stop, take a break, and then work with an AI or the discussions to help you solve them. Good luck!
- (Optional) Get the price of a different asset using Chainlink price feeds on your fake chain
- Write a function to get the total amount of funds in the contract
- Loop through the array of funders, and how much they've funded!
- Try not to just use
self.balance
!
- (Challenging!) Write a function that allows you to change the owner of the contract
- Hint: You'll need to make sure
OWNER
isn't immutable!
- Hint: You'll need to make sure
Section 3: AI Prompting, Asking Questions, and Researching
No code here!
Workshop
Get a good idea for "how good" your AI is. Maybe shop around for an AI you like. Ask them some softball questions to figure out how smart they are. Like:
- Make a minimal vyper contract
- What's the difference between a dynamic array and a fixed sized array?
- Here is some vyper code:
@external
def add_person(name: String[100], favorite_number: uint256):
new_person: Person = Person(favorite_number = favorite_number, name = name)
self.list_of_people[self.list_of_people_index] = new_person
self.list_of_numbers[self.list_of_people_index] = favorite_number
self.list_of_people_index += 1
self.name_to_favorite_number[name] = favorite_number
What does it do?
- Is this vyper code safe?
send(OWNER, self.balance)
<p align="right">(<a href="#table-of-contents">back to top</a>) β¬οΈ</p>
Moccasin Fundamentals
Section 1: Python Crash Course
Python Version: 3.11
Full code: https://github.com/Cyfrin/python-in-updraft-cu
Google Collab
Installation & Setup (MacOS & Linux)
Installation & Setup (Windows/WSL)
- Special Guest Vasiliy
- WSL
- When working in WSL, use Linux commands instead of Windows commands
- TroubleShooting
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash
β οΈ Please use Gitpod as an absolute last resort
Gitpod or CodeSpaces
- Gitpod
- If using this, NEVER share a private key with real money on Gitpod
- Ideally you figure out the MacOS, Linux, or Windows install though
Install Python (Windows WSL/Linux/Ubuntu)
To check for python, run:
which python
python --version
which python3
python3 --version
To install a specific version of python:
sudo apt-get update
sudo apt-get install software-properties-common
sudo add-apt-repository ppa:deadsnakes/ppa
sudo apt-get update
sudo apt-get install python3.11
Local Development Introduction
CMD + K
orCTRL + K
clears the terminalcode .
to open VSCode in a new VSCode window
Workshop
Spend at most 25 minutes on all of these prompts without the aide of AI. If you're unable to solve them after 25 minutes, stop, take a break, and then work with an AI or the discussions to help you solve them. Good luck!
Here is your final project, make a function that takes 2 inputs, the first is a year, and the second is a number of days. The function should print out either:
Y days after Jan 1st, X, it will still be the year X
or
Y days after Jan 1st, X, it will be the year Z
Where:
X
is the starting year, the first input to the functionY
is the number of days, the second input to the functionZ
is the year after the X number of days
Examples
The function invocations will look like this:
what_year(1985, 376)
Which should print:
376 days after Jan 1st, 1985, it will be the year 1986
Or
what_year(1985, 200)
Which should print:
200 days after Jan 1st, 1985, it will still be the year 1985
Or
what_year(1985, 1098)
Which should print:
1098 days after Jan 1st, 1985, it will be the year 1988
Notice how "still" is added to the second sentance, but not the first!
Assumptions
- Assume a year is 365 days (but, if you're off by a day or two, that's ok)
- Don't worry about leap years
- Don't use the datetime package!
Python in Updraft
-
Virtual environments image
<img src="./images/virtual_environments.png" width="300" alt="Virtual environments diagram">
Section 2: Web3.py Favorite's List
π» Code: https://github.com/Cyfrin/web3py-favorites-cu
Workshop
Spend at most 25 minutes on all of these prompts without the aide of AI. If you're unable to solve them after 25 minutes, stop, take a break, and then work with an AI or the discussions to help you solve them. Good luck!
Do one of the following:
- (Optional) Deploy the
favorites.vy
contract to your tenderly RPC URL! - Deploy the
favorites.vy
contract to anvil with a different wallet address, and a new encrypted key!
Section 3: Titanoboa Favorite's List
π» Code: https://github.com/Cyfrin/boa-favorites-cu
- Titanoboa
- Pyevm image <img src="./images/pyevm.png" width="300" alt="pyevm">
Workshop
Spend at most 25 minutes on all of these prompts without the aide of AI. If you're unable to solve them after 25 minutes, stop, take a break, and then work with an AI or the discussions to help you solve them. Good luck!
- Create your own contract that you can:
- Deploy to your local anvil instance
- Call
set_bool(boolean)
which which change a variable namedmy_bool
to theboolean
you pass it - Call
get_bool()
which will return the value ofmy_bool
- Deploy to your local tenerly network (if you still have the free trial!)
Moccasin Version
0.3.6
Install command
uv tool install 'moccasin==0.3.6'
Section 4: Moccasin Favorite's List
π» Code: https://github.com/Cyfrin/mox-favorites-cu
wget -O zkvyper <RELEASE_VERSION>
chmod +x zkvyper
mv zkvyper /usr/local/bin
πΈπ¦ Tweet Me (add your contract in)!
Sign up for Alchemy
Workshop
Spend at most 25 minutes on all of these prompts without the aide of AI. If you're unable to solve them after 25 minutes, stop, take a break, and then work with an AI or the discussions to help you solve them. Good luck!
- Deploy your contract to your tenderly virtual network
- Write your own deploy script, and deploy it to the pyevm network
- Write your own deploy script, and deploy it to the eravm network
- Write a new test in your testfile, and run it!
Section 5: Moccasin Five More
π» Code: https://github.com/Cyfrin/mox-five-more-cu
create_copy_of
image <img src="./images/create_copy_of.png" width="300" alt="create_copy_of">
Workshop
Spend at most 25 minutes on all of these prompts without the aide of AI. If you're unable to solve them after 25 minutes, stop, take a break, and then work with an AI or the discussions to help you solve them. Good luck!
- Add a second module to
five_more
- Initialize it
- And call one of the functions from it. For example, in your
five_more
contract:
initializes: my_contract def some_func(): my_contract.set_bool(True)
- Try to export functions from 2 different modules
- (Challenging) Make a contract that successfully compiles with the
uses
keyword - (Challenging) Make a contract that uses the contract from #3!
βοΈ Section 6: Moccasin Buy Me A Coffee (GET HERE!)
π» Code: https://github.com/Cyfrin/mox-buy-me-a-coffee-cu
- Storage Images:
Test types
There are many types of tests:
- Unit: Test a single function/part of your code.
- Integration: Test how different parts of your code work together.
- Staging: Test your code in a production-like environment.
- Forked (Staging): Test your code in a production-like environment, but with a forked version of the blockchain.
- Fuzz: Test your code with random inputs.
- Formal Verification: Prove that your code is correct.
Workshops
Spend at most 25 minutes on all of these prompts without the aide of AI. If you're unable to solve them after 25 minutes, stop, take a break, and then work with an AI or the discussions to help you solve them. Good luck!
Workshop 1
Write a test that:
- Funds the contract with 10 different funders
- Withdraws the funds using the owner
- Asserts that:
- The ending balance of
buy_me_a_coffee
is 0 - The ending balance of the owner is the addition of all the amounts the funders added
- The ending balance of
Workshop 2
- Write enough tests to get you over 95% code coverage for
buy_me_a_coffee.vy
- Sign up for Cyfrin Profiles! (And then tweet at me!)
- Push your code up to GitHub
- Add a new commit up to your GitHub repo
Section 7: HTML/JS Buy Me A Coffee
π» Code: https://github.com/Cyfrin/html-fund-me-cu
Workshop
None, Just enjoy the section!
Section 8: Moccasin ERC20
π» Code: https://github.com/Cyfrin/mox-erc20-cu
We teach how to build minimal ERC20 tokens like WETH, LINK, USDC, and DAI!
- snekmate
- mamushi
- ruff
- vheader (py)
- vheader (rust)
- events
- Testing Events
- Introduction to fuzz testing
Extra Learnings
- Random Numbers
- CEI
- Console
Workshop 1
Spend at most 25 minutes on all of these prompts without the aide of AI. If you're unable to solve them after 25 minutes, stop, take a break, and then work with an AI or the discussions to help you solve them. Good luck!
If you do the stateful fuzzer challenge, 1 hour is ok!
- Write tests for your
snek_token
ERC20, try to get to 80% coverage! - (Challenging!) Write a stateful fuzzer for your ERC20 token!
Note
The workshop of the next section is what you should do. DO NOT CONTINUE TO ADVANCED MOCCASIN UNTIL YOU'VE COMPLETED THE WORKSHOP OF SECTION 9! You'll only be cheating yourself.
<p align="right">(<a href="#table-of-contents">back to top</a>) β¬οΈ</p>Section 9: How to get hired
- βοΈ Aricle: https://medium.com/cyfrin/how-to-become-a-smart-contract-developer-or-security-researcher-c665e50515c9
- π₯ Video: https://www.youtube.com/watch?v=e1N4aWIJMN0
Steps
- Write down your reasons why
- Do 1 full course Cyfrin Updraft
- Get through
Advanced Moccasin
- Get through
- Apply your knowledge and get real experience
- Hackathons like ETH Global
- Competitive Audits like CodeHawks
- Make pull requests to open sourced projects
- Build projects and add them to your GitHub
- Update your Cyfrin Profile
- Apply to jobs, start a company, or freelance
- Repeat steps 3 and 4
- You should always be learning more by doing more!
Workshop
Spend at most 1 week on this :)
Feel free to use some AI!
Prompt
Build a smart contract lottery/raffle yourself, using minimal AI help. You can build a "weak randomness" lotttery, using on-chain randomness (but just know, it's not secure!). Or go the extra mile and use Chainlink VRF 2.5 to build a secure lottery.
You should:
- Have test coverage of over 80% of your lines of code
- Have a function called
enter_raffle
for people to enter your raffle - The raffle should pick 1 winner after X seconds
- Have this be a customizable variable
- The winner should get the sum of all the entrance fees added by the other participants
- Anyone can call a
pick_winner
orrequest_winner
function, that will randomly select the winner.
Here are some example code bases to help you:
-
π» Weak Randomness Code: https://github.com/Cyfrin/mox-raffle-cu
-
π» Chainlink VRF 2 (Not 2.5 - this code is slightly outdated) Code: https://github.com/Cyfrin/mox-raffle-cu/tree/e41e3216137ff86c1f663a6730c52dd38586ec12
Advanced Moccasin
Section 1: Moccasin NFTs
π» Code: https://github.com/Cyfrin/mox-nft-cu
Workshop 1
Spend at most 25 minutes on all of these prompts without the aide of AI. If you're unable to solve them after 25 minutes, stop, take a break, and then work with an AI or the discussions to help you solve them. Good luck!
- Upload your own dog image to IPFS, mint it as an NFT, and then see it in your Metamask!
- Write tests to get to at least 80% coverage!
Workshop 2
Spend at most 25 minutes on all of these prompts without the aide of AI. If you're unable to solve them after 25 minutes, stop, take a break, and then work with an AI or the discussions to help you solve them. Good luck!
- Deploy your mood NFT to a locally running chain, flip it's mood, and view it in metamask!
- Get to 80% test coverage!
Section 2: Moccasin DeFi | Algorithmic Trading
π» Code: https://github.com/Cyfrin/mox-algorithmic-trading-cu
<p align="center"> <br /> <img src="images/defi.png" width="500" alt=""/></a> </p>We will rebalance a portfolio using USDC and WETH.
Workshop
Spend at most 25 minutes on all of these prompts without the aide of AI. If you're unable to solve them after 25 minutes, stop, take a break, and then work with an AI or the discussions to help you solve them. Good luck!
- Copy the code you wrote in your notebook into some scripts
- Run your scripts on a Tenderly virtual network, or a forked network
- Start with your target allocations not being correct, but then correct them!
βοΈ Section 3: Moccasin DeFi | Stablecoin (GET HERE!)
π» Code: https://github.com/Cyfrin/mox-stablecoin-cu
You'll learn how to build your own stablecoin! Pick collateral like WETH, WBTC, and USDC to make your own stablecoin! Stablecoins one of the most POWERFUL applications on earth!
Workshop 1
Spend at most 25 minutes on all of these prompts without the aide of AI. If you're unable to solve them after 25 minutes, stop, take a break, and then work with an AI or the discussions to help you solve them. Good luck!
- Get your unit test coverage above 80%!
Workshop 2
Spend at most 25 minutes on all of these prompts without the aide of AI. If you're unable to solve them after 25 minutes, stop, take a break, and then work with an AI or the discussions to help you solve them. Good luck!
- Complete your own fuzz tests!
Workshop 3
- Look into the audit report, see if you can spot some issues with this codebase yourself!
Section 4: Moccasin Signatures
π» Code: https://github.com/Cyfrin/mox-signatures-cu
SubLesson - Signatures
Workshop
Spend at most 25 minutes on all of these prompts without the aide of AI. If you're unable to solve them after 25 minutes, stop, take a break, and then work with an AI or the discussions to help you solve them. Good luck!
- Deploy to ZKsync (era test node, sepolia, or tenderly ETH virtual network)
- Try to make a bigger merkle tree with 8 leaves!
Section 5: Moccasin Upgrades
π» Code: https://github.com/Cyfrin/mox-upgrades-cu
Workshop
Spend at most 25 minutes on all of these prompts without the aide of AI. If you're unable to solve them after 25 minutes, stop, take a break, and then work with an AI or the discussions to help you solve them. Good luck!
- Try to write a contract that has a function selector collision with the proxy
- Write a contract where the storage variables change order!
<p align="right">(<a href="#table-of-contents">back to top</a>) β¬οΈ</p>
Congratulations
ππππππππππππ Completed all The Course! ππππππππππππ
Where do I go now?
Learning More
- Top 10 learning resources
- Patrick Collins
- CryptoZombies
- Alchemy University
- Speed Run Ethereum
- Ethereum.org
Community
Hackathons
Be sure to check out project grant programs!
And make today an amazing day!
<p align="right">(<a href="#table-of-contents">back to top</a>) β¬οΈ</p>Disclosures
Transparency is important! So we want to disclose any potential conflicts that might have affected my judgement so you can pick tools that are right for you. Patrick is co-founder of Alpha Chain, a blockchain infrastructure company. Alpha Chain runs Chainlink, Ethereum, Binance, Polygon, Harmony, Solana, Moonbeam, and Moonriver blockchain services. Alpha Chain often works with Alchemy and receives discounted services. Patrick is the co-founder of Cyfrin, and they do smart contract security & auditing services. Patrick is also the co-founder of Chain Accel, who is an advisor on the Peeranha project.
Because of all this, I have added alternatives to each section where we suggest a tool.
<p align="right">(<a href="#table-of-contents">back to top</a>) β¬οΈ</p>Sponsors
A huge thank you to our sponsors. These are the groups and technologies
Thank you
Thanks to everyone who is taking, participating in, and working on this course. It's been a passion project and a data dump of everything I've learnt in the web3 space to get you up to speed quickly. Also, a big thank you to Cyfrin & Chain Accel for encouraging this course to come to light, and many, many, many people from the community.
And thanks to the Cyfrin team for making this possible!
<a href="https://github.com/cyfrin/moccasin-full-course-cu/graphs/contributors"> <img src="https://contrib.rocks/image?repo=cyfrin/moccasin-full-course-cu" /> </a>License
Cyfrin Updraft content is open-sourced licensed as GPLv3.
<!-- export MOCCASIN_KEYSTORE_PATH="$HOME/.moccasin/course_keystores" -->