Skip to content

toBeHex incorrectly handles zero case #5025

@die-herdplatte

Description

@die-herdplatte

Ethers Version

6.15.0

Search Terms

utils, math, toBeHex

Describe the Problem

A call to toBeHex with value and width set to zero throws although it should return 0x.

Code Snippet

toBeHex(0, 0)

Contract ABI

Errors

RangeError: value exceeds width (0 bytes) (operation="toBeHex", fault="overflow", value=0, code=NUMERIC_FAULT, version=6.15.0)

Environment

No response

Environment (Other)

No response

Metadata

Metadata

Assignees

Labels

bugVerified to be an issue.minor-bumpPlanned for the next minor version bump.on-deckThis Enhancement or Bug is currently being worked on.v6Issues regarding v6

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions