0/5
## Introduction to Testing in Solidity In this lesson, we will cover some best practices for testing your Solidity code, in this case, we will focus on our `buy_me_a_coffee` contract. We've already learned a lot, now we will get hands-on with our testing methods. We'll begin by writing enough tests to get our code to 100% coverage. Here is how we'll do it: 1. Write enough tests to get your code to 100% code coverage for `buy_me_a_coffee.vy`. We'll be using our testing framework: ```bash mox test --coverage ``` We'll use this command to run our tests, which will output the coverage we have achieved. 2. Sign up for [Cyfrin Profiles](https://profiles.cyfrn.io/). This is very important for building your web3 career. Cyfrin Profiles provides a platform for you to showcase your skills, find opportunities, and build a network of fellow developers. 3. Push your code to GitHub By pushing your code to GitHub, you'll be able to share your progress with others, document your work, and track changes. 4. Add a new commit to your GitHub repo Adding a commit helps to keep your project organized and track the changes you make. We encourage you to spend at most 25 minutes on this workshop, without the aid of AI. If you're unable to solve it, take a break, and then work with AI or look to the discussions for help. Good luck!
A challenging workshop to finish the "Buy Me A Coffee" Vyper project - This workshop builds on the previous lessons, guiding you to write enough tests to achieve 100% code coverage, sign up for Cyfr.in Profiles, push your code to GitHub, and add a new commit to your GitHub repo.
Previous lesson
Previous
Next lesson
Next
Give us feedback
Course Overview
About the course
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
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)
Last updated on April 21, 2025
Duration: 2h 20min
Duration: 1h 51min
Duration: 58min
Duration: 2h 23min
Duration: 53min
Duration: 2h 24min
Duration: 28min
Duration: 1h 54min
Duration: 11min
Course Overview
About the course
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
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)
Last updated on April 21, 2025
Testimonials
Read what our students have to say about this course.
Chainlink
Chainlink
Gustavo Gonzalez
Solutions Engineer at OpenZeppelin
Francesco Andreoli
Lead Devrel at Metamask
Albert Hu
DeForm Founding Engineer
Radek
Senior Developer Advocate at Ceramic
Boidushya
WalletConnect
Idris
Developer Relations Engineer at Axelar