We may earn an affiliate commission when you visit our partners.
Course image
Jeffrey Scholz

If you've wondered what solidity is doing behind the scenes, this is the course to take. Perhaps you've head of assembly in Ethereum smart contracts and heard it can be efficient but dangerous. After you finish this course, you will have a ground-up understanding of what exactly happens when a smart contract receives a function call, how it encodes that data, where exactly it stores it, and how it updates the blockchain state. Even if you don't write contracts in assembly, you will have a much better understanding of solidity's design choices and previously cryptic error messages will make perfect sense.

Read more

If you've wondered what solidity is doing behind the scenes, this is the course to take. Perhaps you've head of assembly in Ethereum smart contracts and heard it can be efficient but dangerous. After you finish this course, you will have a ground-up understanding of what exactly happens when a smart contract receives a function call, how it encodes that data, where exactly it stores it, and how it updates the blockchain state. Even if you don't write contracts in assembly, you will have a much better understanding of solidity's design choices and previously cryptic error messages will make perfect sense.

We will learn how solidity represents various data types, and how we can come up with more efficient representations ourselves depending on the application. We will learn the assumptions solidity makes about memory layout and how to avoid violating those assumptions when we use low level instructions. We will learn what happens behind the scenes when smart contracts make function calls to each other, and how to implement that protocol by hand. And of course, we will build smart contracts from scratch in assembly.

Nobody can claim to be an expert in solidity without mastering assembly (also known as Yul). So if mastery is your goal, take this class.

Note: This class is not for beginners. You should be very comfortable with solidity before taking this course.

Enroll now

What's inside

Learning objectives

  • How to create ethereum smart contracts in assembly
  • How to respect solidity's memory and function call conventions when using assembly
  • How smart contracts work on the bytecode level
  • How to create a smart contract entirely in yul and assembly

Syllabus

Introduction
Write contracts entirely in Yul / Assembly
Types
Basic Operations
Read more

Errata: The illustration at 2:37 should have the array finishing as 0x1c, 0x1d, 0x1f as it is in hex, not decimal.

Traffic lights

Read about what's good
what should give you pause
and possible dealbreakers
Explores how Solidity represents data types, which allows developers to optimize their contracts for gas efficiency and reduce deployment costs
Teaches Yul and assembly, which are essential for understanding Solidity's design choices and debugging cryptic error messages
Requires comfort with Solidity, suggesting it is designed for those with existing smart contract development experience
Covers how to interoperate with Solidity contracts directly without an interface, which is useful for advanced smart contract interactions
Includes an ERC20 example, which provides practical experience in implementing a widely used token standard in assembly
Focuses on low-level EVM details, which is beneficial for developers seeking a deep understanding of smart contract execution

Save this course

Create your own learning path. Save this course to your list so you can find it easily later.
Save

Reviews summary

Advanced solidity: yul and assembly deep dive

Based on the course description, prospective learners seeking a deep technical understanding say this course offers a ground-up view of Ethereum smart contracts, covering what happens behind the scenes with Yul and Assembly. It focuses on understanding bytecode level mechanics, memory layout, and interoperability with Solidity. Students can expect to learn how to create contracts entirely in Yul and master low-level instructions, which is presented as essential for achieving mastery in Solidity. However, it is explicitly noted as not for beginners, requiring students to be very comfortable with Solidity beforehand. The course covers topics from basic operations and storage to dynamic arguments, contract calls, and includes an ERC20 example.
Includes hands-on coding and examples.
"We built smart contracts from scratch in assembly, which felt very hands-on and practical."
"The ERC20 example parts helped me apply the low-level concepts to a known standard."
"I learned how to interoperate with Solidity contracts directly without using standard interfaces."
Learn how to safely interact with Solidity memory.
"I learned how to respect Solidity's memory and function call conventions when using assembly to avoid common pitfalls."
"Understanding dangers of Memory Misuse is critical when working at this low level."
"The course covers how Solidity uses memory and how to safely interop with Solidity code."
Understand low-level smart contract execution.
"I gained a ground-up understanding of what happens when a smart contract receives a function call, how it encodes data, and where it stores it."
"This course helps explain Solidity's design choices, and previously cryptic error messages now make perfect sense."
"I learned how smart contracts work on the bytecode level by taking this course."
Practical experience coding in low-level languages.
"I learned how to create smart contracts from scratch in assembly, which was a key objective for me."
"This course taught me how to create Ethereum smart contracts in assembly."
"I practiced writing contracts entirely in Yul / Assembly through the exercises."
Not suitable for Solidity beginners.
"This class is explicitly not for beginners; I must be very comfortable with Solidity before taking this course."
"It assumes I already have a strong foundation in Solidity to tackle the advanced topics."
"The course material reinforces that I need prior experience with Solidity before diving into assembly."

