I have an empty function like below:

function myFunction(int[24] param1, int param2) public returns (int s) {

When I calculate the estimated gas value of this empty function, Remix is telling that it is infinite. Does anyone know why?

PS: I realized that if I remove param1, the estimated gas value is not infinite but 269.


This is normal. Arrays, mapping, strings, structure and other types are deep types and Solidity does not really like this (by this I mean that it is complexe).

So yes, remix is not able to estimate the gas, but it would work with web3js for example (as the function is executed against the EVM).

  • 1
    I see. I was thinking that if the size of the array is fix, it should be able to estimate the gas value. Jan 28 '18 at 9:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.