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

Support receiving structs as arguments for external functions #1603

Closed
3 tasks done
chriseth opened this issue Jan 24, 2017 · 5 comments
Closed
3 tasks done

Support receiving structs as arguments for external functions #1603

chriseth opened this issue Jan 24, 2017 · 5 comments
Assignees

Comments

@chriseth
Copy link
Contributor

chriseth commented Jan 24, 2017

  • modify the type system accordingly
  • write the decoder for memory
  • write the decoder for calldata
@axic
Copy link
Member

axic commented Jul 28, 2018

@chriseth isn't this fully supported via ABIEncoderV2?

@axic axic removed Focus labels Jul 30, 2018
@chriseth
Copy link
Contributor Author

chriseth commented Aug 3, 2018

This is still pending, mostly because the stack representation of such types is not yet defined.

@Amxx
Copy link

Amxx commented Jan 7, 2019

This issue is almost one year old, and is still blocking. It makes it impossible to write interfaces with structs as input. Any idea when we can expect a fix ?

@chriseth
Copy link
Contributor Author

chriseth commented Jan 7, 2019

@Amxx you can use structs if the implementing function is public instead of external:

pragma solidity ^0.5.0;
pragma experimental ABIEncoderV2;

interface I {
    struct S { uint a; uint b; }
    function f(S calldata) external returns (uint);
}

contract C is I {
    function f(I.S memory _s) public returns (uint) {
        return _s.a;
    }
}

@chriseth
Copy link
Contributor Author

Implemented in #6209

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

5 participants