Deploy Scripts

A comprehensive guide to deploying a Vyper smart contract using a Python deployment script with Moccasin. The lesson covers importing the contract, setting up the initial supply, and running the script to deploy the contract to a local blockchain.

1. Intro
A comprehensive introduction to building your own ERC20 token using Vyper and the Snekmate library. The lesson covers concepts like deploying tokens, importing libraries, testing, and even how to intentionally introduce a bug for testing purposes. Duration: 5min
2. Setup
A comprehensive introduction to setting up a fuzzing project using Mox. The lesson covers creating a new project directory, initializing it with a Python project structure, and exploring the initial files and configuration settings. Duration: 2min
3. Custom Pyproject
A comprehensive guide to project customization with pyproject.toml - Learn how to customize different aspects of your project, including folder names, dependencies, and more, using the pyproject.toml configuration file. Duration: 3min
4. What Is Erc20
A comprehensive explanation of ERC20s - This lesson explains the Ethereum Improvement Proposal (EIP) process, what ERC20s are, and how they are used to create tokens for smart contracts. Duration: 4min
5. Build It
A practical guide to building an ERC20 token on the Ethereum blockchain using Vyper. The lesson covers creating a basic ERC20 token contract and understanding the methods needed for its functionality. Duration: 2min
6. Mox Libs Git
A practical guide to using libraries for Vyper smart contracts. This lesson introduces the concept of libraries, how they function in Vyper, and how to install libraries from both GitHub and PyPI repositories, along with a demonstration of using them in your projects. Duration: 6min
7. Mox Libs Pypi
A comprehensive guide to installing and using third-party packages in a MoCcasin project. The lesson covers creating virtual environments, installing packages from PyPI, and working with dependencies in the `pyproject.toml` file. Duration: 6min
8. Mox Idk
A comprehensive guide to building a custom ERC20 token using the Snekmate framework. This lesson covers setting up a development environment, writing the contract, understanding the ERC20 standard, and implementing important functions like transfer and approve. Duration: 10min
9. Init Supply
A practical guide to setting the initial supply for your ERC20 token using the Snekmate library. The lesson covers the basics of defining an initial supply variable in your Vyper smart contract and using the `mint` function to create tokens. Duration: 1min
10. Built In Interfaces
A comprehensive guide to Vyper built-in interfaces. This lesson delves into the significance of these interfaces in ensuring a robust and secure development process for your contracts, emphasizing their importance in Vyper's compilation logic and token standards implementation. Duration: 2min
11. Deploy Scripts
A comprehensive guide to deploying a Vyper smart contract using a Python deployment script with Moccasin. The lesson covers importing the contract, setting up the initial supply, and running the script to deploy the contract to a local blockchain. Duration: 2min
12. Tests
A simple guide to writing a test for a Vyper smart contract using Python and Vyper. The lesson covers the basics of writing unit tests, testing total supply, and verifying the results using the "mox" test command. Duration: 2min
13. Events
A comprehensive guide to events and logging in Vyper smart contracts. This lesson covers how the EVM uses logs to store data, how events are used in Vyper and Brownie, and how to view events on Etherscan. Duration: 9min
14. Testing Events
A comprehensive guide to testing events and logs in Vyper smart contracts. The lesson covers reading logs to verify actions and using BoA's .env.prank to control the sender of a transaction and test events in a with context. Duration: 5min
15. Formatting
A comprehensive guide to formatting Vyper and Python code - This lesson introduces tools like Ruff and Mamushi to ensure clean, consistent code. You’ll learn how to automatically format your code for better readability and maintainability. Duration: 3min
16. Justfile
A helpful guide to using a Justfile in your Vyper development. The lesson covers how to create a Justfile and configure it to run common commands, such as formatting and linting your project code, making it easier to manage your development workflow. Duration: 2min
17. Vheaders
A practical guide to using Vheader for formatting code in your Vyper projects - Vheader is a tool that can help you automatically format your Vyper code, creating clear and consistent headers and sections that make your codebase much more readable. Vheader is available in Python and Rust. Duration: 2min
18. Fuzzing
A comprehensive introduction to fuzz testing for smart contracts. The lesson introduces fuzzing in the context of Vyper development and explores the concepts of stateless and stateful fuzzing. Duration: 11min
19. Stateless Fuzz
Duration: 11min
20. Stateful Fuzz
A practical guide to stateful fuzzing in smart contract testing. This lesson introduces the concept of stateful fuzzing and demonstrates how to create a stateful fuzzer using Python's hypothesis library. The video covers creating a class to manage state, defining actions and invariants, and executing the fuzzer to uncover bugs. Duration: 15min
21. Workshop
A challenging workshop on stateful fuzzing for ERC20 tokens. The lesson covers writing tests for a simple ERC20 token to achieve 80% coverage and then building a stateful fuzzer to identify bugs in the code. Duration: 3min
22. Rng
A helpful guide to random numbers in blockchain - This lesson covers the deterministic nature of blockchains and why true random numbers are difficult to implement. It also discusses using Chainlink VRF as a solution for programmatically provable randomness. Duration: 2min
23. Cei
A practical guide to understanding the CEI pattern for secure smart contracts. This lesson covers checks, effects, interactions, and reentrancy attacks to build secure and reliable smart contracts. Duration: 2min
24. Mox Console
A helpful overview of the Mocassin Console - This video teaches you how to use the Mocassin Console and how to interact with your blockchain projects directly from your terminal. Mocassin is a Titano-based Vyper smart contract development framework and the console feature is still in beta. Duration: 1min
25. Recap
A comprehensive recap of the Mocassin ERC20 section - This video lesson summarizes the key concepts covered in the Mocassin ERC20 section, including stateful and stateless fuzz testing, testing events, creating a token, and using tools like Snekmate, Mamushi, Ruff, Vheader, and Justfile to improve your workflow. Duration: 3min

Course Overview

About the course

What you'll learn

Python basics

Introduction to Web3.py

Introduction to Titanoboa

Introduction to Moccasin

How to create an ERC-20

How to test Python code and Vyper smart contract

How to deploy Vyper smart contracts on ZKsync using Moccasin

Course Description

Who is this course for?

  • Software engineers
  • Web3 developers
  • Finance developers
  • AI developers
  • Everyone interested in learning Python and smart contracts

Potential Careers

Smart Contract Auditor

$100,000 - $200,000 (avg. salary)

On-chain Data Analyst

$59,000 - $139,000 (avg. salary)

DeFi Developer

$75,000 - $200,000 (avg. salary)

Smart Contract Engineer

$100,000 - $150,000 (avg. salary)

Web3 developer

$60,000 - $150,000 (avg. salary)

Web3 Developer Relations

$85,000 - $125,000 (avg. salary)

Meet your instructors

Patrick Collins

Patrick Collins

Founder at Cyfrin

Web3 engineer, educator, and Cyfrin co-founder. Patrick's smart contract development and security courses have helped hundreds of thousands of engineers kickstarting their careers into web3.

Last updated on April 21, 2025

Testimonials

Students Reviews

Read what our students have to say about this course.

Chainlink

Chainlink

Chainlink

Gustavo Gonzalez

Gustavo Gonzalez

Solutions Engineer at OpenZeppelin

Francesco Andreoli

Francesco Andreoli

Lead Devrel at Metamask

Albert Hu

Albert Hu

DeForm Founding Engineer

Radek

Radek

Senior Developer Advocate at Ceramic

Boidushya

Boidushya

WalletConnect

Idris

Idris

Developer Relations Engineer at Axelar