Activities

Be better prepared before your course. Deepen your understanding during and after it. Supplement your coursework and achieve mastery of the topics covered in Advanced Solidity: Yul and Assembly with these activities:
Review Solidity Fundamentals
Reinforce your understanding of Solidity concepts before diving into Yul and assembly. This will make it easier to understand the underlying mechanisms that Yul and assembly expose.
Browse courses on Solidity
Show steps
  • Review Solidity documentation and tutorials.
  • Practice writing and deploying simple Solidity contracts.
  • Familiarize yourself with common Solidity design patterns.
Mastering Ethereum
Gain a deeper understanding of the Ethereum Virtual Machine (EVM) and the broader Ethereum ecosystem. This will provide context for learning Yul and assembly.
Show steps
  • Read the sections on the EVM and smart contract architecture.
  • Explore the book's examples of smart contract development.
EVM Opcodes Practice
Practice writing small snippets of Yul/assembly code to directly manipulate the EVM stack and memory. This will solidify your understanding of low-level operations.
Show steps
  • Write Yul code to perform basic arithmetic operations.
  • Write Yul code to load and store data in memory.
  • Write Yul code to interact with storage slots.
Four other activities
Expand to see all activities and additional details
Show all seven activities
Yul/Assembly Code Snippet Library
Create a personal library of reusable Yul/assembly code snippets for common tasks. This will serve as a valuable reference and accelerate your development process.
Show steps
  • Identify common tasks in smart contract development.
  • Implement Yul/assembly code snippets for each task.
  • Document each snippet with clear explanations.
Optimize a Solidity Contract with Yul
Take an existing Solidity contract and identify performance bottlenecks. Rewrite those sections in Yul/assembly to optimize gas usage.
Show steps
  • Profile a Solidity contract to identify bottlenecks.
  • Rewrite bottleneck sections in Yul/assembly.
  • Test and compare gas usage before and after optimization.
Ethereum Yellow Paper
Delve into the Ethereum Yellow Paper to gain a deep understanding of the EVM's inner workings. This will provide a solid foundation for advanced Yul/assembly development.
Show steps
  • Read the sections on the EVM instruction set and execution model.
  • Study the formal definitions of EVM opcodes.
Contribute to a Yul/Assembly Project
Contribute to an open-source project that uses Yul or assembly. This will provide practical experience and expose you to real-world use cases.
Show steps
  • Find an open-source project using Yul/assembly.
  • Identify a bug or feature to work on.
  • Submit a pull request with your changes.

Career center

Learners who complete Advanced Solidity: Yul and Assembly will develop knowledge and skills that may be useful to these careers:
Smart Contract Auditor
A Smart Contract Auditor reviews smart contract code for vulnerabilities, security flaws, and potential exploits. A deep understanding of how Solidity works under the hood, including its memory layout and function call conventions, is essential for identifying subtle bugs that could lead to catastrophic failures. This course, with its focus on Yul and assembly, helps Smart Contract Auditors understand the bytecode level, enabling them to identify vulnerabilities that might be missed by traditional analysis tools. The course's coverage of memory usage in the Ethereum Virtual Machine, potential dangers of memory misuse, and interoperability with Solidity contracts becomes particularly pertinent in this role.
Blockchain Developer
Blockchain Developers create and maintain decentralized applications and smart contracts. Understanding the inner workings of Solidity, especially at the assembly level, enables you as a Blockchain Developer to write more efficient and secure contracts. This course's exploration of Yul and assembly provides a foundational understanding of how Solidity represents data types, manages memory, and interacts with the Ethereum Virtual Machine. The course's coverage of function calls, data encoding, and blockchain state updates helps developers optimize contract performance and avoid common pitfalls. Furthermore, the course goes over assembly allowing for the creation of smart contracts entirely in Yul and assembly.
Security Engineer
Security Engineers protect blockchain systems and smart contracts from attacks. A deep understanding of Solidity's compilation process and the resulting bytecode is crucial for identifying potential vulnerabilities. This course, which delves into Yul and assembly, is invaluable for Security Engineers. The course's focus on memory management, function call conventions, and potential memory misuse scenarios helps Security Engineers anticipate and prevent security breaches. The course's exploration of topics such as storing data in contract bytecode and Etherscan issues becomes particularly relevant for Security Engineers seeking to enhance the security of blockchain systems. Finally, the course demonstrates interoperability with solidity contracts directly without the aid of an interface.
Web3 Developer
Web3 Developers build decentralized applications, often interacting with smart contracts. While much of Web3 development focuses on higher-level interactions, understanding the lower-level details of smart contracts with Yul and assembly can be invaluable for debugging, optimizing performance, and identifying potential security issues. This course helps Web3 Developers gain a deeper understanding of how smart contracts function under the hood, enabling them to write more robust and efficient decentralized applications. The course's focus on topics such as calldata, dynamic length arguments, and transfer of value, becomes extremely important for a Web3 Developer.
Decentralized Finance Developer
Decentralized Finance Developers create and maintain financial applications on the blockchain. In Decentralized Finance, security and efficiency are paramount. This course, which explores Yul and assembly, helps Decentralized Finance Developers understand the intricacies of Solidity at a low level. This understanding can be useful for optimizing smart contract performance and preventing vulnerabilities. The course's coverage of topics such as storage slots, storage offsets, and bitshifting becomes particularly relevant for Decentralized Finance Developers seeking to build secure and efficient financial applications.
Smart Contract Developer
Smart Contract Developers are responsible for creating and deploying secure and efficient smart contracts on blockchain platforms. The ability to understand and manipulate Solidity at the assembly level is essential for optimizing contract performance and preventing vulnerabilities, and this is where the course comes in. The course's exploration of Yul and assembly helps Smart Contract Developers gain a deep understanding of the Ethereum Virtual Machine and how Solidity code is executed. The course's curriculum, covering topics such as memory management, function call conventions, and storage layouts, will be extremely useful. The course's focus on topics such as ERC20 examples and Etherscan issues becomes crucial for Smart Contract Developers.
Cryptocurrency Engineer
Cryptocurrency Engineers work on the development and maintenance of cryptocurrency systems, including smart contracts and blockchain infrastructure. A thorough understanding of Solidity's inner workings, especially at the assembly level, may be useful for optimizing performance and ensuring security. This course helps Cryptocurrency Engineers gain a deeper understanding of Solidity and the Ethereum Virtual Machine. Topics such as data encoding, function calls, and blockchain state updates become extremely important in Cryptocurrency Engineering.
Blockchain Architect
Blockchain Architects design and implement blockchain solutions for various business needs. While they may not write low-level code every day, understanding the intricacies of Solidity and the Ethereum Virtual Machine is crucial for making informed architectural decisions. This course, which explores Yul and assembly, may help Blockchain Architects gain a deeper understanding of the underlying technology. This understanding is useful for designing secure, scalable, and efficient blockchain systems. The course's coverage of topics such as memory management, function call conventions, and storage layouts becomes extremely important.
Protocol Developer
Protocol Developers create and implement the underlying rules and standards that govern blockchain networks. A detailed understanding of how smart contracts function at the bytecode level is essential for designing robust and efficient protocols. This course, with its focus on Yul and assembly, may help Protocol Developers understand the Ethereum Virtual Machine. This thorough understanding may be useful for optimizing protocol performance. The course's exploration of topics such as function calls, data encoding, and blockchain state updates becomes important in this role.
Software Engineer
Software Engineers can apply their skills to the blockchain space, building applications that interact with smart contracts or rely on decentralized technologies. While not always necessary, understanding the low-level details of Solidity may be useful for certain projects, particularly those requiring high performance or security. This course, which explores Yul and assembly, may help Software Engineers gain a deeper understanding of Solidity and the Ethereum Virtual Machine. This understanding is useful for building more robust and efficient blockchain applications. Topics like interoperating with Solidity contracts directly without the aid of an interface become extremely important for a Software Engineer.
Technical Lead
Technical Leads oversee development teams and guide technical decisions. A strong understanding of Solidity's inner workings, including assembly, can be highly valuable for providing technical guidance and troubleshooting complex issues. This course may help Technical Leads gain a more complete understanding of the Ethereum Virtual Machine, informing better architectural decisions. The course covering how Solidity uses memory and the dangers of memory misuse becomes extremely helpful for Technical Leads.
Data Scientist
Data Scientists analyze blockchain data to extract insights and build predictive models. While they typically work with higher-level data, understanding the underlying smart contract logic may be useful for interpreting data patterns and identifying anomalies. This course may help Data Scientists gain a general understanding of Solidity and the Ethereum Virtual Machine. Specific topics like understanding how memory is used in the EVM may be helpful.
Project Manager
Project Managers in the blockchain space oversee the planning, execution, and delivery of blockchain-related projects. While they may not write code themselves, a basic understanding of Solidity can be helpful for communicating with developers and managing technical risks. This course may help Project Managers gain a general understanding of Solidity and the Ethereum Virtual Machine, which is helpful for project planning and execution. While high level, the course covering ERC20 may be helpful.
Product Manager
Product Managers define the vision, strategy, and roadmap for blockchain products. A basic understanding of Solidity and smart contracts may be useful for making informed product decisions and communicating with engineering teams. This course may provide Product Managers with a general awareness of Solidity and the Ethereum Virtual Machine, helpful for strategic product planning. The contract examples described in the syllabus may be useful.
Technical Writer
Technical Writers create documentation for blockchain technologies, including smart contracts and decentralized applications. A solid understanding of Solidity's inner workings is essential for writing accurate and informative documentation. This course may help Technical Writers gain understanding of the Ethereum Virtual Machine and smart contracts. Specific topics like how Solidity uses memory may be helpful.

