Skip to content

fix: ABI type serialization silently falls back to "uint256" for unhandled types #67

@refcell

Description

@refcell

In crates/typeck/src/checker.rs, the type_to_abi_string function has a catch-all arm that maps any unrecognized type signature to "uint256". This means that user-defined struct types, union types, map types, and any other complex type not explicitly handled are silently serialized as "uint256" in the ABI JSON. This produces wrong function selectors because the keccak256 hash includes the type string, and any tool consuming the ABI will generate incorrect calldata encoding for those parameters.

The fallback should either produce a compile error when an unrepresentable type is encountered in a public function signature, or implement proper ABI encoding for struct types as tuples following the Solidity ABI specification. A silent fallback to "uint256" is the worst outcome because the mismatch is invisible until runtime.

🤖 Generated with Claude Code

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-typeckArea: Type CheckerK-bugKind: Bug

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions