-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathcreateToken.js
More file actions
68 lines (66 loc) · 1.69 KB
/
createToken.js
File metadata and controls
68 lines (66 loc) · 1.69 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
var Web3 = require('web3');
if (typeof web3 !== 'undefined') {
web3 = new Web3(web3.currentProvider);
} else {
// set the provider you want from Web3.providers
web3 = new Web3(new Web3.providers.HttpProvider("http://localhost:7545"));
}
web3.eth.defaultAccount = web3.eth.accounts[0];
//console.log(AbiAddress);
//var DeployerContract = web3.eth.contract(AbiAddress.deployer_abi);
var DeployerContract = web3.eth.contract([
{
"constant": true,
"inputs": [
{
"name": "",
"type": "uint256"
}
],
"name": "cores",
"outputs": [
{
"name": "",
"type": "address"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": false,
"inputs": [
{
"name": "name",
"type": "string"
},
{
"name": "symbol",
"type": "string"
}
],
"name": "createCore",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "constructor"
}
]);
var Deployer = DeployerContract.at('0xc0ed63e3a70bfcb003452b1cc083db822e1f23e1');
// console.log(Deployer);
console.log(Deployer.createCore)
Deployer.createCore("Drama","Ghd", {from: web3.eth.accounts[0]}).then((err, result) => {
if(err){
console.log(err);
}else {
console.log(result);
}
})
//console.log(Deployer.cores[0]);