Solidity 17 – Gas Saving Tweaks
Last Updated on 25. March 2025 by Mario Oettler
Gas is the unit of transaction fees paid in Ethereum. If you are unsure about the gas system, please refer to lesson.
For us, it is important to know that every operation performed by the EVM [LINK] costs gas. When creating a transaction, the user sends some gas along with the transaction to pay for the operations. Gas costs ETH and therefore it can become very expensive to interact with or deploy a smart contract. In this lesson we will look at different ways to save gas.
It is important to be aware of the trade-off between readability and complexity of the source code. Some gas-saving techniques make the code harder to read and maintain. So, think twice about whether it is worth saving 5000 gas during deployment, but spending much more in salary to write and maintain that code.
A great resource for gas saving techniques in Ethereum is this: https://www.rareskills.io/post/gas-optimization