check if contracts config is defined and if not use defaults
This commit is contained in:
parent
7bb67dacc8
commit
972bb3a254
|
@ -31,14 +31,14 @@ module.exports = (grunt) ->
|
||||||
compiled_contracts = web3.eth.compile.solidity(source)
|
compiled_contracts = web3.eth.compile.solidity(source)
|
||||||
|
|
||||||
for className, contract of compiled_contracts
|
for className, contract of compiled_contracts
|
||||||
contractGasLimit = contractsConfig[className].gasLimit || gasLimit
|
contractGasLimit = contractsConfig?[className]?.gasLimit || gasLimit
|
||||||
contractGasPrice = contractsConfig[className].gasPrice || gasPrice
|
contractGasPrice = contractsConfig?[className]?.gasPrice || gasPrice
|
||||||
|
|
||||||
args = contractsConfig[className].args
|
args = contractsConfig?[className]?.args
|
||||||
|
|
||||||
contractObject = web3.eth.contract(contract.info.abiDefinition)
|
contractObject = web3.eth.contract(contract.info.abiDefinition)
|
||||||
|
|
||||||
contractParams = args
|
contractParams = args || []
|
||||||
contractParams.push({from: primaryAddress, data: contract.code, gas: contractGasLimit, gasPrice: contractGasPrice})
|
contractParams.push({from: primaryAddress, data: contract.code, gas: contractGasLimit, gasPrice: contractGasPrice})
|
||||||
contractAddress = contractObject.new.apply(contractObject, contractParams).address
|
contractAddress = contractObject.new.apply(contractObject, contractParams).address
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue