pragma solidity >=0.5.0 <0.7.0;
contract Example{
uint256 public x=3;
function setArr(uint256 y) public returns(uint256){
x=y;
return getArr(x);
}
function getArr(uint256 z) public pure returns(uint256)
{ return z; }
}
Asked
Active
Viewed 18 times
0
user61878
- 67
- 1
- 3
viewandpure, and those that modify it. The first group do not require to execute a transaction so you can obtain the returned value, the second group needs a transaction to modify storage so we cannot easily get the returned value (you need an archive node or a modified client like remix). In the question since functionsetArrmodifies the contract storage, iexis updated it has to be called in a transaction so no easy way to get the returned value. Read the linked for more details and alternatives. – Ismael Jul 29 '20 at 18:59