0

I wrote this trivial contract in Remix:

pragma solidity ^0.4.24;

contract HelloWorld {  
    function greet() public pure returns (bytes32) {
        return bytes32('Hello World!');
    }
}

I got the warning: "Gas requirement of function HelloWorld.greet() high: infinite".

This is very strange since I do not have any strings or dynamic arrays. How can I get rid of this warning and have clean compilation?

  • how you get this warning? Remix is showing 220 (execution cost) as gas estimation for that function – mirg Jun 11 '18 at 10:09
  • I just paste the code into Remix and click "start to compile" – Erel Segal-Halevi Jun 11 '18 at 10:31
  • I did the same but I can't reproduce your problem and in the contract details I got a normal gas estimation. – mirg Jun 11 '18 at 10:47
  • Same here, it says 220 gas. – Jaime Jun 11 '18 at 11:58
0

Leave default parameters in remix for Gaslimit and wei - dont touch it. Set it in MetaMask. It`s helped me, since I had same issue.

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.