Skip to content

sliceHex bug #4041

@drortirosh

Description

@drortirosh

Check existing issues

Viem Version

2.37

Current Behavior

sliceHex("0x12345678",1,0) = "0x" // ok, supports zero length hex values

sliceHex("0x12345678",4,0)  // reverts on "out of bounds"

This should not revert, but return an empty hex string (e.g. given calldata, I want to extract the params block)

Expected Behavior

No response

Steps To Reproduce

No response

Link to Minimal Reproducible Example

No response

Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions