Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] Bindings Incorrect for Non-Primitive Indexed Types #734

Closed
jnoorchashm37 opened this issue Sep 9, 2024 · 0 comments · Fixed by #735
Closed

[Bug] Bindings Incorrect for Non-Primitive Indexed Types #734

jnoorchashm37 opened this issue Sep 9, 2024 · 0 comments · Fixed by #735
Labels
bug Something isn't working

Comments

@jnoorchashm37
Copy link

Component

primitives, sol-types

What version of Alloy are you on?

0.7.2

Operating System

macOS (Apple Silicon)

Describe the bug

When indexing non-primitive, custom types in a log event, is the rust binding that is generated in the topic the abi encoded hash for the custom type? I'm looking at the Initialize log in the v4 contracts. The indexed Currency type is an address but the rust binding is declaring it a FixedBytes<32>.

I am generating the bindings using foundry with the v4 contracts as git submodule working on rev e74c9bbd42fe0fb1c20e2560e72d5c2e62fb45f1.


event Initialize(PoolId indexed id, Currency indexed currency0, Currency indexed currency1, uint24 fee, int24 tickSpacing, address hooks, uint160 sqrtPriceX96, int24 tick);

generated bindings:

#[allow(non_camel_case_types, non_snake_case, clippy::style)]
#[derive(Clone)]
pub struct Initialize {
  #[allow(missing_docs)]
  pub id: alloy::sol_types::private::FixedBytes<32>,
  #[allow(missing_docs)]
  pub currency0: alloy::sol_types::private::FixedBytes<32>,
  #[allow(missing_docs)]
  pub currency1: alloy::sol_types::private::FixedBytes<32>,
  #[allow(missing_docs)]
  pub fee: <alloy::sol_types::sol_data::Uint<
      24,
  > as alloy::sol_types::SolType>::RustType,
  #[allow(missing_docs)]
  pub tickSpacing: <alloy::sol_types::sol_data::Int<
      24,
  > as alloy::sol_types::SolType>::RustType,
  #[allow(missing_docs)]
  pub hooks: alloy::sol_types::private::Address,
  #[allow(missing_docs)]
  pub sqrtPriceX96: <alloy::sol_types::sol_data::Uint<
      160,
  > as alloy::sol_types::SolType>::RustType,
  #[allow(missing_docs)]
  pub tick: <alloy::sol_types::sol_data::Int<
      24,
  > as alloy::sol_types::SolType>::RustType,
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant