CS4998: Blockchain Development Textbook
  • CS4998: Blockchain Development
  • Prerequisites
  • Introduction
    • Blockchain Theory
      • Bitcoin and the UTXO Model
      • Ethereum and the State-Based Model
    • Remix - A First Glance
    • Hello World!
      • Solidity File Structure
      • Primitive Values & Types
      • Contract Structure
      • Functions
      • Data Structures
      • Summary & Exercises
    • Hello World! Pt. 2
      • Control Flow
      • Interfaces and Inheritance
      • Constructors
      • Contract Interactions
      • Modifiers
      • Dynamic Arrays and Strings
        • Dynamic Arrays
        • Strings
      • Errors
      • Events
      • Units and Global Variables
      • Default Functions
  • Local Development
    • Node Providers
    • Interacting With On-Chain Contracts
    • Migrating to Foundry & VS Code
      • The Basics of Forge
      • Installing and Using Dependencies
      • Cast
      • Anvil
  • Understanding the EVM
    • The Ethereum Virtual Machine
      • A First Look at Computers
      • The Turing Machine
      • EVM Data Structures
      • Operation Codes (Opcodes)
      • Gas
      • Contract Compilation
      • Contract Runtime
    • Gas Optimizations
  • Yul & Advanced EVM Topics
    • Yul
    • Metamorphism
    • Bitwise Manipulations
  • Correctness
    • Security
    • Types of Testing
  • ERC Standards
    • Why ERCs?
    • ERC20
    • ERC721
    • ERC777
    • ERC1155
  • Frequently Used Smart Contracts
    • OpenZeppelin
    • Uniswap
    • Multisignature Contracts
    • AAVE/Compound
  • MEV & Advanced Blockchain Theory
    • Consensus Mechanisms vs Sybil Resistance Mechanisms
    • Maximal Extractable Value (MEV)
    • Looking Past The EVM
  • Etcetera
    • Developer Practices
    • Spring 2023 Past Resources
Powered by GitBook
On this page
  1. Yul & Advanced EVM Topics

Yul

Solidity's Sophisticated Brother

The entire content of this textbook can be summarized by the following word: Solidity.

Okay, maybe that's not the case. After all, we spent an entire chapter learning about the mechanics of the EVM. Learning about the EVM helped us understand how our code is actually compiled/run and gave us the foundation to write code that is both more secure and more efficient. However, one can argue that this still catered towards the overarching theme that is Solidity.

In this chapter, we will diverge from learning strictly about Solidity and begin exploring Yul, a "middle-level" programming language that allows us to write code that is "closer" to the EVM when compared to Solidity. Yul is written within Solidity and offers reductions in gas usage when written correctly. However, as it will become apparent in the later parts of this chapter, Yul opens the door for advanced smart contract functionality and phenomena that will make you question your understanding of EVM-compatible blockchains (in a good way, of course).

PreviousGas OptimizationsNextMetamorphism

Last updated 1 year ago