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

Return array - TypeError: Cannot read property 'type' of undefined #32

Open
gpersoon opened this issue Nov 19, 2019 · 1 comment
Open

Comments

@gpersoon
Copy link
Contributor

I found another edge case with the following contract:

pragma solidity >=0.4.0 <0.7.0;
contract Test {
  uint[] aa=[1,2,3,4];
   function GetStorage() public view returns(uint[] memory) {
       return aa;
   }
}

Calling the function GetStorage results in the following error:

bundle.js:49678 Uncaught (in promise) TypeError: Cannot read property 'type' of undefined
    at getTypes (bundle.js:49678)
    at bundle.js:49661
    at Array.map (<anonymous>)
    at decodeReturnData (bundle.js:49661)
    at getReturnData (bundle.js:50058)
    at makeReturn (bundle.js:50050)
    at sendTx (bundle.js:50485)
@gpersoon
Copy link
Contributor Author

An other variation of the same issue:

pragma solidity >=0.4.0 <0.7.0;
contract Test {
      address[] aa = [address(0x1),address(0x2)];
      function Check() external view returns (address [] memory)  {
        return aa;
    }
}

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

1 participant