0

EDIT: we spotted the mistake in the code, endtime = starttime

I deployed with truffle a subclass of zeppelin popular crowdsale

contract GorillaSale is Crowdsale {

  function GorillaSale(    uint256 _time_start,
                           uint256 _time_end,
                           uint256 _rate, 
                           address _wallet)

    Crowdsale(_time_start, _time_start, _rate, _wallet)
  {

  }

  function createTokenContract() internal returns (MintableToken) {
    return new GorillaToken();
  }

}


contract GorillaToken is MintableToken {

  string public constant name = "Gorilla Token";
  string public constant symbol = "GRL";
  uint8 public constant decimals = 4;

}

The contract is deployed on ropsten at 0xae09A60d2Ccb4431856229fB7B68b948ce583264 but if I try to send ether from metamask or MEW to it I get a gas estimate for the transaction of 4.5M gas, which is huge and the transaction fails. Here an example of failed tx 0x86c2d36dc65e9e9f8e3b50a47a5f1619f9a2da0891c6327309c1ce97eb470e59

I suspect there is something strange and not related to the gas. I wonder how a crowdsale could possibly work with gas = 4.5M, in ropsten would be 30$ of fees.

1

There must be definitively something wrong with either the contract code or how you are calling it. Metamask will give you a huge gas estimate when it "knows" the transaction will fail due to a require() condition failing.

So, probably you are trying to send ether to the contract which is not in the correct state. For example, maybe the start time or end time were not correctly set,etc.

  • 1
    thx, you're right. I was setting starttime = endtime because of a stupid copy/paste typo – Davide C Nov 12 '17 at 0:33

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.