Supported Ethereum Decoded Data
TrustVault currently indexes all of Ethereum transactions and this allows us to pass some of that indexed data on in Webhook calls.
This is particularly useful in DeFi transactions as the index can provide more information on exactly what method was called and what the parameter values were. Additionally, we can show the result of the transaction (e.g. which ERC-20 tokens were transferred) if the transaction contract call has included the events.
If you need some background reading, you could start with a primer on understanding transactions, followed by a bit more detail on a transaction and finally you can ready the details of decoding an ethereum transaction.
Armed with this information on a transaction you can see that the chain provides a reasonable set of information about the transaction such as the method arguments and data types. However, what is missing is the method names and the argument names. This information has to be added manually and this is what a TrustVault Webhook will do for you.
This is really useful for:
- Understanding what you’ve actually called in a contact
- Understanding the values that were passed to arguments
- Confirming that what you expected was called
- Adding additional rules to your workflow
NB: This information is used in our DeFi firewall product which will analyse data from a transaction to decide if the transaction should be signed or not.
Additionally, TrustVault will pass the Log data from the transaction to confirm the output of the transaction.
This article about Logs and Events is also well worth a read to help you understand if you need it.
An example of the payload with decoded Ethereum data can be found on our webhooks page. The “Sample ERC20 Received Event Object” is particularly useful, but here’s a snippet.
1 | ...other fields excluded |
This shows that for this transaction, the method transfer(address to, uint256 amount)
was called passing in the value 0x671e96593ea93bfcb510375f4cec111d0e5cf1b8
to the address
field and the value 0xcaf67003701680000
to the amount
field. This is in hex so the decimal value is 234000000000000000000
. (Given this contract has 18 decimal places this is 234
tokens)
The table below lists the method signatures that have been specifically indexed (most are from well know DeFi protocols such as KyberSwap) and, if your transaction calls any of these methods, that detail will be provided in the webhook.
Supported Ethereum Decoded Method Signature
Supported Ethereum decoded method signatures for ChainRawEthereumTransaction.decodedInput
field in the transactions query.
Any unsupported method signatures will have a value of null
.
1 | addLiquidity(address tokenA,address tokenB,uint amountADesired,uint amountBDesired,uint amountAMin,uint amountBMin,address to,uint deadline) |
Supported Ethereum Decoded Event Logs
Supported Ethereum decoded event logs for ChainRawEthereumTransaction.decodedEvents
field in the transactions query.
Any unsupported event logs will not be included in the ChainRawEthereumTransaction.decodedEvents
array.
1 | Approval(address indexed owner, address indexed spender, uint256 value) |