embark/lib/deploy.js

34 lines
728 B
JavaScript
Raw Normal View History

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);
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-13 10:48:00 -04:00
function buildContractObject(contractCode, gas, gasPrice) {
var compiledContract = compiler.compile(contractCode);
return {
}
2016-08-13 10:48:00 -04:00
}