The technology is too new to be trusted with day-to-day business tasks.
Smart contracts themselves work like Swiss watches, but every transaction costs the smart contract owner money, the Ethereum blockchain fee. The fee depends on the features and parameters of a transaction.
As of now there is not a free tool that allows you to get data about transactions conducted with a smart contract in a straightforward way.
You have to collect all transaction data manually, and that is not even the worst part; you also have to decode it yourself.
We in Exyte decided to solve this problem.
(Disclaimer: The author is a full stack developer at Exyte)
And this is how Gaster appeared.
In this article we explain how Gaster works and how the blockchain community can benefit from this tool absolutely for free.
Gaster gives you info about how a smart contract has been used. It gives you raw data about transactions. For example, what methods were called, what their parameters were, and how much that transaction cost the smart contract owner.
The smart contract owner analyses these data to learn: what smart contract methods are used more often what smart contract methods cost the most which users load the smart contract the most
Gaster gathers all the necessary data, aggregates it in one place, and gives you many options for tuning your smart contract parameters.
Well, someone actually might have a similar tool. There may even be several of them, but they are mostly for private use. There are not many public (open) smart contracts, and there are not many public (free/open) tools for smart contract analytics that anyone can use.
The benefit of Gaster is that it is an Open-source tool. It is available to everyone. Anyone who has a smart contract or a dApp with a smart contract and wants to know how much money they are going to spend on using a smart contract should take advantage of Gaster.
It may be connected to the fact that there haven't been many dApps with smart contracts up until recently. DApp developers and smart contract owners just hadn't thought that they needed an analytics tool for their smart contracts.
The technology is still in its development stage. Usually, open-source tools appear when the technology is widespread. Smart contract technology starts trending about now with 75% growth in March. We felt that this was the time to start doing open-source projects for the community.
There was another thing we wanted to work on: the possibility of going back to a previous state of the network and setting up that state of the network locally. This possibility is necessary to test and analyze complex use cases of unexpected smart contract behavior.
Having a tool like that would help Exyte in some of our recent projects. So we decided to write a script that would do that, transferring your local blockchain to a previous state of a public blockchain.
While researching this topic, we found out that similar feature is scheduled for OpenEthereum (previously Parity Ethereum) in one of the upcoming milestones.
There weren't any other issues that needed to be addressed, so we focused on operational cost analytics.
I cannot be certain here, because, again, there weren't any public tools that did that. Gaster is genuinely a crawler and decoder. It follows a certain logic to gather data about a smart contract through Etherscan API, taking into account the peculiarities of how a transaction was conducted.
After the data is gathered, Gaster decodes it into a human-readable format and saves the outcome into a CVS. The process is quite simple, and I think if anyone needed smart contract analytics, they would follow the same logic.
It all started with the development of smart contract for the Proof of Ownership mechanism for a real estate company. The purpose of a smart contract in that case was to confirm that a user can buy a piece of land. Among other data, smart contracts there transferred the name of that piece of land.
As long as the Ethereum blockchain is sensitive to the amount of data, the length of that name directly influenced the transaction fee. We were able to discover that fact after taking a look at the data Gaster collected about that network.
Gaster can collect raw transactions' data considering the specifics of its storage. With a single command, it collects, decodes, and saves all that data in CSV so you can use it for further analytics. Gaster collects the following data:
Of course, there are several nuances here. Blockchain transactions can have a hierarchical call structure, as if you use Zeppelin OS (proxy contract) or just call one contract inside of another one, so each smart contract has both regular transactions and related internal transactions.
All of the internal transactions have their type according to what it does: create, delegatecall, staticcall, and so on. These transactions should be crawled and merged correctly in order to see the full picture of how the contract works.
It is not the topic of this talk, but more information about internal transaction (message call) types can be found here, here, and here.
Gaster can make an automatic Python report that uses raw CSV data and makes general analytics to show how it can work. So you, as contract owner, can get useful information about the most-used functions, the most expensive functions, and how users use your contract, as well as make invoices for them and much more, presented in the form of plots and tables.
The Gaster-generated plots below provide the contract owner with useful information, such as:
The cost dynamics of contract methods over time
Based on this data, you can forecast the future cost and identify thresholds for changes in cost for a particular method.
The dynamics of cost distribution for contract methods over time
You can also use this graph to determine how often the smart contract is used.
The nature of changes in the average cost of smart contract methods over time
This data allows you to track the use of methods and compare it with the gas price data.
The gas price value set for the transaction relative to time
This graph help you find a better way to adjust the gas price for the methods in the future.
We hope you will find Gaster useful for your blockchain-based projects. If you like what we did, we’d really appreciate it if you star Gaster rep on GitHub. As for now, we are continuing our work on developing Gaster.
If you have any questions or suggestions, we’d be glad to hear from you! Drop us a message or hit us on Twitter, LinkedIn or Facebook.
(Disclaimer: The author is a full stack developer at Exyte)