mirror of
https://github.com/embarklabs/embark.git
synced 2025-01-11 06:16:01 +00:00
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)
|
||||
|
||||
for className, contract of compiled_contracts
|
||||
contractGasLimit = contractsConfig[className].gasLimit || gasLimit
|
||||
contractGasPrice = contractsConfig[className].gasPrice || gasPrice
|
||||
contractGasLimit = contractsConfig?[className]?.gasLimit || gasLimit
|
||||
contractGasPrice = contractsConfig?[className]?.gasPrice || gasPrice
|
||||
|
||||
args = contractsConfig[className].args
|
||||
args = contractsConfig?[className]?.args
|
||||
|
||||
contractObject = web3.eth.contract(contract.info.abiDefinition)
|
||||
|
||||
contractParams = args
|
||||
contractParams = args || []
|
||||
contractParams.push({from: primaryAddress, data: contract.code, gas: contractGasLimit, gasPrice: contractGasPrice})
|
||||
contractAddress = contractObject.new.apply(contractObject, contractParams).address
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user