Skip to content

bug(bind): all_derives skipped for custom solidity structs #10353

Open
@sveitser

Description

@sveitser

Component

Forge

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

  • Foundry
  • Foundryup

What version of Foundry are you on?

forge Version: 1.0.0-nightly Commit SHA: 7a7ad4e Build Timestamp: 2025-04-01T06:03:16.218549398Z (1743487396) Build Profile: maxperf

What version of Foundryup are you on?

No response

What command(s) is the bug in?

forge bind

Operating System

Linux

Describe the bug

Since #10099 forge bind generates extra derives #[derive(Default, Debug, PartialEq, Eq, Hash)] for events, but only if they don't use custom solidity types.

There is an example here

https://github.com/EspressoSystems/espresso-network/blob/e005d4449eb5487f94f7e2cd9629bcf8b5d14c0d/contracts/rust/adapter/src/bindings/staketable.rs#L4659

To reproduce, the affected file above can be generated with

forge bind --skip test --skip script --use "0.8.28" --alloy --alloy-version "0.13.0" --contracts ./contracts/src/ --module --bindings-path contracts/rust/adapter/src/bindings --select "^StakeTable\$" --overwrite --force

in a checkout of https://github.com/EspressoSystems/espresso-network

At least in this case (but probably always?) the custom types also derive all of Default, Debug, PartialEq, Eq, Hash already. So I think so we should be able to derive them.

For example G2Point here: https://github.com/EspressoSystems/espresso-network/blob/87302f0cca4dcffa5a226fcbe55ff5065978a11b/contracts/rust/adapter/src/bindings/staketable.rs#L308

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Status

    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions