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] Solidity ABI flattening internalType arrays #585

Closed
Yen opened this issue Mar 25, 2024 · 0 comments · Fixed by #586
Closed

[Bug] Solidity ABI flattening internalType arrays #585

Yen opened this issue Mar 25, 2024 · 0 comments · Fixed by #586
Labels
bug Something isn't working

Comments

@Yen
Copy link

Yen commented Mar 25, 2024

Component

sol! macro

What version of Alloy are you on?

├── alloy-primitives v0.6.4 │ ├── alloy-rlp v0.3.4 │ │ ├── alloy-rlp-derive v0.3.4 (proc-macro) │ │ ├── alloy-rlp v0.3.4 () ├── alloy-rpc-types v0.1.0 (https://github.com/alloy-rs/alloy?rev=410850b#410850b3) │ ├── alloy-primitives v0.6.4 () │ ├── alloy-rlp v0.3.4 () │ ├── alloy-serde v0.1.0 (https://github.com/alloy-rs/alloy?rev=410850b#410850b3) │ │ ├── alloy-primitives v0.6.4 () ├── alloy-sol-macro v0.6.4 (proc-macro) │ ├── alloy-json-abi v0.6.4 │ │ ├── alloy-primitives v0.6.4 │ │ ├── alloy-sol-type-parser v0.6.4 ├── alloy-sol-types v0.6.4 │ ├── alloy-primitives v0.6.4 () │ ├── alloy-sol-macro v0.6.4 (proc-macro) () ├── alloy-primitives v0.6.4 () ├── alloy-provider v0.1.0 (https://github.com/alloy-rs/alloy?rev=410850b#410850b3) │ ├── alloy-json-rpc v0.1.0 (https://github.com/alloy-rs/alloy?rev=410850b#410850b3) │ │ ├── alloy-primitives v0.6.4 () │ ├── alloy-network v0.1.0 (https://github.com/alloy-rs/alloy?rev=410850b#410850b3) │ │ ├── alloy-consensus v0.1.0 (https://github.com/alloy-rs/alloy?rev=410850b#410850b3) │ │ │ ├── alloy-eips v0.1.0 (https://github.com/alloy-rs/alloy?rev=410850b#410850b3) │ │ │ │ ├── alloy-primitives v0.6.4 () │ │ │ │ ├── alloy-rlp v0.3.4 () │ │ │ ├── alloy-primitives v0.6.4 () │ │ │ └── alloy-rlp v0.3.4 () │ │ ├── alloy-eips v0.1.0 (https://github.com/alloy-rs/alloy?rev=410850b#410850b3) () │ │ ├── alloy-json-rpc v0.1.0 (https://github.com/alloy-rs/alloy?rev=410850b#410850b3) () │ │ ├── alloy-primitives v0.6.4 () │ │ ├── alloy-rpc-types v0.1.0 (https://github.com/alloy-rs/alloy?rev=410850b#410850b3) () │ │ ├── alloy-signer v0.1.0 (https://github.com/alloy-rs/alloy?rev=410850b#410850b3) │ │ │ ├── alloy-primitives v0.6.4 () │ ├── alloy-primitives v0.6.4 () │ ├── alloy-rpc-client v0.1.0 (https://github.com/alloy-rs/alloy?rev=410850b#410850b3) │ │ ├── alloy-json-rpc v0.1.0 (https://github.com/alloy-rs/alloy?rev=410850b#410850b3) () │ │ ├── alloy-transport v0.1.0 (https://github.com/alloy-rs/alloy?rev=410850b#410850b3) │ │ │ ├── alloy-json-rpc v0.1.0 (https://github.com/alloy-rs/alloy?rev=410850b#410850b3) () │ │ ├── alloy-transport-http v0.1.0 (https://github.com/alloy-rs/alloy?rev=410850b#410850b3) │ │ │ ├── alloy-json-rpc v0.1.0 (https://github.com/alloy-rs/alloy?rev=410850b#410850b3) () │ │ │ ├── alloy-transport v0.1.0 (https://github.com/alloy-rs/alloy?rev=410850b#410850b3) () │ ├── alloy-rpc-trace-types v0.1.0 (https://github.com/alloy-rs/alloy?rev=410850b#410850b3) │ │ ├── alloy-primitives v0.6.4 () │ │ ├── alloy-rpc-types v0.1.0 (https://github.com/alloy-rs/alloy?rev=410850b#410850b3) () │ │ ├── alloy-serde v0.1.0 (https://github.com/alloy-rs/alloy?rev=410850b#410850b3) () │ ├── alloy-rpc-types v0.1.0 (https://github.com/alloy-rs/alloy?rev=410850b#410850b3) () │ ├── alloy-transport v0.1.0 (https://github.com/alloy-rs/alloy?rev=410850b#410850b3) () │ ├── alloy-transport-http v0.1.0 (https://github.com/alloy-rs/alloy?rev=410850b#410850b3) () ├── alloy-rpc-types v0.1.0 (https://github.com/alloy-rs/alloy?rev=410850b#410850b3) () ├── alloy-sol-macro v0.6.4 (proc-macro) () ├── alloy-sol-types v0.6.4 () ├── alloy-transport-http v0.1.0 (https://github.com/alloy-rs/alloy?rev=410850b#410850b3) () │ │ │ │ ├── alloy-rlp v0.3.4 (*)

Operating System

Linux

Describe the bug

I using the PoolBalanceChanged event from a BalancerV2 derived protocol (equivalent ABI https://etherscan.io/address/0xBA12222222228d8Ba445958a75a0704d566BF2C8#code). The tokens input is of type address[] but internal type contract IERC20[]. If I remove the internal type from the ABI, it correctly becomes a Vec<Address> through the sol! macro, but with the internal type it gets interpreted as Address as if it was ignoring the array. When I view the generated docs on the sol! output for the ABI, it shows it parsed event signature as event PoolBalanceChanged(bytes32 indexed poolId, address indexed liquidityProvider, address tokens, int256[] deltas, uint256[] protocolFeeAmounts), which is incorrect.

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