版权声明:忠于祖国,忠于人民 https://blog.csdn.net/boss2967/article/details/86252486
工作日志 2019-01-10
1. 工作计划
- 封装函数
- 修改bug
2. 遇到问题
- web3连接repson测试网络
- 思路错误
3. 编写代码
const Web3 = require("web3");
const solc = require('solc');
const fs = require("fs");
const Koa = require('koa');
const router = require('koa-router')();
const bodyParser = require('koa-bodyparser');
const render = require('koa-art-template');
const path = require('path');
const views = require('koa-views');
const HDWalletProvider = require('truffle-hdwallet-provider');
const walletConfig = require('./walletConfig.json');
const Tx = require('ethereumjs-tx');
//init
const app = new Koa();
var web3 = new Web3();
//
var Contract_Token;
/**Read me
* 1.简称(Token=>T,Drop=>D,TokenMgr=>M)
* 2.Actions_data=>参数初始化(各种初始化参数)
3.Actions_Koa=>Koa框架以及Koa插件初始化和启动配置(Koa相关)
* 4.Actions_Router=>router路由的get方法,post方法配置
* 5.Actions_initWeb3Provider=>web3js相关初始化参数(web3,合约实例等)
* 6.Actions_Web3jsCommonMethod=>webjs常用的方法(获取各种参数)
* 7.Actions_Web3jsUtils=>web3js相关的工具方法(转换,校验等)
* 8.Actions_Contrant_Token=>skt测试代币的相关方法的实现(Token)
* 9.Actions_Contrant_Drop=> 空投合约的相关方法的实现(Drop)
*10.Actions_Contrant_TokenMgr=>项目之前空投合约的相关方法的实现(TokenMgr)
*11.Actions_Configure=>项目相关配置信息()
*12.Json_list=>常量信息的相关管理(abi,合约地址,gas参数,等)
*13.Json_Bz=>其它备注信息(追加,扩展)
*/
var Actions_data = {
Type_init:()=>{
}
}
var Actions_Koa = {
render: () => {
render(app, {
root: path.join(__dirname, '../views'), // 视图的位置
extname: '.html', // 后缀名
debug: process.env.NODE_ENV !== 'production' //是否开启调试模式
})
},
user: () => {
app.use(views('../views', {
extension: 'ejs'
}));
app.use(bodyParser());
app.use(router.routes());
app.use(router.allowedMethods());
app.use(bodyParser());
app.listen(3003, () => {
console.log("start at port 3003");
});
}
}
var Actions_Router = {
router_get: () => {
router.get('/', (ctx, next) => {
// TODO:
ctx.body = "测试路由111";
});
//
router.get('/Token/T_transferFrom', (ctx, next) => {
// TODO:
ctx.body = "T_transferFrom";
console.log('ctx=>11112222');
// TODO:校验数据
// let data = ctx.params;
// let from = data.from;
// let to = data.to;
// let value= data.value;
let sFrom = Json_list.ADDRESS_TOKEN;
console.log("sFrom=>",sFrom);
let sTo = Json_list.USE_ADDRESS.User_2;
console.log("sTo=>",sTo);
let sValue =7;
console.log("sValue=>",sValue);
// if (qs.hash) {
// console.log('/withdraw info: ', qs.hash);
// qs = JSON.parse(qs.hash);
// }
// if (lastWid && qs.wid === lastWid) return;
// lastWid = qs.wid;
// T_transferFrom: (from, to, value)
// 查询方法
let result = Actions_Contrant_Token.T_transferFrom({
from: sFrom,
to: sTo,
value:sValue
});
//return
return result;
});
router.get('/Token/T_transfer', (ctx, next) => {
// TODO:
ctx.body = "T_transfer";
});
router.get('/Token/T_approve', (ctx, next) => {
// TODO:
ctx.body = "T_approve";
});
router.get('/Token/T_allowance', (ctx, next) => {
// TODO:
ctx.body = "T_allowance";
});
router.get('/Drop/D_setToken', (ctx, next) => {
// TODO:
ctx.body = "D_setToken";
});
router.get('/Drop/D_multiSendandself', (ctx, next) => {
// TODO:
ctx.body = "D_multiSendandself";
});
router.get('/Drop/D_multiSend', (ctx, next) => {
// TODO:
ctx.body = "D_multiSend";
});
router.get('/Drop/D_multiSend2', (ctx, next) => {
// TODO:
ctx.body = "D_multiSend2";
});
router.get('/Drop/D_multiself', (ctx, next) => {
// TODO:
ctx.body = "D_multiself";
});
router.get('/Drop/D_settrustOwner', (ctx, next) => {
// TODO:
ctx.body = "D_settrustOwner";
});
router.get('/Drop/D_seterctypeName', (ctx, next) => {
// TODO:
ctx.body = "D_seterctypeName";
});
router.get('/Drop/D_sethistoricalOwner', (ctx, next) => {
// TODO:
ctx.body = "D_sethistoricalOwner";
});
router.get('/Drop/D_transfer', (ctx, next) => {
// TODO:
ctx.body = "D_transfer";
});
router.get('/Drop/D_approve', (ctx, next) => {
// TODO:
ctx.body = "D_approve";
});
router.get('/Drop/D_transferFrom', (ctx, next) => {
// TODO:
ctx.body = "D_transferFrom";
});
router.get('/Drop/D_balanceOf', (ctx, next) => {
// TODO:
ctx.body = "D_balanceOf";
});
//
router.get('/Drop/M_prepare', (ctx, next) => {
// TODO:
ctx.body = "M_prepare";
});
router.get('/Drop/M_flyDrop', (ctx, next) => {
// TODO:
ctx.body = "M_flyDrop";
});
},
router_post: () => {
router.post('/', (ctx, next) => {
// TODO:
ctx.body = "测试路由111";
});
//
router.post('/Token/T_transferFrom', (ctx, next) => {
// TODO:
ctx.body = "T_transferFrom";
});
router.post('/Token/T_transfer', (ctx, next) => {
// TODO:
ctx.body = "T_transfer";
});
router.post('/Token/T_approve', (ctx, next) => {
// TODO:
ctx.body = "T_approve";
});
router.post('/Token/T_allowance', (ctx, next) => {
// TODO:
ctx.body = "T_allowance";
});
router.post('/Drop/D_setToken', (ctx, next) => {
// TODO:
ctx.body = "D_setToken";
});
router.post('/Drop/D_multiSendandself', (ctx, next) => {
// TODO:
ctx.body = "D_multiSendandself";
});
router.post('/Drop/D_multiSend', (ctx, next) => {
// TODO:
ctx.body = "D_multiSend";
});
router.post('/Drop/D_multiSend2', (ctx, next) => {
// TODO:
ctx.body = "D_multiSend2";
});
router.post('/Drop/D_multiself', (ctx, next) => {
// TODO:
ctx.body = "D_multiself";
});
router.post('/Drop/D_settrustOwner', (ctx, next) => {
// TODO:
ctx.body = "D_settrustOwner";
});
router.post('/Drop/D_seterctypeName', (ctx, next) => {
// TODO:
ctx.body = "D_seterctypeName";
});
router.post('/Drop/D_sethistoricalOwner', (ctx, next) => {
// TODO:
ctx.body = "D_sethistoricalOwner";
});
router.post('/Drop/D_transfer', (ctx, next) => {
// TODO:
ctx.body = "D_transfer";
});
router.post('/Drop/D_approve', (ctx, next) => {
// TODO:
ctx.body = "D_approve";
});
router.post('/Drop/D_transferFrom', (ctx, next) => {
// TODO:
ctx.body = "D_transferFrom";
});
router.post('/Drop/D_balanceOf', (ctx, next) => {
// TODO:
ctx.body = "D_balanceOf";
});
//
router.post('/Drop/M_prepare', (ctx, next) => {
// TODO:
ctx.body = "M_prepare";
});
router.post('/Drop/M_flyDrop', (ctx, next) => {
// TODO:
ctx.body = "M_flyDrop";
});
}
}
var Actions_initWeb3Provider = {
initWeb3: () => {
//创建一个web3实例,设置一个provider,成功引入后,就可以用web3的api
if (typeof web3 == 'undefined') {
web3 = new Web3(web3.currentProvider); //新建web3对象
console.log("web undefined");
} else {
// TODO:
web3 = new Web3(new Web3.providers.HttpProvider("https://ropsten.infura.io/v3/ee23e77aa14846d88eb5cad3d59e37f2"));
} //设置一个provider
// TODO:
console.log("web3实例化完成=>");
console.log("web3.currentProvider=>",web3.currentProvider);
console.log("web3是否连接成功=>",web3.isConnected());
console.log("默认账户",web3.eth.defaultAccount);
console.log("默认区块",web3.eth.defaultBlock);
// web3.eth.defaultAccount = "";
web3.eth.defaultAccount='0x38a8DC14edE1DEf9C437bB3647445eEec06fF105';
console.log("默认账户",web3.eth.defaultAccount);
},
initContract_Token: () => {
// TODO:
let Abi_Token = Json_list.ABI_TOKEN;
let Address_Token = Json_list.ADDRESS_TOKEN;
//Token 实例化
Contract_Token = web3.eth.contract(Abi_Token).at(Address_Token);
// TODO:
console.log("Token合约实例完成=>");
},
initContract_drop: () => {
// TODO:
let Abi_drop = "";
let Address_drop = "";
//drop 实例化
var Contract_drop = web_TokenMgr.eth.constant(Abi_drop).at(Address_drop);
},
initContract_TokenMgr: () => {
// TODO:
let Abi_TokenMgr = "";
let Address_TokenMgr = "";
//TokenMgr 实例化
var Contract_drop = web3.eth.constant(Abi_TokenMgr).at(Address_TokenMgr);
}
}
var Actions_Web3jsCommonMethod = {
web_api: () => {
// TODO:
},
web_node: () => {
// TODO:
},
web3_isConnected: () => {
// TODO:
},
web3_currentProvider: () => {
// TODO:
}
}
var Actions_Web3jsUtils = {
web_api: () => {
// TODO:
},
web_node: () => {
// TODO:
},
web3_isConnected: () => {
// TODO:
},
//工具函数@预估gas
web3_estimateGas: (address,data) => {
// TODO:
let estimateGas = web3.eth.estimateGas({
to: address,
data: data
});
estimateGas = this.web3.toHex(estimateGas);
return estimateGas;
},
// 工具函数@预估区块高度
web3_getNonce: (address) => {
// TODO:
let nonce = web3.eth.getTransactionCount(address);
return nonce;
},
//工具函数@序列化私钥
web3_bufferPrivateKey: (value) => {
// TODO:
const privateKey = new Buffer(value,'hex');
return privateKey;
},
web3_currentProvider: () => {
// TODO:
}
}
var Actions_Contrant_Token = {
T_transferFrom: (ctx,next) => {
// TODO:
let Tx_gasPrice =web3.toHex('0x3B9ACA00'*1000);// TODO:
// let Tx_value = "0x00";// TODO:
let Tx_address = ctx.from;// TODO:
let Tx_to =ctx.to;
let Tx_value =ctx.value;
let Tx_v = "0x00";
//函数的二进制(函数名+函数参数+合约)
console.log("T_transferFrom => ",ctx);
// let Tx_data_Token = Contract_Token.transferFrom.getData(Tx_address,Tx_to,Tx_value);
Contract_Token.methods.transfer(Tx_address,Tx_value).send({from:'0x38a8DC14edE1DEf9C437bB3647445eEec06fF105'},(err,data)=>{
if(!err){
console.log("methds____________",data);
}
});
//
// console.log("-----",Contract_Token.transferFrom());
// Contract_Token.methods.transferFrom(Tx_address,Tx_to,Tx_value).send({from:'0xaA3A01dBa149B109d5e9090f1ad1f2cEbA1C272a'}, function(error, transactionHash){
// console.log("rs======>",transactionHash);
// });
// Contract_Token.transferFrom(Tx_address,Tx_to,Tx_value).send({from:'0xaA3A01dBa149B109d5e9090f1ad1f2cEbA1C272a'})
// .on('transactionHash', function(hash){
// console.log(hash);
// })
// .on('receipt', function(receipt){
// console.log(receipt);
// })
// .on('confirmation', function(confirmationNumber, receipt){
// console.log(confirmationNumber);
// })
// .on('error', console.error);
//预估gas
// let Tx_estimateGas = Actions_Web3jsUtils.web3_estimateGas(Tx_address,Tx_data_Token);
// var estimateGas = web3.eth.estimateGas({
// to: Tx_address,
// data: Tx_data_Token
// })
// .then(console.log);
let Tx_estimateGas = web3.toHex(6000000);// TODO:
console.log("T_transferFrom预估gas是=>",Tx_estimateGas);
//获取高度
// let Tx_nonce = Actions_Web3jsUtils.web3_getNonce(Tx_to);// TODO:
let Tx_nonce =web3.eth.getTransactionCount(Tx_address);
let Tx_nonce1= web3.toHex(Tx_nonce+1);
console.log("区块高度是:",Tx_nonce1);
//
// let encodeData_param = web3.eth.abi.encodeParameters(
// ['address', 'address', 'address'], [DRCToken_contractAT,
// DRCWalletMgrParams_contractAT.slice(2),
// DRCWalletStorage_contractAT.slice(2)
// ]
// );
// console.log(encodeData_param);
// let encodeData_function = web3.eth.abi.encodeFunctionSignature('initialize(address,address,address)');
// console.log(encodeData_function);
// let encodeData = encodeData_function + encodeData_param.slice(2);
// console.log(encodeData);
//
//拼接rawTx
var rawTx = {
nonce:Tx_nonce1,
gasPrice: Tx_gasPrice,// TODO:
gasLimit: Tx_estimateGas,
to: Tx_address,
value: Tx_v,// TODO:
data: Tx_data_Token
}
//Tx对象
console.log("rawTx=>",rawTx);
let tx = new Tx(rawTx);
//序列化私钥
const privateKey = Actions_Web3jsUtils.web3_bufferPrivateKey(Json_list.PRIVATEKEY.Token_privateKey);
//用私钥给数据签名
tx.sign(privateKey);
//对数据编码
let serializeTx = tx.serialize();
//调用合约函数
let result = web3.eth.sendRawTransaction('0x' + serializeTx.toString('hex'),(err,hash)=>{
if(!err){
console.log(hash);
}else{
console.log("err:1111",err);
}
});
//返回结果
console.log("调用交易返回结果=>",result);
return result;
},
T_transfer: (from, value) => {
// TODO:
var transferData = this.contract.transferFrom.getData(from,to,value);
},
T_balanceOf: (from) => {
// TODO:
},
T_approve: (from, value) => {
// TODO:
},
T_allowance: (owner, spender) => {
// TODO:
}
}
var Actions_Contrant_Drop = {
//设置代币
D_setToken: (address) => {
// TODO:
},
D_multiSendandself: (arr_address, arr_values) => {
// TODO:
},
D_multiSend: (arr_address, arr_values) => {
// TODO:
},
D_multiSend2: (arr_address, arr_values, value) => {
// TODO:
},
//给自己
D_multiself: (owner, value) => {
// TODO:
},
D_settrustOwner: (address, owntext) => {
// TODO:
},
D_seterctypeName: (address, tokenName) => {
// TODO:
},
D_sethistoricalOwner: (address, histext) => {
// TODO:
},
//**********
D_transfer: (address, value) => {
// TODO:
},
D_approve: (address, value) => {
// TODO:
},
D_transferFrom: (from, to, value) => {
// TODO:
},
D_totalSupply: () => {
// TODO:
},
D_balanceOf: (address) => {
// TODO:
}
}
var Actions_Contrant_TokenMgr = {
//
M_prepare: (rand, form, token, value) => {
// TODO:
},
M_flyDrop: (arr_address, arr_values) => {
// TODO:
}
}
var Actions_Configure = {
Abi_Token:{
},
Abi_drop:{
},
Abi_TokenMgr:{
}
}
//二级启动
var Actions_Starting = {
//init web3, 合约对象
init:()=>{
//
Actions_initWeb3Provider.initWeb3();
Actions_initWeb3Provider.initContract_Token();
},
//test 启动
test:()=>{
console.log("log........");
},
log:()=>{
console.log("-");
}
}
//一级启动
var Actions = {
//Action 启动其它函数
init:(data)=>{
Actions_Koa.render();
Actions_Koa.user();
//
Actions_Router.router_get();
Actions_Router.router_post();
//
Actions_Starting.init();
// Actions_Starting.test;
// Actions_initWeb3Provider.initWeb3();
// Actions_initWeb3Provider.initContract_Token();
console.log(data);
}
}
//json文件配置参数
const Json_list = {
ABI_TOKEN:[
{
"constant": false,
"inputs": [
{
"name": "_spender",
"type": "address"
},
{
"name": "_value",
"type": "uint256"
}
],
"name": "approve",
"outputs": [
{
"name": "success",
"type": "bool"
}
],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "totalSupply",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": false,
"inputs": [
{
"name": "_from",
"type": "address"
},
{
"name": "_to",
"type": "address"
},
{
"name": "_value",
"type": "uint256"
}
],
"name": "transferFrom",
"outputs": [
{
"name": "success",
"type": "bool"
}
],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": true,
"inputs": [
{
"name": "_owner",
"type": "address"
}
],
"name": "balanceOf",
"outputs": [
{
"name": "balance",
"type": "uint256"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": false,
"inputs": [
{
"name": "_to",
"type": "address"
},
{
"name": "_value",
"type": "uint256"
}
],
"name": "transfer",
"outputs": [
{
"name": "success",
"type": "bool"
}
],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": true,
"inputs": [
{
"name": "_owner",
"type": "address"
},
{
"name": "_spender",
"type": "address"
}
],
"name": "allowance",
"outputs": [
{
"name": "remaining",
"type": "uint256"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"name": "_from",
"type": "address"
},
{
"indexed": true,
"name": "_to",
"type": "address"
},
{
"indexed": false,
"name": "_value",
"type": "uint256"
}
],
"name": "Transfer",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"name": "_owner",
"type": "address"
},
{
"indexed": true,
"name": "_spender",
"type": "address"
},
{
"indexed": false,
"name": "_value",
"type": "uint256"
}
],
"name": "Approval",
"type": "event"
}
],
ADDRESS_TOKEN: '0xaA3A01dBa149B109d5e9090f1ad1f2cEbA1C272a',
ABI_DROP: [
{
"constant": false,
"inputs": [
{
"name": "spender",
"type": "address"
},
{
"name": "value",
"type": "uint256"
}
],
"name": "approve",
"outputs": [
{
"name": "",
"type": "bool"
}
],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": false,
"inputs": [
{
"name": "_destAddrs",
"type": "address[]"
},
{
"name": "_values",
"type": "uint256[]"
},
{
"name": "_valuesmyself",
"type": "uint256"
}
],
"name": "multiSendandself",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": false,
"inputs": [
{
"name": "_token",
"type": "address"
}
],
"name": "setToken",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "totalSupply",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [
{
"name": "",
"type": "address"
}
],
"name": "historicalOwner",
"outputs": [
{
"name": "",
"type": "string"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": false,
"inputs": [
{
"name": "from",
"type": "address"
},
{
"name": "to",
"type": "address"
},
{
"name": "value",
"type": "uint256"
}
],
"name": "transferFrom",
"outputs": [
{
"name": "",
"type": "bool"
}
],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": true,
"inputs": [
{
"name": "",
"type": "address"
}
],
"name": "snList",
"outputs": [
{
"name": "",
"type": "string"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": false,
"inputs": [
{
"name": "spender",
"type": "address"
},
{
"name": "addedValue",
"type": "uint256"
}
],
"name": "increaseAllowance",
"outputs": [
{
"name": "",
"type": "bool"
}
],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": true,
"inputs": [
{
"name": "",
"type": "address"
}
],
"name": "erctypeName",
"outputs": [
{
"name": "",
"type": "string"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": false,
"inputs": [
{
"name": "_owneraddress",
"type": "address"
}
],
"name": "deltrustOwner",
"outputs": [
{
"name": "",
"type": "bool"
}
],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": true,
"inputs": [
{
"name": "",
"type": "address"
}
],
"name": "trustOwner",
"outputs": [
{
"name": "",
"type": "string"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": false,
"inputs": [
{
"name": "_destAddrs",
"type": "address[]"
},
{
"name": "_values",
"type": "uint256[]"
}
],
"name": "multiSend2",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": false,
"inputs": [
{
"name": "_ownaddress",
"type": "address"
},
{
"name": "_owntext",
"type": "string"
}
],
"name": "settrustOwner",
"outputs": [
{
"name": "",
"type": "bool"
}
],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": true,
"inputs": [
{
"name": "owner",
"type": "address"
}
],
"name": "balanceOf",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [
{
"name": "a",
"type": "string"
}
],
"name": "myself",
"outputs": [
{
"name": "",
"type": "string"
}
],
"payable": false,
"stateMutability": "pure",
"type": "function"
},
{
"constant": true,
"inputs": [
{
"name": "a",
"type": "uint256"
},
{
"name": "b",
"type": "uint256"
}
],
"name": "add",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"payable": false,
"stateMutability": "pure",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "owner",
"outputs": [
{
"name": "",
"type": "address"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": false,
"inputs": [
{
"name": "_tokentype",
"type": "address"
},
{
"name": "_tokenName",
"type": "string"
}
],
"name": "seterctypeName",
"outputs": [
{
"name": "",
"type": "bool"
}
],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": false,
"inputs": [
{
"name": "spender",
"type": "address"
},
{
"name": "subtractedValue",
"type": "uint256"
}
],
"name": "decreaseAllowance",
"outputs": [
{
"name": "",
"type": "bool"
}
],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": false,
"inputs": [
{
"name": "to",
"type": "address"
},
{
"name": "value",
"type": "uint256"
}
],
"name": "transfer",
"outputs": [
{
"name": "",
"type": "bool"
}
],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": false,
"inputs": [
{
"name": "_destAddrs",
"type": "address[]"
},
{
"name": "_values",
"type": "uint256[]"
}
],
"name": "multiSend",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": false,
"inputs": [
{
"name": "_values",
"type": "uint256"
},
{
"name": "addres_owner",
"type": "address"
}
],
"name": "multiself",
"outputs": [
{
"name": "",
"type": "bool"
}
],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": true,
"inputs": [
{
"name": "owner",
"type": "address"
},
{
"name": "spender",
"type": "address"
}
],
"name": "allowance",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": false,
"inputs": [
{
"name": "_hisaddress",
"type": "address"
},
{
"name": "_histext",
"type": "string"
}
],
"name": "sethistoricalOwner",
"outputs": [
{
"name": "",
"type": "bool"
}
],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "constructor"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"name": "from",
"type": "address"
},
{
"indexed": true,
"name": "to",
"type": "address"
},
{
"indexed": false,
"name": "value",
"type": "uint256"
}
],
"name": "Transfer",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"name": "owner",
"type": "address"
},
{
"indexed": true,
"name": "spender",
"type": "address"
},
{
"indexed": false,
"name": "value",
"type": "uint256"
}
],
"name": "Approval",
"type": "event"
}
],
ADDRESS_DROP: '0x7Dc6Dc91178a6fEF2Fa5Bd1de32c5642e6Ae421b',
ABI_TOKENMGR:[],
ADDRESS_TOKENMGR:"",
PRIVATEKEY:{
Token_privateKey:"F9B224ECF9161EEA3A815338FA70EF11F82AC1C5CAB145D264ADC1E110FA0907",
TEST:"123"
},
USE_ADDRESS:{
User_1:"0x38a8DC14edE1DEf9C437bB3647445eEec06fF105",
User_2:"0xd2580AB2EB3313B0972e9e47b05eE4c15320A6D1",
User_3:"0xA9af645Ce31AF413b24a3b913f1a5Bf57A7a1C50",
User_4:"0x3846a0e5e3a93900B5c0F8BA1504e0B55Ca201e5"
}
};
//追加配置
const Json_Bz ={};
//启动
Actions.init("starting........");
4. 明日计划
- 调试bug
- 数据校验
5. 备注
- 今天主要连接测试网络测试