Skip to content

debugSymbols lacks struct definitions, so Hardhat's EIP-712 cheatcodes fail under slang #813

Open

Description

@nebasuke

Hardhat builds the EIP-712 type table for the vm.eip712HashType / vm.eip712HashStruct cheatcodes by walking the solc AST in each build info for StructDefinition nodes (collectEip712CanonicalTypes in packages/hardhat/src/internal/builtin-plugins/solidity-test/eip712/). slang emits its own AST format, so the walker finds no structs and every lookup fails:

Error: vm.eip712HashStruct: 'Permit' not defined in `eip712CanonicalTypes`

On aave-v4 this fails 149 of its 1559 Solidity tests under slang (solx #786's prerelease cc66c013); solc and solx 0.1.8 pass all 1559. Every failure is this error, and no other repo in the Hardhat benchmark suite uses the cheatcodes.

The table needs, per struct: its name, the source and contract (or file level) it is declared in, and its members in order, each with its name and a resolved type: elementary types as written (address payable as address), enums as uint8, user-defined value types as their underlying type, contracts and interfaces as address, other structs as a reference that can be followed, arrays with their base and length, and mappings and function types marked as such (Hardhat drops any struct that contains one, and the structs that depend on it). A structs list in debugSymbols, next to contracts, would carry that; Hardhat's collector then reads it for compilerType: "slang" build infos.

The Hardhat benchmark (NomicFoundation/hardhat#8692) leaves aave's slang test cell out until then. Related: #806.

Activity

  1. added
    feat
    on Oct 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    feat

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions