alloy-rs / alloy-rs/core

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

Aberta
#570 1 comentário 7 reações 0 responsáveis Ver no GitHub
enhancement
Linguagem predominante
Rust
Estrelas
967
Forks
274
Merge médio
1d 21h
PRs com merge (30d)
15

Descrição

### 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

```solidity
function foo(uint256 fooBar) external;
```

would create the following Rust structure:

```rust
struct fooCall {
fooBar: U256,
}
```

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

```rust
struct FooCall {
foo_bar: U256,
}
```

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

### Additional context

_No response_

Guia de contribuição

Abrir o guia de contribuição

Avaliação

Esta issue ainda não foi avaliada.

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.