diff --git a/lib/eth/client.rb b/lib/eth/client.rb index 05c4d5b7..4ca4448b 100644 --- a/lib/eth/client.rb +++ b/lib/eth/client.rb @@ -181,11 +181,11 @@ def deploy_and_wait(contract, *args, **kwargs) def deploy(contract, *args, **kwargs) raise ArgumentError, "Cannot deploy contract without source or binary!" if contract.bin.nil? raise ArgumentError, "Missing contract constructor params!" if contract.constructor_inputs.length != args.length - gas_limit = Tx.estimate_intrinsic_gas(contract.bin) + Tx::CREATE_GAS data = contract.bin unless args.empty? data += encode_constructor_params(contract, args) end + gas_limit = Tx.estimate_intrinsic_gas(data) + Tx::CREATE_GAS params = { value: 0, gas_limit: gas_limit,