1

I am trying to see smart contract creations from opcodes in transaction traces with debug_traceTransaction. But traces of transactions that created contracts do not seem to include the CREATE opcode.

Example:

CryptoKitties’ core contract is: 0x06012c8cf97BEaD5deAe237070F9587f8E7A266d

It was created with this transaction: 0x691f348ef11e9ef95d540a2da2c5f38e36072619aa44db0827e1b8a276f120f4

I would expect to see the creation of the contract in the transaction trace indicated by the CREATE or CREATE2 opcode according to the Yellow Paper pp. 37f (https://ethereum.github.io/yellowpaper/paper.pdf). The Python code I am using is:

from web3 import Web3
tx= "0x691f348ef11e9ef95d540a2da2c5f38e36072619aa44db0827e1b8a276f120f4"
web3 = Web3.HTTPProvider("endpoint")
trace = web3.make_request('debug_traceTransaction', [tx])

The output trace is fairly long but does not include CREATE or CREATE2.

Am I using the wrong transaction or the wrong debug trace? How do I find the trace with the CREATE or CREATE2 opcode (e.g., for CryptoKitties' core contract)?

2 Answers 2

1

Why do I not see CREATE or CREATE2 opcodes in traces of contract creating transactions?

because this contract is NOT created using CREATE or CREATE2 opcode, it is created by sending nil in the 'To' field of the transaction. To see an example of CREATE2 opcode check out UniswapV3PoolDeployer contract, it uses CREATE2 opcode.

0

The contract in the question was created by an EOA as @Nulik's answer describes.

CREATE and CREATE2 opcodes are how a contract can create another contract.

An EOA creates a contract by sending a transaction 'To' an empty address, but with "Input Data" being the "initialisation EVM code" of the contract being created.

In the Yellow Paper (currently Berlin Version) this is described in section 7. CONTRACT CREATION. In Etherscan, you can see the "Input Data" of the transaction by "Click to see More".

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.