When I'm trying to deploy my contract on testrpc with correct parameters, it's throwing 'VM Exception while processing transaction: out of gas' exception. I deployed same contract on Ropsten and it worked fine.

/** Constructor */
    function Hotel(
            bytes32 _name,
            string _description,
            bytes16 _locationLatitude,
            bytes16 _locationLongitude,
            int _hotelTimeZone
        ) {
            name = _name;
            description = _description;
            locationLatitude = _locationLatitude;
            locationLongitude = _locationLongitude;
            timezone = _hotelTimeZone;
            owner = msg.sender;

I'm deploying like given below on testrpc and it fails.

deployer.deploy(Hotel, 'Hotel', 'ABCDEF', '10.1231', '77.5946', 19800, {gas: 17000000});

But if I remove or add an extra parameter it works.

deployer.deploy(Hotel, 'Hotel', 'ABCDEF', '10.1231', '77.5946', 19800, 1,
 {gas: 17000000});
deployer.deploy(Hotel, 'Hotel', 'ABCDEF', '10.1231', '77.5946' {gas: 17000000});

I increased the block gas size of testrpc and supplied quite an amount of gas but still, it didn't work. I even reduced the constructor parameters to just one and still it fails if I just pass one input. It works if I pass more than that or nothing at all.

  • What version of testrpc are you using? – TripleSpeeder Jun 26 '17 at 13:18
  • Latest one 3.0.5 – Mayank Jun 26 '17 at 14:06
  • Not really an answer, but testrpc 4.0 was just released. If it still happens with this version i would post a bug report. – TripleSpeeder Jun 29 '17 at 11:42
  • @Mayank - TestRPC maintainer here - if this is still a problem, I'd love to have an issue filed. github.com/ethereumjs/testrpc – Ben Burns Nov 3 '17 at 4:33

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.