alloy-rs / core

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

[Feature] Add ability to decorate sol! macro with style attributes (`snake_case`, serde rename) #581

Closed zerosnacks closed 5 months ago

zerosnacks commented 6 months ago

Component

contract

Describe the feature you would like

Follow up from: https://github.com/alloy-rs/examples/pull/8#discussion_r1526789427

Request is to add the ability to decorate sol! macro with style attributes.

Consider the following:

let IERC20::totalSupplyReturn { _0 } = contract.totalSupply().call().await?;

This would, when having been decorated by a snake_case attribute be transformed in:

let IERC20::total_supply_return { _0 } = contract.total_supply().call().await?;

Additional context

Any changes will be reflected in alloy/examples

DaniPopes commented 5 months ago

Duplicate of https://github.com/alloy-rs/core/issues/570.