Skip to content

bug(cast): fails in encoding of bytes if non-hexadecimal values passed #8536

Closed
@Amit0617

Description

@Amit0617

Component

Cast

Have you ensured that all of these are up to date?

  • Foundry
  • Foundryup

What version of Foundry are you on?

forge 0.2.0 (62cdea8 2024-07-23T00:19:34.618350138Z)

What command(s) is the bug in?

cast calldata

Operating System

Linux

Describe the bug

Try following command

cast calldata "sam(bytes)" dave

It fails parsing argument value because of v.
Technically, for non-hexadecimal values, it should be UTF8-encoding (ASCII values) padded right to 32 bytes. Look at third example https://docs.soliditylang.org/en/latest/abi-spec.html#examples

Metadata

Metadata

Assignees

Labels

C-castCommand: castT-bugType: bug

Type

No type

Projects

Status

Completed

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions