From 7bb67dacc84313becfe25ff8afdaae281eb5a63f Mon Sep 17 00:00:00 2001 From: Iuri Matias Date: Fri, 19 Jun 2015 23:21:03 -0400 Subject: [PATCH] support deploying with multiple arguments --- tasks/deploy.coffee | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/tasks/deploy.coffee b/tasks/deploy.coffee index 279952c4c..9ba0257e2 100644 --- a/tasks/deploy.coffee +++ b/tasks/deploy.coffee @@ -37,14 +37,10 @@ module.exports = (grunt) -> args = contractsConfig[className].args contractObject = web3.eth.contract(contract.info.abiDefinition) - #contractAddress = web3.eth.sendTransaction({from: primaryAddress, data: contract.code, gas: contractGasLimit, gasPrice: contractGasPrice}) - #contractAddress = contractObject.new(150, {from: primaryAddress, data: contract.code, gas: contractGasLimit, gasPrice: contractGasPrice}).address - contractAddress = contractObject.new.apply(contractObject, [args, {from: primaryAddress, data: contract.code, gas: contractGasLimit, gasPrice: contractGasPrice}]).address - if (web3.eth.getCode(contractAddress) is "0x") { - console.log "contract #{className} was not deployed, try adjusting the gas costs" - exit - } + contractParams = args + contractParams.push({from: primaryAddress, data: contract.code, gas: contractGasLimit, gasPrice: contractGasPrice}) + contractAddress = contractObject.new.apply(contractObject, contractParams).address console.log "address is #{contractAddress}"