|
|
@ -326,16 +326,16 @@ function finalizeDeployment(deploymentId, address) { |
|
|
|
fileIo.copyFile(doc.path, deploymentDir + doc.fileName); |
|
|
|
} |
|
|
|
//write deployment js
|
|
|
|
var contractAccessor = "contracts[\"" + codeModel.code.contract.name + "\"]"; |
|
|
|
var deploymentJs = |
|
|
|
"// Autogenerated by Mix\n" + |
|
|
|
"var web3 = require(\"web3\");\n" + |
|
|
|
"var contractInterface = " + codeModel.code.contractInterface + ";\n" + |
|
|
|
"deploy = {\n" + |
|
|
|
"\tweb3: web3,\n" + |
|
|
|
"\tcontractAddress: \"" + address + "\",\n" + |
|
|
|
"\tcontractInterface: contractInterface,\n" + |
|
|
|
"web3 = require(\"web3\");\n" + |
|
|
|
"contracts = {};\n" + |
|
|
|
contractAccessor + " = {\n" + |
|
|
|
"\tinterface: " + codeModel.code.contractInterface + ",\n" + |
|
|
|
"\taddress: \"" + address + "\"\n" + |
|
|
|
"};\n" + |
|
|
|
"deploy.contract = web3.eth.contract(deploy.contractAddress, deploy.contractInterface);\n"; |
|
|
|
contractAccessor + ".contract = web3.eth.contract(" + contractAccessor + ".address, " + contractAccessor + ".interface);\n"; |
|
|
|
fileIo.writeFile(deploymentDir + "deployment.js", deploymentJs); |
|
|
|
//copy scripts
|
|
|
|
fileIo.copyFile("qrc:///js/bignumber.min.js", deploymentDir + "bignumber.min.js"); |
|
|
|