I'm developing a smart contract over private blockchain using Truffle framework.
Developed smart contract was running well, today we have been introduced one pure method as per requirement. Afterwords, Truffle migrate starts giving an error:

Error encountered, bailing. Network state unknown. Review successful transactions manually.
Error: The contract code couldn't be stored, please check your gas amount.

However, I remove some storage variable makes it work again. As per digging issue gas limit is not an issue, smart contract deployment taking half of gas specified for a block.

Here are some FAQs:

Q: What parameters you have removed to make it work?
A: Simple address variable:

//address public owner;    

constructor() public {
    //owner = msg.sender;

Q: Could you please show your code?
A: I can't, due to confidentiality as well code is huge.

Q: What gas limit you have specified in truffle js file?
A: 4712388

Q: Have you tried to increase Gas limit?
A: Yes, but no luck.

Edit: Contract structure

import "./ContractB.sol";

Contract A is ContractB{

  constructor() public {
    owner = msg.sender;
    index = 0;
    userID = 0;

import "./ContractC.sol";

Contract B is ContractC{


Contract C {


Error comes with migration of ContractA and new function added in ContractB.

  • 2
    Q: Did you implement all abstract methods from parent interfaces and abstract contracts?
    – Henk
    Aug 2, 2018 at 10:47
  • A: I'm having 3 contracts, and I made it separated based on functionalities. There is no interface or abstract contracts, am using simple inheritance.
    – Div
    Aug 2, 2018 at 10:51
  • @Henk: updated question with contract structure
    – Div
    Aug 2, 2018 at 10:56
  • Thanks. So there are no functions without body in A, B or C?
    – Henk
    Aug 2, 2018 at 10:58
  • 1
    @Henk: Resolved :)
    – Div
    Aug 2, 2018 at 12:33

1 Answer 1


One line answer: this issue is simply resolved by increasing GAS limit in Geth.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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