I'm currently working with go-ethereum,
And unable to use etherscan for this case,
No ABI for me here.
How to check whether if the transaction interacts with/calls a smart contract or deploying the smart contract itself?
And if it deploys the smart contract how can I know the smart contract address deployed?
Best Answer
Well what you can do is in the geth console you can use the
web3.eth.getTransactionReceipt(<TX_HASH>)
method to get the transaction receipt. Let's take Chainlink contract creation transaction for example:As you can see the
to
value is null and thecontractAddress
value is the value of Chainlink contract. So whenever we have emptyto
value andcontractAddress
is not empty then we're speaking of contract creation.Contract method requests can be caught with the transaction hash by using method
web3.eth.getTransaction(<TX_HASH>)
. In the response of this method if theto
value is the contract address anddata
value is not empty ( it has to be valid encoded ABI of the particular method ) then we're definitely speaking for contract method request.