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
    – qbsp
    Jun 11, 2018 at 10:09
  • I just paste the code into Remix and click "start to compile" Jun 11, 2018 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.
    – qbsp
    Jun 11, 2018 at 10:47
  • Same here, it says 220 gas.
    – Jaime
    Jun 11, 2018 at 11:58

1 Answer 1


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 and acknowledge that you have read and understand our privacy policy and code of conduct.

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