1/5
## Compiling We're going to look at the compilation process for a smart contract written using Vyper. Even with just this small contract, we have no code. All we have is a version and a license. Let's go ahead and compile this contract. We'll go to the Vyper compiler and click the Compile button. Clicking the "Compile favorites.vy" button gives us a compilation details box. We'll click the "Compilation Details" button and see bytecode, runtime bytecode, and ABI. The bytecode and runtime bytecode are sent to the blockchain because the blockchain only understands raw bytecode. The blockchain only understands zeros and ones and doesn't understand what "pragma version" means. So when we compile our code we're essentially transforming our human-readable code into machine readable code. If our compilation fails, it means we have a mistake in our code somewhere. Let's go back to our "favorites.vy" file and try adding a line with gibberish code: ```python asdfhasjh a:dhfpuiowht92y92 ``` Trying to compile this gives us an error: ```bash favorites.vy SyntaxException:Semi-colon statements not allowed line 4:11 ``` We'll remove the line and compile again. This time the compiler will successfully compile our code, which is indicated by a green checkmark. While we're not actually deploying a contract here, this is still important to help us understand the compilation process. As you get used to coding, you'll get used to hitting Cmd+S or Ctrl+S.
A basic introduction to compiling Vyper smart contracts. The lesson covers the fundamentals of compiling, including version specifications and license identifiers, and provides a real-time demonstration of how errors are handled.
Previous lesson
Previous
Next lesson
Next
Give us feedback
Course Overview
About the course
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.
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)
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 March 21, 2025
Duration: 2h 08min
Duration: 2h 32min
Duration: 24min
Course Overview
About the course
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.
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)
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 March 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