Welcome to the Vyper workshop! This workshop features two tracks to accommodate different skill levels and interests.
⚠️ IMPORTANT: All code in this workshop is for DEMO PURPOSES ONLY. The examples may not compile, may contain bugs, and are NOT production-ready. They are designed to illustrate concepts and should not be used in real applications without thorough review and testing.
- Python 3.10 or higher
- UV (Python package manager) - Install with:
curl -LsSf https://astral.sh/uv/install.sh | sh
- Anvil (local Ethereum node) - Part of Foundry toolkit
- Install UV if you haven't already:
curl -LsSf https://astral.sh/uv/install.sh | sh
- Install Moccasin (Vyper development framework):
uv tool install moccasin
- Install Foundry (for Anvil):
curl -L https://foundry.paradigm.xyz | bash
foundryup
Goal: Learn Vyper basics by deploying an ERC20 token using the battle-tested Snekmate library.
What you'll learn:
- Vyper contract structure and syntax
- Using Snekmate modules for production-ready contracts
- Deploying contracts with Moccasin
- Interacting with deployed contracts
Time: 45-60 minutes
Goal: Dive deep into Vyper's intermediate representation (Venom) and optimize gas usage at the IR level.
What you'll learn:
- Understanding Venom IR structure
- Identifying optimization opportunities
- Comparing manual optimizations with compiler optimizations
- Benchmarking gas improvements
Time: 90-120 minutes
Clone this repository:
git clone <repo-url>
cd vyper-workshop
Navigate to the basic track:
cd track1-basic
Follow the instructions in track1-basic/README.md
Navigate to the advanced track:
cd track2-advanced
Follow the instructions in track2-advanced/README.md
vyper-workshop/
├── README.md # This file
├── track1-basic/ # Basic track: Token deployment
│ ├── README.md
│ ├── moccasin.toml # Moccasin configuration for track 1
│ ├── src/
│ │ └── MyToken.vy
│ ├── script/
│ │ └── deploy_token.py
│ └── tests/
│ └── test_token.py
└── track2-advanced/ # Advanced track: Venom optimization
├── README.md
├── src/
│ ├── algebraic_demo.vy
│ ├── branch_demo.vy
│ ├── comparison_demo.vy
│ ├── sccp_demo.vy
│ ├── sccp_complex_demo.vy
│ ├── sccp_simultaneous_demo.vy
│ ├── storage_demo.vy
│ └── unoptimized/
│ ├── counter.vy
│ └── simple_example.vy
├── scripts/
│ └── show_optimizations.py
└── venom_examples/
├── sccp_complex.venom
└── sccp_simultaneous.venom
- UV not found: Make sure to restart your terminal after installing UV
- Moccasin commands not working: Try
uv tool install --force moccasin
- Import errors: Ensure you're running commands with
uv run
prefix
- Check the track-specific README files for detailed instructions
- Ask workshop facilitators for assistance
- Join the Vyper Discord for community support
- Star the Snekmate repo if you found it useful
- Contribute to Vyper ecosystem projects
- Share your learnings with the community
Happy coding! =