I have the following contract (truffle + zeppelin):
contract SampleCrowdsale is CappedCrowdsale, RefundableCrowdsale {
uint256 public cirCap;
function SampleCrowdsale(uint256 _startTime, uint256 _endTime, uint256 _rate, uint256 _goal, uint256 _cap, address _wallet) public
CappedCrowdsale(_cap)
FinalizableCrowdsale()
RefundableCrowdsale(_goal)
Crowdsale(_startTime, _endTime, _rate, _wallet)
{
//As goal needs to be met for a successful crowdsale
//the value needs to less or equal than a cap which is limit for accepted funds
require(_goal <= _cap);
cirCap = getTokenAmount(_cap);
}
function createTokenContract() internal returns (MintableToken) {
return new SampleCrowdsaleToken();
}
function airdropCoins(address beneficiary, uint256 cirAmount) onlyOwner public {
uint256 authorizedCoinsRemaining = cirCap - token.totalSupply();
require(cirAmount > 0);
require(cirAmount <= authorizedCoinsRemaining); // <== This fails to deploy !!!
token.mint(beneficiary, cirAmount);
}
}
Any ideas why the "require(cirAmount <= authorizedCoinsRemaining);" makes the contract to fail with the very cryptic message:
Error encountered, bailing. Network state unknown. Review successful transactions manually.
Error: The contract code couldn't be stored, please check your gas amount