I tried to create a smart contract (Token ERC20) with this web IDE : https://remix.ethereum.org Everything was good. I taked te same contract and i tried to deploy it with node application by using web3 and solc (for the compiler). When i send the transaction to create the contract, i recieve an error who tell : "Warning! Error encountered during contract execution [Out of gas] "

enter image description here

Can you help me please to fix this problem ?

  • There seems to be similar questions here <bitcointalk.org/index.php?topic=2088618.0> But if you are out of gas and need to know gas costs you can calculate here <docs.google.com/spreadsheets/d/…> – r0r33 Mar 22 '18 at 2:29
  • You can increment the gas limit – Ismael Mar 22 '18 at 3:15
  • Just to be clear.The same contrat was deployed in with the IDE remix.ethereum with the same adress (who have a lot of Eth), Whe n i see the transaction who deployed the smarct contract succefully, i see that she use like "x" Gas limit, so i use the same gasLimit to deploy the same contract and it dosent work. I tried to increase the gasLimit by multiplying the gasLimit by 4 (like 4x GasLimit) and i still have the same error : Out of Gas. I know it's a problem of gas, but i dont know how to solve it, and i'm not sure that the solution it's by incrasing the gas limit :( – Farfara Cobra Mar 22 '18 at 7:49

Having in mind that you're trying to deploy something which as I understood you have a proof it's working already, leaves a gap for a couple of issues done on your side.

First one might be that the constructor arguments are not properly set, or that you're sending some wrong-type argument in the constructor.

Try to log all the arguments before sending the transaction and make sure they're all same types as expected on the contract side.

Also, consider checking a bytecode size. If you're having truffle project under /build/contracts directory you should find <contract-name>.json of the contract you're trying to deploy and make sure that the "deployed_bytecode" is less-equal than 24KB (make sure length of the deployed bytecode is less than 49152 chars)

Hope this helps!

| improve this answer | |

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.