Does the size of a state variable in a smart contract's storage impact the cost of a transaction, even if the variable is not accessed by the executed method? And if it does, to what extend?
For example, in this contract, there's a variable numbers
.
contract Example {
uint[] public numbers;
function randomOperation() public view returns(uint) {
return 2 + 2;
}
}
Let's assume that variable contains a very large number of entries, will the cost of randomOperation()
be affected by that? Also, if I do modify numbers
(adding an entry), will the number of entries affect the transaction cost?