Skip to main content
added more detail
Source Link
Daniel
  • 501
  • 2
  • 5
  • 18

TypeError: This type is only supported in the new function getArray() public view returns (string[])experimental ABI encoder

I am practicing my Solidity skills and while I did expect to get an error, I did not expect this error

TypeError: This type is only supported in the new experimental ABI encoder. Use "pragma experimental ABIEncoderV2;" to enable the feature. function getArray() public public view returns (string[]) {

This is my code in Remix:

pragma solidity ^0.4.17;

contract Test {
    string[] public myArray;
    
    function Test() public {
        myArray.push("hola");
    }
    
    function getArray() public view returns (string[]) {
        return myArray;
    }
}

What gives here?

Is this because the standard ABI does not support dynamic nested arrays?

TypeError: This type is only supported in the new function getArray() public view returns (string[])

I am practicing my Solidity skills and while I did expect to get an error, I did not expect this error

TypeError: This type is only supported in the new function getArray() public view returns (string[])

This is my code in Remix:

pragma solidity ^0.4.17;

contract Test {
    string[] public myArray;
    
    function Test() public {
        myArray.push("hola");
    }
    
    function getArray() public view returns (string[]) {
        return myArray;
    }
}

What gives here?

TypeError: This type is only supported in the new experimental ABI encoder

I am practicing my Solidity skills and while I did expect to get an error, I did not expect this error

TypeError: This type is only supported in the new experimental ABI encoder. Use "pragma experimental ABIEncoderV2;" to enable the feature. function getArray() public view returns (string[]) {

This is my code in Remix:

pragma solidity ^0.4.17;

contract Test {
    string[] public myArray;
    
    function Test() public {
        myArray.push("hola");
    }
    
    function getArray() public view returns (string[]) {
        return myArray;
    }
}

What gives here?

Is this because the standard ABI does not support dynamic nested arrays?

Source Link
Daniel
  • 501
  • 2
  • 5
  • 18

TypeError: This type is only supported in the new function getArray() public view returns (string[])

I am practicing my Solidity skills and while I did expect to get an error, I did not expect this error

TypeError: This type is only supported in the new function getArray() public view returns (string[])

This is my code in Remix:

pragma solidity ^0.4.17;

contract Test {
    string[] public myArray;
    
    function Test() public {
        myArray.push("hola");
    }
    
    function getArray() public view returns (string[]) {
        return myArray;
    }
}

What gives here?