Last updated
Last updated
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.
To store the result, we can design a simple data model
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:
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.
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.
Learn more about User Defined Functions: