1

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.

1 Answer 1

1

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
  • 1
    I see. I was thinking that if the size of the array is fix, it should be able to estimate the gas value. Commented Jan 28, 2018 at 9:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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