.creates property missing in TransactionResponse #4310
Replies: 4 comments 1 reply
-
Looking at the v5 code, I see that it computes the value if it is missing as the JSON-RPC API used to return it as some nodes returned it and some didn't. It is no longer included at all in the JSON-RPC API, which may be due to the creation only occurring in the event the To compute this manually, you can use: // Only transactions with no `to` can cause a CREATE.
const creates = (tx.to == null) ? ethers.getCreateAddress(tx): null; I'll update this issue when I have more info. |
Beta Was this translation helpful? Give feedback.
-
Thanks for the comprehensive research! 👍 |
Beta Was this translation helpful? Give feedback.
-
So, it doesn't appear to be included in the TransactionResponse, and I think it makes sense to not include it there, since if the transaction fails (reverts), there is no contract deployed to that address. It is available on the receipt though, at I think I'd prefer keeping this logic, rather than mimic the old API (I think back to v0 ;)) of the Does that make sense? |
Beta Was this translation helpful? Give feedback.
-
I guess it does make sense. I originally came over this issue because I updated my script that is constantly monitoring new contract deployments and it stopped working on V6. At first my solution was to run |
Beta Was this translation helpful? Give feedback.
-
Ethers Version
6.6.0
Search Terms
creates, getTransaction, contactcreation
Describe the Problem
The
.creates
property is missing inTransactionResponse
for contract creating transactions.Example transaction:
0x33174df580acaa50b08ba908a633ed7e3ac20e4440bf2a363be344b04c5f8474
V5:
V6:
Code Snippet
provider.getTransaction('0x33174df580acaa50b08ba908a633ed7e3ac20e4440bf2a363be344b04c5f8474')
Contract ABI
No response
Errors
No response
Environment
No response
Environment (Other)
No response
Beta Was this translation helpful? Give feedback.
All reactions