Skip to content

[Feature] Rename attribute for structures generated through the sol! macro #570

Open
@makcandrov

Description

@makcandrov

Component

sol! macro

Describe the feature you would like

Currently, the structures generated through the sol! macro use the exact same naming as in the Solidity code, but it follows different naming conventions than Rust. For example, a Solidity function

function foo(uint256 fooBar) external;

would create the following Rust structure:

struct fooCall {
    fooBar: U256,
}

But we might prefer it to create a structure that follows Rust's naming conventions

struct FooCall {
    foo_bar: U256,
}

A serde-like #[rename(...)] attribute could be implemented here

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    Status

    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions