support deploying with multiple arguments
This commit is contained in:
parent
d728efe797
commit
7bb67dacc8
|
@ -37,14 +37,10 @@ module.exports = (grunt) ->
|
||||||
args = contractsConfig[className].args
|
args = contractsConfig[className].args
|
||||||
|
|
||||||
contractObject = web3.eth.contract(contract.info.abiDefinition)
|
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") {
|
contractParams = args
|
||||||
console.log "contract #{className} was not deployed, try adjusting the gas costs"
|
contractParams.push({from: primaryAddress, data: contract.code, gas: contractGasLimit, gasPrice: contractGasPrice})
|
||||||
exit
|
contractAddress = contractObject.new.apply(contractObject, contractParams).address
|
||||||
}
|
|
||||||
|
|
||||||
console.log "address is #{contractAddress}"
|
console.log "address is #{contractAddress}"
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue