E.g. a function that just returns huge struct data. Is there any limit in data so that calling this function will not be possible?
pragma solidity ^0.4.13;
contract Project
{
struct Person {
address addr;
uint funds;
}
Person[] people;
function getPeople(uint[] indexes)
public
view
returns (address[], uint[])
{
address[] memory addrs = new address[](indexes.length);
uint[] memory funds = new uint[](indexes.length);
for (uint i = 0; i < indexes.length; i++) {
Person storage person = people[indexes[i]];
addrs[i] = person.addr;
funds[i] = person.funds;
}
return (addrs, funds);
}
}
If I stored 1000000000000... Person, can I return them with getPeople()
?
Edit: Changed function to view, avoiding confusions.
view
, and then there shouldn't be any gas cost involved. All the data is (already) on the blockchain, you are not changing anything, so there's no mining involved, hence no subsequent gas cost.