Skip to content

Commit f7f5992

Browse files
committed
[node] Add commontoken contract support
1 parent a7b6abe commit f7f5992

3 files changed

Lines changed: 92 additions & 0 deletions

File tree

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
{
2+
"types": [],
3+
"structs": [{
4+
"name": "CreateTokenReq",
5+
"base": "",
6+
"fields": {
7+
"tokenType": "bytes",
8+
"maxSupply": "uint64"
9+
}
10+
},
11+
{
12+
"name": "IssueTokenReq",
13+
"base": "",
14+
"fields": {
15+
"tokenType": "bytes",
16+
"targetAccount": "bytes",
17+
"issueAmount": "uint64"
18+
}
19+
},
20+
{
21+
"name": "TransferReq",
22+
"base": "",
23+
"fields": {
24+
"from": "bytes",
25+
"to": "bytes",
26+
"tokenType": "bytes",
27+
"value": "uint64"
28+
}
29+
},
30+
{
31+
"name": "TransferCredit",
32+
"base": "",
33+
"fields": {
34+
"name": "bytes",
35+
"spender": "bytes",
36+
"tokenType": "bytes",
37+
"value" : "uint64"
38+
}
39+
},
40+
{
41+
"name": "CancelCredit",
42+
"base": "",
43+
"fields": {
44+
"name": "bytes",
45+
"spender": "bytes",
46+
"tokenType": "bytes"
47+
}
48+
},
49+
{
50+
"name": "TransferFromParam4XTO",
51+
"base": "",
52+
"fields": {
53+
"from": "bytes",
54+
"to": "bytes",
55+
"tokenType": "bytes",
56+
"value": "uint64"
57+
}
58+
}
59+
],
60+
"actions": [{
61+
"name": "create",
62+
"type": "CreateTokenReq"
63+
},
64+
{
65+
"name": "issue",
66+
"type": "IssueTokenReq"
67+
},
68+
{
69+
"name": "transfer",
70+
"type": "TransferReq"
71+
},{
72+
"name": "grandcredit",
73+
"type": "TransferCredit"
74+
},{
75+
"name": "deletecredit",
76+
"type": "CancelCredit"
77+
},{
78+
"name": "from",
79+
"type": "TransferFromParam4XTO"
80+
}
81+
],
82+
"tables": []
83+
}
2.91 KB
Binary file not shown.

service/node/scripts/startup.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -344,6 +344,15 @@ function startcontract()
344344
cp -rf ~/mnt/bottos/src/github.com/bottos-project/magiccube/service/node/config/*.wasm $CORE_PROC_FILE_DIR/contract/ 2>/dev/null
345345
cp -rf ~/mnt/bottos/src/github.com/bottos-project/magiccube/service/node/config/*.abi $CORE_PROC_FILE_DIR/contract/ 2>/dev/null
346346

347+
echo
348+
echo -e "${BLUE}######## Deploy Contract commontoken ########${NC}"
349+
echo
350+
${CORE_PROC_FILE_DIR}/./bcli newaccount -name commontoken -pubkey 0454f1c2223d553aa6ee53ea1ccea8b7bf78b8ca99f3ff622a3bb3e62dedc712089033d6091d77296547bc071022ca2838c9e86dec29667cf740e5c9e654b6127f &
351+
sleep 3
352+
${CORE_PROC_FILE_DIR}/./bcli deploycode -contract commontoken -wasm $CORE_PROC_FILE_DIR/contract/usermng.wasm &
353+
sleep 3
354+
${CORE_PROC_FILE_DIR}/./bcli deployabi -contract commontoken -abi $CORE_PROC_FILE_DIR/contract/usermng.abi &
355+
sleep 5
347356
echo
348357
echo -e "${BLUE}######## Deploy Contract usermng ########${NC}"
349358
echo

0 commit comments

Comments
 (0)