diff --git a/lib/contracts.js b/lib/contracts.js index 5fd10a78..369fdb45 100644 --- a/lib/contracts.js +++ b/lib/contracts.js @@ -7,8 +7,9 @@ var async = require('async'); var adjustGas = function(contract) { var maxGas, adjustedGas; if (contract.gas === 'auto') { - if (contract.deploy) { + if (contract.deploy || contract.deploy === undefined) { if (contract.gasEstimates.creation !== undefined) { + // TODO: should sum it instead maxGas = Math.max(contract.gasEstimates.creation[0], contract.gasEstimates.creation[1], 500000); } else { maxGas = 500000; @@ -17,7 +18,8 @@ var adjustGas = function(contract) { maxGas = 500000; } // TODO: put a check so it doesn't go over the block limit - adjustedGas = Math.round(maxGas * 1.40); + adjustedGas = Math.round(maxGas * 1.40); + adjustedGas += 25000; contract.gas = adjustedGas; } };