Withdraw Eth

A practical guide to sending ETH from a smart contract using the send function. The lesson covers the basics of using the send function, checking balances, and how to access the amount of ETH in a smart contract.

1. Introduction
A comprehensive guide to creating a Buy Me a Coffee-style smart contract using Remix IDE and Vyper. The lesson covers the core concepts of building a simple fundraising contract, including setting up a price feed, accepting donations, and withdrawing funds. Duration: 4min
2. Setup
A basic guide to creating a Vyper smart contract - This lesson will guide you through creating a basic Vyper smart contract that will be used to receive and withdraw funds. Duration: 4min
3. Doc Strings
A beginner's guide to using docstrings in Vyper. The lesson covers the basics of writing docstrings for Vyper functions, explaining how triple quotes work, and how to use them to document your code. Duration: 1min
4. Sending Eth
A practical guide to sending ETH to a Vyper smart contract - The lesson explains how to use the @payable decorator in Vyper to enable a smart contract to receive ETH and use the msg.value environment variable to access the amount of ETH sent in a transaction. Duration: 2min
5. Gwei Wei Eth
A practical guide to Wei, Gwei, and ETH in Vyper contracts. This lesson explores how to use Vipper's built-in function as_wei_value() to convert between wei and ether for a more readable contract. Duration: 4min
6. Send Tx
A practical guide to sending a transaction in Remix with ETH - This lesson demonstrates how to use Remix to send ETH to a smart contract. It covers the process of compiling and deploying the contract, identifying payable functions, and using the value field to send ETH. Duration: 2min
7. Reverts
A comprehensive guide to understanding reverts in Vyper smart contracts. The lesson explains how reverts undo any actions that have been done, send the remaining gas back, and how they're triggered by assert statements, ensuring a certain amount of money is sent. Duration: 5min
8. Chainlink
A detailed introduction to oracles and Chainlink. This lesson covers the oracle problem in smart contracts and how Chainlink solves it, explores Chainlink's features, and dives into a practical demonstration of using Chainlink price feeds in Remix IDE. Duration: 13min
9. Mid Recap
A quick recap of important Vyper smart contract concepts. This lesson covers the basics of payable functions, assert functionality, and how to revert transactions in Vyper. Duration: 1min
10. Chainlink In Vyper
A comprehensive guide to using Chainlink Price Feeds in Vyper smart contracts. The lesson covers how to read price data from a Chainlink Price Feed contract, how to set up the development environment, and how to use the Chainlink documentation for further assistance. Duration: 4min
11. Abi
A comprehensive guide to understanding and using the Application Binary Interface (ABI) in Vyper smart contracts - This lesson explains what ABI is, why it's important, and how to access and use it. Duration: 1min
12. In-Line Interface
A comprehensive guide to in-line interfaces in Vyper. The lesson covers the basics of creating an in-line interface, how to use it to interact with other contracts, and how to retrieve data from an external price feed. Duration: 5min
13. Staticcall
A practical Vyper tutorial on calling external contracts using staticcall and extcall. This lesson delves into the distinction between staticcall and extcall for accessing functions in external contracts, highlighting the importance of security considerations and the use of view functions. Duration: 2min
14. Tenderly
A practical guide to deploying a Vyper smart contract to Tenderly Virtual Network. This lesson shows you how to set up a Tenderly testnet, connect your Metamask wallet, deploy a smart contract from Remix IDE, and how to interact with the deployed contract. Duration: 3min
15. Ai
A comprehensive guide to understanding staticcall in Vyper smart contracts. Learn how staticcall works, why it's beneficial for gas efficiency and security, and when you should use staticcall in different scenarios. Duration: 4min
16. Deploy Parameter
A practical guide to deployment parameterization in Vyper using Remix IDE. The lesson covers how to create a state variable to store a price feed address and pass it as a parameter during deployment, allowing for flexible and dynamic pricing in smart contracts. Duration: 3min
17. Integer Precision
A technical guide to integer precision in Vyper smart contracts. The lesson covers how to convert ETH amounts to USD, addressing decimal places in calculations. Duration: 2min
18. Converting Types
A practical guide to converting types in Vyper. The lesson covers how to use the 'convert' function to transform a value or literal from one data type to another, ensuring compatibility with the smart contract's expected types. Duration: 1min
19. Integer Division
A comprehensive guide to integer division in Vyper. This lesson covers the fundamentals of integer division and its implications for precision in smart contracts. Duration: 8min
20. As Wei Value
A simple guide to using `as_wei_value()` in Vyper - This lesson shows you how to use the `as_wei_value()` function to represent a dollar amount in Wei to set a minimum dollar amount to send to a contract. Duration: 2min
21. Send Eth In Tx
A practical guide to sending a transaction with ETH. The lesson demonstrates how to compile and deploy a smart contract on Remix IDE and send ETH to the contract using the injected provider and MetaMask. Duration: 2min
22. Contract To Contract
A practical Vyper tutorial on making a function call another function. The lesson covers how to create an external function that runs an internal function and passes in arguments. It also discusses the importance of using underscores in function names. Duration: 1min
23. Getting Revert
A practical guide to implementing reverts in Vyper smart contracts - This lesson demonstrates how to use the assert function to trigger a revert in Vyper code when certain conditions are not met. It then shows the different outputs in the Remix IDE when a transaction reverts and how to understand the reason for the revert. Duration: 3min
24. Msg Sender
A practical guide to implementing access controls in your Vyper smart contracts. The lesson covers setting an owner during deployment, using the msg.sender built-in, and writing an assert statement to restrict withdrawal function access. Duration: 5min
25. Withdraw Eth
A practical guide to sending ETH from a smart contract using the send function. The lesson covers the basics of using the send function, checking balances, and how to access the amount of ETH in a smart contract. Duration: 4min
26. Dynamic Vs Fixed Array
A practical comparison of dynamic arrays and fixed-sized arrays in Vyper. The lesson covers the difference between these array types, their initialization, and how to access them. Duration: 9min
27. Resetting Array
A simple guide to resetting a dynamic array in Vyper. This lesson covers how to identify an empty array, reset a dynamic array to an empty state, and use the append function in Vyper. Duration: 2min
28. Plus Equals
A practical guide to using mappings in Vyper - This lesson demonstrates how to use mappings to keep track of the amount funded by a particular address in a Vyper smart contract. The video covers the fundamentals of setting up a mapping, adding values to the mapping, and using the plus equals operator for efficient value updates. Duration: 2min
29. For Loops
A comprehensive introduction to for loops in Vyper for smart contract development. The lesson covers the basics of using for loops, including iterating through a range of numbers, skipping iterations with continue, and breaking out of a loop early with break. Duration: 8min
30. Tenderly_
A comprehensive guide to testing Vyper smart contracts on Tenderly. The lesson covers setting up a virtual testnet, deploying and interacting with your contracts, and verifying the functionality of your contract. Duration: 7min
31. Idk
A detailed guide to utilizing Immutables and Constants in Vyper smart contracts. This lesson dives into the concepts behind immutables and constants, explaining their differences and showcasing how to leverage them for improved code readability and gas efficiency. Duration: 4min
32. Natspec
A comprehensive guide to using NatSpec metadata in your Vyper smart contracts - Learn about the various NatSpec tags and how to implement them to write high-quality documentation. Duration: 3min
33. Update Immute
A comprehensive guide to immutables and constants in Vyper smart contracts. The lesson explains the difference between constants and immutables, how to declare them, and the best practices for choosing the right type of variable for your use case. Duration: 6min
34. Magic
A practical guide to refactoring magic numbers in Vyper code. This lesson introduces the concept of magic numbers, explains their drawbacks, and demonstrates how to replace them with variables and constants to improve code readability and maintainability. Duration: 1min
35. Gas
A comprehensive guide to comparing gas costs in Vyper with constants, immutables, and storage variables. The lesson covers the process of deploying a contract with and without constants, calling a function with different values, and analyzing the transaction costs to illustrate the savings possible. Duration: 5min
36. Fallback
A comprehensive guide to the `_default_` function in Vyper. The lesson covers the purpose and functionality of the `_default_` function, how it interacts with other functions in a contract, and its role in handling transactions. Duration: 7min
37. Better Way To Send
A comprehensive guide to sending Ether in Vyper. This lesson covers the use of the send keyword and its potential security risks, as well as the more advanced, secure method of sending ETH using the raw_call built-in function. Duration: 3min
38. Recap
A comprehensive overview of Vyper fundamentals - This lesson covers concepts such as interfaces, constants and immutables, arrays, mappings, constructors, decorators, and sending money from within a contract. Duration: 9min

Course Overview

About the course

What you'll learn

The basics of blockchain transactions, how to send and receive money on a blockchain network.

How to write Python based smart contracts using Vyper.

How to read and understand Vyper smart contracts.

Vyper data structures, arrays, structs, hash maps.

How to build a smart contract application and deploy on ZKsync with Moccasin.

Course Description

Who is this course for?

  • Software engineers
  • Web3 developers
  • Fintech 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.

Tasuku Nakamura

Tasuku Nakamura

Founder at smartcontract.engineer

Smart contract engineer and educator.

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