getTransactionCount() of a contract address always return 1 #3378
Replies: 2 comments 2 replies
-
The nonce (or transaction count) of an account only includes the outgoing transactions in case of EOAs and in the case of contracts, it is the contract deployments using This contract did not deploy any contracts and hence its nonce should be 0, but still, it's 1 because of EIP-161, which specifies that any contracts that are created using EOA or CREATE opcode after block 2,675,000 should start with nonce as 1. |
Beta Was this translation helpful? Give feedback.
-
So how to get numbet of tx on the contract? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Ethers Version
5.6.9
Search Terms
getTransactionCount
Describe the Problem
getTransactionCount() of a contract address always returns 1, which should return the transaction of that contract.
For example,
0xE592427A0AEce92De3Edee1F18E0157C05861564
is a uniswap router, but getTransactionCount() of it returns 1.Code Snippet
Contract ABI
No response
Errors
No response
Environment
node.js (v12 or newer)
Environment (Other)
No response
Beta Was this translation helpful? Give feedback.
All reactions