Recover the address created by an OP contract-creation deposit
A typed OP deposit has no ordinary transaction nonce field. Assuming zero when deriving a contract-creation address breaks once the L2 sender already has a nonce history.
Read the receipt under the applicable fork
Confirm the deposit is a creation by checking the absent destination, then inspect its L2 receipt. From Regolith the depositNonce records the sender nonce relevant to this deposit. Use the actual L2 sender, including any applicable deposit alias.
Regolith-or-later deposit receipt
to: null
depositNonce: 5
In the example, derive the CREATE address from the RLP list of sender and integer 5, hash it with Keccak-256 and take the last twenty bytes. Compare the result to the receipt’s contractAddress. The unique sourceHash is unrelated to this CREATE calculation.
Check whether deployment succeeded
A derived destination identifies the attempted creation. Inspect receipt status and code at the resulting address at the relevant block before reporting a live contract. Older pre-Regolith receipts lack this added nonce field and require historical execution context. specs.optimism.io OP Stack specification