2016-08-13 10:48:00 -04:00
|
|
|
var async = require('async');
|
|
|
|
|
|
|
|
// needs:
|
|
|
|
// compile the contract -> file location
|
|
|
|
// gas -> config
|
|
|
|
contractObject = {
|
|
|
|
compiledCode,
|
|
|
|
abiDefinition,
|
|
|
|
gas,
|
|
|
|
gasPrice
|
|
|
|
}
|
2015-10-09 13:20:35 -04:00
|
|
|
|
2016-08-13 10:48:00 -04:00
|
|
|
function deployContract(web3, contractObject, params) {
|
|
|
|
var contractObject = web3.eth.contract(contract.compiled.info.abiDefinition);
|
2015-06-27 22:20:07 -04:00
|
|
|
|
2016-08-13 10:48:00 -04:00
|
|
|
var contractParams = params;
|
|
|
|
contractParams.push({
|
|
|
|
from: primaryAddress,
|
|
|
|
data: contract.compiled.code,
|
|
|
|
gas: contract.gasLimit,
|
|
|
|
gasPrice: contract.gasPrice
|
2016-05-29 20:14:27 -04:00
|
|
|
});
|
2015-10-08 15:30:47 -04:00
|
|
|
contractParams.push(callback);
|
2015-08-04 08:18:04 -04:00
|
|
|
|
2016-08-13 10:48:00 -04:00
|
|
|
contractObject["new"].apply(contractObject, contractParams);
|
2016-08-09 20:50:12 -04:00
|
|
|
};
|
2015-10-09 10:18:18 -04:00
|
|
|
|
2016-08-13 10:48:00 -04:00
|
|
|
function buildContractObject(contractCode, gas, gasPrice) {
|
|
|
|
var compiledContract = compiler.compile(contractCode);
|
|
|
|
return {
|
2015-06-27 22:20:07 -04:00
|
|
|
}
|
2016-08-13 10:48:00 -04:00
|
|
|
}
|
2015-06-27 22:20:07 -04:00
|
|
|
|