You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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
Version Information
vyper --version
): v0.2.16What'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:
Instead, the signature must be something like
(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.
The text was updated successfully, but these errors were encountered: