1/5
## Smart Contracts, EVM, and EVM-Compatible Chains We will start to look at how smart contracts are actually run. When we compile our smart contract, we are converting it into a format that the EVM can understand. The EVM, or Ethereum Virtual Machine, is a set of rules or standards that dictate how compiled smart contract code should look. Any blockchain that follows these rules is considered EVM-compatible. Examples of these include: - Ethereum - Arbitrum - Optimism - Polygon - ZKsync We should be mindful of the chain that we are deploying to. A common mistake is to deploy to a chain that does not support the smart contract language we are using. We will discuss this in more detail later. We will be using ZKsync in this lesson. Here is the code we will be working with: ```python # EVM: Ethereum Virtual Machine # Ethereum, Arbitrum, Optimism, Polygon, ZKsync # pragma version 0.4.0 # @license MIT struct Person: favorite_number: uint256 name: String[100] my_name: public(String[100]) my_favorite_number: public(uint256) = 7 list_of_numbers: public(uint256[5]) = [0, 0, 0, 0, 0] list_of_people: public(Person[5]) index: public(uint256) name_to_favorite_number: public(HashMap[String[100], uint256]) @deploy def __init__(): self.my_favorite_number = 7 self.index = 0 self.my_name = "Patrick!!" @external def store(new_number: uint256): self.my_favorite_number = new_number ``` This code works correctly with the ZKsync compiler, but as we progress through this lesson, we will start to see how certain keywords, for example ZKsync, do not work correctly.
A technical introduction to the EVM - The EVM, or Ethereum Virtual Machine, is a set of standards that define how compiled smart contract code should be written. The lesson discusses the different types of Ethereum Virtual Machine (EVM)-compatible chains and their differences.
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