1

I am trying to connect remix to testrpc, but anything at all I run there gives me an "out of gas" message.

I started the testrpc using

testrpc -l 4500000000000

So I would have thought it would be OK, the contract itself is nothing right now - just a test contract with a setter and a getter function for a byte32 field.

The usual answer to this seems to be to increase the gas using the -l parameter, but whatever I set doesn't seem to be enough.

Edit: The same error doesn't occur when running on the Javascript VM, only when I connect to testrpc.

There are no arrays or anything like that. The function is just a placeholder for now while I work out how the integration side works.

pragma solidity ^0.4.0;

contract Functest {
    bytes32 foo; 

    function setFoo(bytes32 _foo) public {
        foo = _foo;
    }

    function getFoo() constant public returns (bytes32) {
        return foo;
    }
}
  • Does the same error happen without connecting to testrpc (e.g. use the JavaVM environment)? – Linmao Song Nov 9 '17 at 12:55
  • What is your code trying to do? Some errores will cause out of gas, even if you have enough gas, ie accessing an array out of bounds. – Ismael Nov 9 '17 at 15:20
  • Only on connection to testrpc. I've pasted the code into the question, but it's really only a dummy function. – urbanespaceman Nov 9 '17 at 16:01
  • 1
    I have the same problem and I tried this command but it didnt work: testrpc -l 3000000 I even rebooted my computer many many times and checked all forums. i am seriously stuck with this issue of gas limit. it doesnt show me any problem when i run it on JVM. only when I use web3 provider and connect it with testrpc. – Tarik EN-NAKDI Nov 9 '17 at 16:32
  • Do you use truffle? And if yes which version? I run into the same problem with truffle 4.0.1. You could use truffle develop (which is a new feature of truffle 4.0.x) instead of testrpc. – Bumblebee Nov 9 '17 at 18:53

Your Answer

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

Browse other questions tagged or ask your own question.