For Smart Contract Developers
Smart contract developers often need to analyze their data. Assuming you are a developer from EigenLayer, and your community is requesting a comprehensive dashboard on how each wallet addresses stake with EigenLayer, here are the steps you can follow to accomplish this using the Hemera Protocol.
Create your data model
To store the result, we can design a simple data model
Understand your smart contract data
You must include all the transactions/logs/traces, which may change your output data. For your use case, you need to identify all the staking balance changes.
If you understand your contract well, you should figure out that this transaction will trigger a user-staking balance change.
Method: depositIntoStrategy: https://etherscan.io/tx/0x7269c2cf90779d82b3b53f6c997cabd25243cb60f6f136e8ce5a1e6d510d478e
Design trigger event
To summarize, whenever you see a transaction that interacts with this specific address (EigenLayer: Strategy Manager) and calls this specific function (depositIntoStrategy) from your smart contract, you should update the user staking balance.
You can define this customized trigger within the indexer using this code.
The trigger can be a method in transactions, topics from logs, or even an action from the trace.
Write customize code
Now we can add our code and update our data model when an event is triggered. The event will pass transaction data/logs/traces to you.
You can write your customized code and update the data model you design.
Last updated