ethers.js icon indicating copy to clipboard operation
ethers.js copied to clipboard

OverFlow on Nonce Value

Open felinblackcat opened this issue 7 months ago • 1 comments

Ethers Version

6.13.2

Search Terms

No response

Describe the Problem

The function getNumber return "invalid numeric string: overflow ..." with nonce value "0xb2f1e00c44e90a8e" The contract schema blockchian has defined nonce as uint64. Tecnically: 0 <= 0xb2f1e00c44e90a8e=12894333551438793358<=18446744073709551615 = 0xFFFFFFFFFFFFFFFF

Code Snippet

getNumber("0xb2f1e00c44e90a8e")

Contract ABI


Errors

"invalid numeric string: overflow (argument=\"value\", value=12894333551438793358, code=INVALID_ARGUMENT, version=6.13.2) (argument=\"value\", value=\"0xb2f1e00c44e90a8e\", code=INVALID_ARGUMENT, version=6.13.2)"

Environment

React Native/Expo/JavaScriptCore

Environment (Other)

No response

felinblackcat avatar Jun 06 '25 14:06 felinblackcat

Maybe important context to add here, as discussed in https://github.com/ethereum/sourcify/issues/2180 The VeChain's EVM implementation gives random nonce's instead of incremental, hence this issue is encountered in the wild. Otherwise it's close to impossible to encounter this in an incremental nonce scheme.

kuzdogan avatar Jul 07 '25 16:07 kuzdogan