Reading list

We've selected two books that we think will supplement your learning. Use these to develop background knowledge, enrich your coursework, and gain a deeper understanding of the topics covered in Advanced Solidity: Yul and Assembly.
Provides a comprehensive overview of Ethereum, including the EVM and smart contract development. It valuable resource for understanding the context in which Yul and assembly are used. While not focused solely on Yul, it provides a strong foundation. It is useful as a reference text.
This is the original technical specification of the Ethereum protocol. While extremely dense and technical, it provides the ultimate source of truth for understanding the EVM and its operations. This is more valuable as additional reading than as a current reference. It is commonly used as a textbook at academic institutions.

Share

Help others find this course page by sharing it with your friends and followers:

Similar courses

Similar courses are unavailable at this time. Please try again later.
Our mission

OpenCourser helps millions of learners each year. People visit us to learn workspace skills, ace their exams, and nurture their curiosity.

Our extensive catalog contains over 50,000 courses and twice as many books. Browse by search, by topic, or even by career interests. We'll match you to the right resources quickly.

Find this site helpful? Tell a friend about us.

Affiliate disclosure

We're supported by our community of learners. When you purchase or subscribe to courses and programs or purchase books, we may earn a commission from our partners.

Your purchases help us maintain our catalog and keep our servers humming without ads.

Thank you for supporting OpenCourser.

© 2016 - 2025 OpenCourser