1

I have a contract that has about ~1.000 lines. But when I try to deploy it, it does not work because of an "out of gas error". I already tried with a limit of the maximum, of 6 million and even 8 million gas, still the same error.

I am working with Remix and would like to know how I can solve it. Due to privacy I cannot post the contract. But I am wondering, why can I deploy for example the CryptoKitties Contract which has 2x the amount of lines than what I have? and how can I see how much gas the contract needs? I tried in JavascriptVM with even a gaslimit of 100.000.000 but still not possible. Also in the testnet I use, I tried to limit up the gas limit to 15.000.000, still not possible.

And let's say my contract has 2 parts: contract Token {} contract Project {}

What would happen when I deploy only contract "Project" without the "is Token"? Could I still access Token somehow?


EDIT: When I enable the "Enable Optimization" option in Remix, the deploying works. Why? What is that option?


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.