Skip to content

getBaseEncoder to support "uint" #4541

@charlie-kim

Description

@charlie-kim

Ethers Version

6.9.2

Search Terms

hash

Describe the Problem

getBaseEncoder function crashes when type is uint. match[2] is an empty string and it is not equal to null.

https://github.com/ethers-io/ethers.js/blob/main/src.ts/hash/typed-data.ts#L132C2-L132C2

Updating to this might work.
(match[2] == null || match[2] == '' || match[2] === String(width))

Code Snippet

No response

Contract ABI

No response

Errors

No response

Environment

node.js (v12 or newer)

Environment (Other)

No response

Metadata

Metadata

Assignees

Labels

bugVerified to be an issue.fixed/completeThis Bug is fixed or Enhancement is complete and published.v6Issues regarding v6

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions