Advanced Solidity: Understanding and Optimizing Gas Costs

Mastering the Ethereum Virtual Machine and the Solidity Compiler

Ever been surprised by the gas costs in a smart contract? The Ethereum Virtual Machine calculates these costs deterministically, but understanding how is a bit obscure unless you want to comb through the dense yellowpaper! This course helps you understand where every last bit of gas is coming from and the gotchas that can make transactions surprisingly expensive.

What you’ll learn

  • Learn how the Ethereum Virtual Machine sets the gas price.
  • Learn how to improve the gas price of existing code.
  • Learn how to debug execution costs for smart contracts.
  • Learn what designs to avoid that lead to high execution costs.

Course Content

  • Part 1: Overview of Gas Cost –> 24 lectures • 1hr 29min.
  • Part 2: Storage –> 12 lectures • 49min.
  • Part 3: Memory Costs –> 3 lectures • 11min.
  • Solidity Tricks –> 6 lectures • 19min.

Advanced Solidity: Understanding and Optimizing Gas Costs

Requirements

Ever been surprised by the gas costs in a smart contract? The Ethereum Virtual Machine calculates these costs deterministically, but understanding how is a bit obscure unless you want to comb through the dense yellowpaper! This course helps you understand where every last bit of gas is coming from and the gotchas that can make transactions surprisingly expensive.

This course is for solidity developers looking to progress from beginner to advanced intermediate. Knowledge about Solidity, OpenZeppelin, and Remix is assumed. You should know how to deploy and test a smart contract, and ideally, you’ve created a token on the mainnet before (and experienced how expensive it can be!).

I’m the author of ERC1155D, arguably the most efficient NFT contract created. I’m here to share my learnings with you!

Some of the most enjoyable years of my life was teaching computer science at Columbia University, so I’m happy to relive those years virtually!

 

Topics covered include:

  • A deep dive into the solidity compiler
  • A deep dive into the Ethereum Virtual Machine
  • How to understand the output from the solidity compiler
  • How to track down wasteful computation
  • Understanding gas cost specifications
  • Techniques for improving gas costs
  • How memory, transaction data, state changes, and computational cost affect transaction cost
  • Bad designs to avoid
  • Where the Yellowpaper is wrong!

Follow me on Twitter: @jeyffre

Get Tutorial