See the below contract function of which return the string (Tested in Remix.org):
pragma solidity >=0.4.22 <0.6.0;
contract HelloWorld {
function get() pure public returns (string memory){
return "Hello Solidity";
}
}
While in the following contract, I can't get the returned string.
pragma solidity >=0.4.22 <0.6.0;
contract HelloWorld {
uint num;
function get(uint val) public returns (string memory){
num = val;
return "Hello Solidity";
}
}
Why? And how can I get returned string from not pure function ?