12
12
13
13
const inputFileName = './contracts/contracts/Abab.sol' ;
14
14
const pragma = '^0.4.11' ;
15
+ const ContractName = 'Abab' ;
15
16
const account_address = '0xa1b1d9551211755165a677c5e9d4b1041f4b5fd6' ;
16
17
const account_private = 'df03891cdfb422bf856717211fb09733962e8feff9e7284e1304e1b1f2d55082' ;
17
18
@@ -27,6 +28,7 @@ const Tx = require('ethereumjs-tx');
27
28
28
29
const fs = require ( 'fs' ) ;
29
30
const path = require ( 'path' ) ;
31
+ const shelljs = require ( 'shelljs' ) ;
30
32
var solc = require ( 'solc' ) ;
31
33
var argv = require ( 'minimist' ) ( process . argv . slice ( 2 ) ) ;
32
34
const importFile = [ ] ;
@@ -110,7 +112,7 @@ function deploy(source, cb) {
110
112
console . log ( 'Tx check.' ) ;
111
113
return false ;
112
114
}
113
- cb && cb ( txData , output . contracts [ ':Abab' ] . interface , output . contracts [ ':Abab' ] . bytecode , source , solcSnapshot . version ( ) ) ;
115
+ cb && cb ( txData , output . contracts [ ':Abab' ] . interface , output . contracts [ ':Abab' ] . bytecode , source , solcSnapshot . version ( ) ) ;
114
116
clearInterval ( checkTx ) ;
115
117
116
118
@@ -119,19 +121,20 @@ function deploy(source, cb) {
119
121
} ) ;
120
122
} ) ;
121
123
}
122
- deploy ( source , function ( tx , _interface , _bytecode , source , solc_version ) {
124
+ deploy ( source , function ( tx , _interface , _bytecode , source , solc_version ) {
123
125
console . log ( 'Updating config.sol.js and source.sol ....' ) ;
124
126
fs . writeFileSync ( "./source.sol" , source ) ;
125
127
fs . writeFileSync ( "./config.sol.js" , 'const _address = "' + tx . contractAddress + '"; // smart contract address\n' +
126
128
'const _contract_fixed = 100000000;\n' +
127
- 'const _name = "Abab ";\n' +
129
+ 'const _name = "' + ContractName + ' ";\n' +
128
130
'const _symbol = "ABC";\n' +
129
131
'const _abi = ' + _interface + ';\n' +
130
132
'const _bytecode = "' + _bytecode + '";\n' +
131
133
'const _version = "' + solc_version + '";\n' +
132
134
'module.exports = {_address: _address,_contract_fixed: _contract_fixed,_name: _name,_symbol: _symbol,_abi: _abi,_bytecode:_bytecode,_version:_version};' ) ;
133
135
console . log ( 'Deploy Contract Success:\n\tAddress: ' + tx . contractAddress + '\n\tBlockHash: ' + tx . blockHash + '\n\tblockNumber: ' + tx . blockNumber ) ;
134
136
console . log ( '== END ==' ) ;
137
+
135
138
process . exit ( 0 ) ;
136
139
} ) ;
137
140
// console.log(output.contracts[':Abab'].bytecode);
0 commit comments