alloy-rs / core

High-performance, well-tested & documented core libraries for Ethereum, in Rust
https://alloy.rs
Apache License 2.0
786 stars 149 forks source link

[Feature] Implement `sol-types` traits in `sol!` without tuples #261

Open DaniPopes opened 1 year ago

DaniPopes commented 1 year ago

Component

sol! macro

Describe the feature you would like

Currently we implement all traits by deferring everything to a tuple of the inner types (struct, function arguments and returns, etc.).

This is bad because it:

Additional context

No response

prestwich commented 1 year ago

has lower runtime performance due to needing to clone the types to then just use the tuple by reference

this should have been fixed by the Encodable trait being implemented for &(&T, &U, &V) now, no?