argotorg / argotorg/solidity

Redefine struct getters to return their struct type, not a tuple of individual fields

Open
#6,337 6 comments 6 reactions 0 assignees View on GitHub
breaking change :warning: language design :rage4: low effort medium impact must have
Dominant language
C++
Stars
25.7k
Forks
6.2k
Avg merge
1d 11h
Merged PRs (30d)
21

Description

With the AbiEncoderv2, is the intent to have structs returned from auto-generated getters for public storage?

For example,

```
struct Data {
uint256 x;
bytes32 y;
}

mapping (bytes32 => Data) public data;
```

This exposes the getter `function data(bytes32) public view returns (uint256,bytes32)`

Is it possible that it could instead expose `function data(bytes32) public view returns (Data)`?

Contributor guide

Open the contributing guide

Research direction

Start with the AbiEncoderv2 behavior and the generated getter example in the issue. No files or tests are named, so trace the public mapping getter and related ABI encoder tests first; done requires a decided, tested getter return shape and documented compatibility behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, solidity
Domain
blockchain, compilers
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.