July 28, 2026

Capitalizations Index – B ∞/21M

Gas tracking for Solidity contracts – Markus Waas –

Gas tracking for Solidity contracts – Markus Waas –

I’d like to present to you a small tool that I wrote today. It is quite interesting to keep track of functions gas costs in Solidity over time.

Why tracking?

As a project grows over time, there can be quite a bit of changes in the gas costs for any functions. Often these changes come without notice, e.g., you add changes to a helper functions that are used in many other functions as well. As you do this, you change the gas costs of all these functions as well.

As you may not notice this immediately, you may wonder a few months later why all of a sudden this one function costs double the amount of what it cost initially.

Lastly, it’s also fun to look at the gas costs development over time.

Tracking gas costs over time

One way to help you identify these situations, but also help you identify the specific point in time when the gas costs changed, is to store the gas costs after important changes in a file. You can use the gastracker package to help you with this.

Tips

The most convenient way of using this is to setup continuous integration and store the gas results after each run. But you can also run them locally and store results only when you want to.

Notes

This is a very early stage of the package. There is (almost) no error handling, so use it correctly. There are also many possible features still missing. If there is anything in particular that you want, or an annoying bug, please create an issue for it. Or even better, create the PR fixing the bug/adding the feature.

Published at Sun, 26 May 2019 03:19:33 +0000

Previous Article

Kraken affirms that it pays some of its employees in Bitcoin [BTC]

Next Article

Bitcoin Core 0.18.0 Released

You might be interested in …

How bitcoin miners earn through new coins and fees

How Bitcoin Miners Earn Through New Coins and Fees

The⁣ Role of Mining in the bitcoin Network and Blockchain Security mining is ⁢the cornerstone that ensures the integrity and continuous operation of​ the bitcoin network. ⁣Miners dedicate⁣ massive computational power to solve complex cryptographic […]