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
.