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

ABI does not match solidity in the case of returning a single struct #2457

Closed
Tracked by #2471
charles-cooper opened this issue Sep 16, 2021 · 2 comments
Closed
Tracked by #2471

Comments

@charles-cooper
Copy link
Member

charles-cooper commented Sep 16, 2021

Version Information

  • vyper Version (output of vyper --version): v0.2.16

What's your issue about?

Solidity does not allow return types which are not wrapped in a tuple. For instance, the following signature is illegal Solidity:

struct Person { bytes name; int age; }
function person() external returns Person memory;

Instead, the signature must be something like

function person() external view returns (Person memory);

(this is equivalent to vyper returning (Person,))

We can do it either way in vyper since we don't have the same semantic restriction, but for simple types (bytestrings and base types), we already wrap them in a tuple for compatibility. We should be consistent for structs and wrap them in a tuple as needed.

@charles-cooper charles-cooper changed the title returned struct ABI does not match solidity ABI does not match solidity in the case of returning a single struct Sep 16, 2021
@fubuloubu
Copy link
Member

Seems like a reasonable compatibility point

@charles-cooper
Copy link
Member Author

fixed in #2447

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants