1

How can one tell if a contract creation took place during a particular transaction? In other words, what is the pattern that I should be looking for? In some cases I have seen the null address being the sender of the very first transaction of a contract.

For the record, my goal is to monitor new contract creations by going through the metadata of all transactions in every new block that my node receives. Thanks!

1 Answer 1

3

contract creation transaction will have "to" as 0 address, meaning that there is not recipient for this transaction. Another way to tell if a transaction is a contract creation is to check that first 4 bytes of data is 0x60806040

5
  • I believe the null address is in the from field (not to), however from a quick look the 0x60806040 pattern looks valid so I am accepting this as the answer, thanks!
    – pcko1
    Mar 29, 2022 at 13:13
  • nope, there is always a 'from' field which is the sender.
    – Jiaming Li
    Mar 29, 2022 at 15:03
  • hm how about this deployment bscscan.com/tx/… ? tokens are transferred from the null address to the contract deployer, thus the null address is the sender.
    – pcko1
    Mar 29, 2022 at 16:12
  • That is token minted from null address to sender. The sender of that transaction is 0xdefc2f511c8f680814d009cd687e45a95bbef74b
    – Jiaming Li
    Mar 30, 2022 at 3:02
  • I think there is no best practice for that, on snowtrace I see that 0x600880 signature on contract create. snowtrace.io/tx/… Mar 8, 2023 at 15:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.