Getting transaction action

Hi everyone,

it would be awesome to be able to get what etherscan offers on “transaction action”. Its decomposing what is done in a smart contract and supports a lot of different types, from uniswap transactions to mints.

Here you can see an example:

and i dont see another way to get those…even etherscan doesnt provide it in their api :frowning:

Or do you know another way to get if a transaction was a mint and how many tokens have been part of it.

In particular it looks like it processed the events for that transaction

0 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef
1 0x0000000000000000000000000000000000000000000000000000000000000000
2 0x0000000000000000000000006d0b3f2f99e24bd4af14caba3a94fcfcbaef29dc
3 0x000000000000000000000000000000000000000000000000000000000000000f

=> mint(0, 6d0b3f2f99e24bd4af14caba3a94fcfcbaef29dc, 15)

1 Like

Jeah, but i am looking for a reliable way to figure that out and this hash can be different depending on the smart contract.
I am fetching hundreds of different smart contracts and can’t write specific functions for every one of them.

that hash (topic 0) should be the same on all transfers done with a function that has same name and parameter types, all the other hashes you can ignore, as a contract can emit multiple events

jeah, but if you name your function not “mint” but “buythattoken”, the hash will be different and this approach wont work, right?

yes, that approach won’t work in that case, but in some cases the smart contracts follow some standards and they use same event method name, if you don’t know what event name the smart contract has used, and if you don’t have access to the source code, then you have not idea what event was there

ok, that means Moralis will not be able to support that request right? I mean also in the future?

In particular for ERC-721 Transfers it may be possible to process those specific mint events that are present in standard, but on general is not possible to process any random event.

1 Like

ok thanks anyway, we will look for another way to get the data we need :slight_smile:

To my knowledge it is not possible to reverse the hashing function used here to get the method name. (correct me if I am wrong - that would be nice)
If you need the name of the method I guess your best shot is:

edit: whooopsi 3 months late :see_no_evil: came from search though :smiley:


Did you find a way to reslove this ?