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

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

Open
makcandrov opened this issue Mar 13, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@makcandrov
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Todo
Development

No branches or pull requests

2 participants