UNPKG

@tokenz/tokens-smartcontract-sdk

Version:
851 lines (771 loc) 3.87 MB
(function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){ 'use strict' const SDK = require('./lib/index') window.TokenzSDK = SDK; },{"./lib/index":17}],2:[function(require,module,exports){ 'use strict' const web3 = window.web3; const w3 = require('web3'); const fixedContract = [ "macContract" , "ruleEngine" , "kycRegis" , "STOFactory" , "STOIssuance" , "STODivFactory" ]; const contracts = require('./contracts/index'); /** * A Web3 Interface Class. * @class WEb3interface */ class Core { constructor(contractName , address ) { if( typeof(window.ethereum) !== "undefined" && (typeof(window.web3) !== "undefined")){ this.Web3 = window.web3; this.contract = {}; this.contractName = contractName; this.contracts = contracts; this.w3 = new w3(); if( fixedContract.indexOf(contractName) !== -1){ this.contractObject = new this.Web3.eth.contract(this.contracts[contractName].abi).at(this.contracts[contractName].networks[window.ethereum.networkVersion].address); }else{ this.contractObject = new this.Web3.eth.contract(this.contracts[contractName].abi).at(address); } } } async getData( method , args ){ return new Promise(async function (resolve, reject) { try{ console.log(this.contractObject[method] , this , this.contractObject[method]) let data = await this.contractObject[method].getData.apply(null, args) resolve(data); }catch(err){ reject(err); } }.bind(this)) } async callData( method , args ){ return new Promise(async function ( resolve , reject ) { try{ let data = await this.getData( method , args ); let abi = await this.fetchAbiBlock( method ); this.Web3.eth.call({ to : this.contractObject.address, data : data },async function (err,result) { if(err) throw err; let res = this.w3.eth.abi.decodeParameters(abi.outputs,result); resolve(res); }.bind(this)) }catch(err){ reject(err); } }.bind(this)) } fetchAbiBlock ( method ){ return new Promise(function (resolve, reject) { try{ let abi = this.contractObject.abi; abi.forEach(function (n) { if( n.name === method ){ resolve(n); } }.bind(this)); }catch(err){ reject(err); } }.bind(this)) } sendTx( method , args , value ){ return new Promise(async function (resolve, reject) { try{ let currentState = this.Web3.currentProvider.publicConfigStore.getState() let data = await this.getData ( method , args ); let txObj = { from : currentState.selectedAddress, to : this.contractObject.address, data : data, value: this.Web3.fromDecimal(value), chainId : currentState.networkVersion } this.Web3.eth.sendTransaction(txObj,function (err,data) { if (err) throw err; resolve(data) }.bind(this)) }catch(err){ reject(err); } }.bind(this)) } } module.exports = Core; },{"./contracts/index":12,"web3":321}],3:[function(require,module,exports){ 'use strict' const coreLib = require('./Core'); class KYC{ constructor(){ this.kycRegis = new coreLib("kycRegis"); this.setup = this.setup.bind(this); this.setup(); this.fetchKYCDetails = this.fetchKYCDetails.bind(this); this.setKYC = this.setKYC.bind(this); this.fetchKYCDetails = this.fetchKYCDetails.bind(this); this.setKYC = this.setKYC.bind(this); this.fetchKYCProvider = this.fetchKYCProvider.bind(this); this.enableServiceProvider = this.enableServiceProvider.bind(this); this.disableSericeProvider = this.disableSericeProvider.bind(this); this.setKYCdetails = this.setKYCdetails.bind(this); this.disableKYC = this.disableKYC.bind(this); this.checkKYCMap = this.checkKYCMap.bind(this); this.fetchKYCStatus = this.fetchKYCStatus.bind(this); } async setup () { return new Promise(async function (resolve, reject) { try { this.macContractAddress = await this.kycRegis.callData("maCAddr", []); this.ruleEngineAddress = await this.kycRegis.callData("ruCAddr", []); this.contractCategory = await this.kycRegis.callData("contractCategory", []); this.contractType = await this.kycRegis.callData("contractType", []); resolve(0); } catch (err) { window.Sentry.captureException(err); console.log(err); reject(0) } }.bind(this)) } async fetchKYCDetails( address ) { return new Promise(async function (resolve, reject) { try { let result = await this.kycRegis.callData( "kycDS", [address]); resolve(result); } catch (err) { window.Sentry.captureException(err); reject(0) } }.bind(this)) } async setKYC() { return new Promise(async function (resolve, reject) { try { let result = await this.kycRegis.sendTx("", []);; resolve(result); } catch (err) { window.Sentry.captureException(err); reject(0) } }.bind(this)) } async fetchKYCProvider( address ) { return new Promise(async function (resolve, reject) { try { let result = await this.kycRegis.callData("kycProvider", [ address ]);; resolve(result); } catch (err) { window.Sentry.captureException(err); reject(0) } }.bind(this)) } async enableServiceProvider( address ) { return new Promise(async function (resolve, reject) { try { let result = await this.kycRegis.sendTx("enableServiceProvider", [ address ]); resolve(result); } catch (err) { window.Sentry.captureException(err); reject(0) } }.bind(this)) } async disableSericeProvider( address ) { return new Promise(async function (resolve, reject) { try { let result = await this.kycRegis.sendTx("disableServiceProvider", [ address ]);; resolve(result); } catch (err) { window.Sentry.captureException(err); reject(0) } }.bind(this)) } async setKYCdetails( address , hash , map , v , r , s) { return new Promise(async function (resolve, reject) { try { let result = await this.kycRegis.sendTx("setKYCdetails", [ address , hash , map , v , r , s ]);; resolve(result); } catch (err) { window.Sentry.captureException(err); reject(0) } }.bind(this)) } async disableKYC ( address ) { return new Promise(async function (resolve, reject) { try { let result = await this.kycRegis.sendTx("disableKYC", [ address ]);; resolve(result); } catch (err) { window.Sentry.captureException(err); reject(0) } }.bind(this)) } async checkKYCMap ( address , perm ) { return new Promise(async function (resolve, reject) { try { let result = await this.kycRegis.callData("isValidKYCMap", [ address , perm ]); resolve(result); } catch (err) { window.Sentry.captureException(err); reject(0) } }.bind(this)) } async fetchKYCStatus ( address ) { return new Promise(async function (resolve, reject) { try { let result = await this.kycRegis.callData("isValidKYC", [address]); resolve(result); } catch (err) { window.Sentry.captureException(err); reject(0) } }.bind(this)) } } module.exports = KYC; },{"./Core":2}],4:[function(require,module,exports){ const coreLib = require('./Core'); class STODividentFactory{ constructor(){ this.STODividentFactory = new coreLib("STODivFactory"); this.setup = this.setup.bind(this); this.setup(); this.fetchDividentCounter = this.fetchDividentCounter.bind(this); this.fetchSTODividentContract = this.fetchSTODividentContract.bind(this); this.initializeDivident = this.initializeDivident.bind(this); } async setup () { return new Promise(async function (resolve, reject) { try { this.macContractAddress = await this.STODividentFactory.callData("maCAddr", []); this.ruleEngineAddress = await this.STODividentFactory.callData("ruCAddr", []); this.contractCategory = await this.STODividentFactory.callData("contractCategory", []); this.contractType = await this.STODividentFactory.callData("contractType", []); this.kycRegisAddress = await this.STODividentFactory.callData("kycAddr", []); this.stoFactoryAddress = await this.STODividentFactory.callData("stfAddr", []); resolve(0); } catch (err) { window.Sentry.captureException(err); console.log(err); reject(0) } }.bind(this)) } async fetchDividentCounter( stoAddress ) { return new Promise(async function (resolve, reject) { try { let result = await this.STODividentFactory.callData("divCtr", [ stoAddress]); resolve(result); } catch (err) { window.Sentry.captureException(err); reject(0) } }.bind(this)) } async fetchSTODividentContract( stoAddress ) { return new Promise(async function (resolve, reject) { try { let result = await this.STODividentFactory.callData("stoDiv", [ stoAddress ]); resolve(result); } catch (err) { window.Sentry.captureException(err); reject(0) } }.bind(this)) } async initializeDivident( stoAddress ) { return new Promise(async function (resolve, reject) { try { let result = await this.STODividentFactory.sendTx("initializeDivident", [ stoAddress ] ,0 ); resolve(result); } catch (err) { window.Sentry.captureException(err); reject(0) } }.bind(this)) } } module.exports = STODividentFactory; },{"./Core":2}],5:[function(require,module,exports){ const coreLib = require('./Core'); class STOFactory{ constructor(){ this.STOFactory = new coreLib("STOFactory"); this.setup = this.setup.bind(this); this.setup(); this.fetchSTOCreationRate = this.fetchSTOCreationRate.bind(this); this.fetchSTOCounter = this.fetchSTOCounter.bind(this); this.fetchSTOCollection = this.fetchSTOCollection.bind(this); this.fetchSTODetails = this.fetchSTODetails.bind(this); this.fetchSTOInverse = this.fetchSTOInverse.bind(this); this.setSTOCreationRate = this.setSTOCreationRate.bind(this); this.withdraw = this.withdraw.bind(this); this.createSTO = this.createSTO.bind(this); this.updateSTO = this.updateSTO.bind(this); this.finalizeSTO = this.finalizeSTO.bind(this); this.unfinalizeSTO = this.unfinalizeSTO.bind(this); } async setup () { return new Promise(async function (resolve, reject) { try { this.macContractAddress = await this.STOFactory.callData("maCAddr", []); this.ruleEngineAddress = await this.STOFactory.callData("ruCAddr", []); this.contractCategory = await this.STOFactory.callData("contractCategory", []); this.contractType = await this.STOFactory.callData("contractType", []); this.kycRegisAddress = await this.STOFactory.callData("kycAddr", []); resolve(0); } catch (err) { window.Sentry.captureException(err); console.log(err); reject(0) } }.bind(this)) } async fetchSTOCreationRate() { return new Promise(async function (resolve, reject) { try { let result = await this.STOFactory.callData("creationRate", []);; resolve(result); } catch (err) { window.Sentry.captureException(err); reject(0) } }.bind(this)) } async fetchSTOCounter() { return new Promise(async function (resolve, reject) { try { let result = await this.STOFactory.callData("stoCtr", []);; resolve(result); } catch (err) { window.Sentry.captureException(err); reject(0) } }.bind(this)) } async fetchSTOCollection() { return new Promise(async function (resolve, reject) { try { let result = await this.STOFactory.callData("collectedValue", []);; resolve(result); } catch (err) { window.Sentry.captureException(err); reject(0) } }.bind(this)) } async fetchSTODetails( address ) { return new Promise(async function (resolve, reject) { try { let result = await this.STOFactory.callData("sto", [ address ]);; resolve(result); } catch (err) { window.Sentry.captureException(err); reject(0) } }.bind(this)) } async fetchSTOInverse( ctr ) { return new Promise(async function (resolve, reject) { try { let result = await this.STOFactory.callData("stoInverse", [ ctr ]);; resolve(result); } catch (err) { window.Sentry.captureException(err); reject(0) } }.bind(this)) } async setSTOCreationRate ( rate ) { return new Promise(async function (resolve, reject) { try { let result = await this.STOFactory.sendTx("changeRate", [ rate ]);; resolve(result); } catch (err) { window.Sentry.captureException(err); reject(0) } }.bind(this)) } async withdraw( amt ) { return new Promise(async function (resolve, reject) { try { let result = await this.STOFactory.sendTx("withdrawBase", [ amt ]);; resolve(result); } catch (err) { window.Sentry.captureException(err); reject(0) } }.bind(this)) } async createSTO ( name , description , symbol , locale , value ) { return new Promise(async function (resolve, reject) { try { let result = await this.STOFactory.sendTx("createSTO", [ name , description , symbol , locale ] , value );; resolve(result); } catch (err) { window.Sentry.captureException(err); reject(0) } }.bind(this)) } async updateSTO( address , name , description , symbol , locale ) { return new Promise(async function (resolve, reject) { try { let result = await this.STOFactory.sendTx("updateDetails", [ address , name , description , symbol , locale ]);; resolve(result); } catch (err) { window.Sentry.captureException(err); reject(0) } }.bind(this)) } async finalizeSTO ( address ) { return new Promise(async function (resolve, reject) { try { let result = await this.STOFactory.sendTx("finalise", [ address ]);; resolve(result); } catch (err) { window.Sentry.captureException(err); reject(0) } }.bind(this)) } async unfinalizeSTO( address ) { return new Promise(async function (resolve, reject) { try { let result = await this.STOFactory.sendTx("unfinalise", [ address ]);; resolve(result); } catch (err) { window.Sentry.captureException(err); reject(0) } }.bind(this)) } async fetchOwner( address ) { return new Promise(async function (resolve, reject) { try { let result = await this.STOFactory.callData("fetchOwner", [ address ]);; resolve(result); } catch (err) { window.Sentry.captureException(err); reject(0) } }.bind(this)) } async fetchState( address ) { return new Promise(async function (resolve, reject) { try { let result = await this.STOFactory.callData("fetchState", [ address ]);; resolve(result); } catch (err) { window.Sentry.captureException(err); reject(0) } }.bind(this)) } } module.exports = STOFactory; },{"./Core":2}],6:[function(require,module,exports){ const coreLib = require('./Core'); class STOIssuance{ constructor(){ this.STOIssuance = new coreLib("STOIssuance"); this.setup = this.setup.bind(this); this.setup(); this.calculateT1 = this.calculateT1.bind(this); this.calculateT2 = this.calculateT2.bind(this); } async setup () { return new Promise(async function (resolve, reject) { try { this.macContractAddress = await this.STOIssuance.callData("maCAddr", []); this.ruleEngineAddress = await this.STOIssuance.callData("ruCAddr", []); this.contractCategory = await this.STOIssuance.callData("contractCategory", []); this.contractType = await this.STOIssuance.callData("contractType", []); this.kycRegisAddress = await this.STOIssuance.callData("kycAddr", []); this.stoFactoryAddress = await this.STOIssuance.callData("STOFAddr", []); resolve(0); } catch (err) { window.Sentry.captureException(err); console.log(err); reject(0) } }.bind(this)) } async calculateT1( baseRate , ceilingRate , baseQty , ceilingQty , actualQty ) { return new Promise(async function (resolve, reject) { try { let result = await this.STOIssuance.callData("calculateT1", [ baseRate , ceilingRate , baseQty , ceilingQty , actualQty ]);; resolve(result); } catch (err) { window.Sentry.captureException(err); reject(0) } }.bind(this)) } async calculateT2( baseRate , ceilingRate , baseQty , ceilingQty , actualQty ) { return new Promise(async function (resolve, reject) { try { let result = await this.STOIssuance.callData("calculateT1", [ baseRate , ceilingRate , baseQty , ceilingQty , actualQty ]);; resolve(result); } catch (err) { window.Sentry.captureException(err); reject(0) } }.bind(this)) } async fetchSTORates( address) { return new Promise(async function (resolve, reject) { try { let result = await this.STOIssuance.callData("STOIssue", [ address ]);; resolve(result); } catch (err) { window.Sentry.captureException(err); reject(0) } }.bind(this)) } async fetchSTOCollection( address ) { return new Promise(async function (resolve, reject) { try { let result = await this.STOIssuance.callData("STOCollection", [ address ]);; resolve(result); } catch (err) { window.Sentry.captureException(err); reject(0) } }.bind(this)) } async setupIssuance ( address , stoType , stoGraphType , baseRate , ceilingRate , baseQty , ceilingQty , startTime , endTime ) { return new Promise(async function (resolve, reject) { try { let result = await this.STOIssuance.callData("", [ address , stoType , stoGraphType , baseRate , ceilingRate , baseQty , ceilingQty , startTime , endTime ]);; resolve(result); } catch (err) { window.Sentry.captureException(err); reject(0) } }.bind(this)) } async updateIssuance( address , stoType , stoGraphType , baseRate , ceilingRate , baseQty , ceilingQty , startTime , endTime ) { return new Promise(async function (resolve, reject) { try { let result = await this.STOIssuance.callData("", [ address , stoType , stoGraphType , baseRate , ceilingRate , baseQty , ceilingQty , startTime , endTime ]);; resolve(result); } catch (err) { window.Sentry.captureException(err); reject(0) } }.bind(this)) } async participate( address , value ) { return new Promise(async function (resolve, reject) { try { let result = await this.STOIssuance.sendTx("mint", [ address ] , value ); resolve(result); } catch (err) { window.Sentry.captureException(err); reject(0) } }.bind(this)) } async burn( stoAddress , address , amt ) { return new Promise(async function (resolve, reject) { try { let result = await this.STOIssuance.sendTx("burn", [ stoAddress , address , amt ]); resolve(result); } catch (err) { window.Sentry.captureException(err); reject(0) } }.bind(this)) } async withdraw ( address , amt ) { return new Promise(async function (resolve, reject) { try { let result = await this.STOIssuance.sendTx("withdraw", [ address , amt ]); resolve(result); } catch (err) { window.Sentry.captureException(err); reject(0) } }.bind(this)) } } module.exports = STOIssuance; },{"./Core":2}],7:[function(require,module,exports){ module.exports={ "contractName": "STODivFactory", "abi": [ { "constant": true, "inputs": [ { "name": "", "type": "address" } ], "name": "divCtr", "outputs": [ { "name": "", "type": "uint256" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "maCAddr", "outputs": [ { "name": "", "type": "address" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "stfAddr", "outputs": [ { "name": "", "type": "address" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "contractCategory", "outputs": [ { "name": "", "type": "bytes8" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [ { "name": "", "type": "address" }, { "name": "", "type": "uint256" } ], "name": "stoDiv", "outputs": [ { "name": "", "type": "address" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "kycAddr", "outputs": [ { "name": "", "type": "address" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "ruCAddr", "outputs": [ { "name": "", "type": "address" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "contractType", "outputs": [ { "name": "", "type": "bytes8" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "inputs": [ { "name": "_maCAddr", "type": "address" }, { "name": "_ruCAddr", "type": "address" }, { "name": "_kyc", "type": "address" }, { "name": "_stf", "type": "address" } ], "payable": false, "stateMutability": "nonpayable", "type": "constructor" }, { "constant": false, "inputs": [ { "name": "_addr", "type": "address" } ], "name": "initializeDivident", "outputs": [], "payable": false, "stateMutability": "nonpayable", "type": "function" } ], "bytecode": "0x608060405234801561001057600080fd5b50604051608080613042833981018060405281019080805190602001909291908051906020019092919080519060200190929190805190602001909291905050506100a48484600178010000000000000000000000000000000000000000000000000260057801000000000000000000000000000000000000000000000000026101b1640100000000026401000000009004565b81600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555080600660006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555081600860006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555080600960006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050505050610330565b83600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555082600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555083600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555082600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550816000806101000a81548167ffffffffffffffff021916908378010000000000000000000000000000000000000000000000009004021790555080600060086101000a81548167ffffffffffffffff021916908378010000000000000000000000000000000000000000000000009004021790555050505050565b612d038061033f6000396000f300608060405260043610610099576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806309c288261461009e5780632864faea146100f55780632894516e1461014c5780635721ddae146101a35780637381ea03146101e65780639d800fbc14610247578063aba3a7f9146102d4578063c34b59eb1461032b578063cb2ef6f714610382575b600080fd5b3480156100aa57600080fd5b506100df600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506103e3565b6040518082815260200191505060405180910390f35b34801561010157600080fd5b5061010a6103fb565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561015857600080fd5b50610161610421565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156101af57600080fd5b506101e4600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610447565b005b3480156101f257600080fd5b506101fb610a03565b604051808277ffffffffffffffffffffffffffffffffffffffffffffffff191677ffffffffffffffffffffffffffffffffffffffffffffffff1916815260200191505060405180910390f35b34801561025357600080fd5b50610292600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610a2d565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156102e057600080fd5b506102e9610a6f565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561033757600080fd5b50610340610a95565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561038e57600080fd5b50610397610abb565b604051808277ffffffffffffffffffffffffffffffffffffffffffffffff191677ffffffffffffffffffffffffffffffffffffffffffffffff1916815260200191505060405180910390f35b600a6020528060005260406000206000915090505481565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b803373ffffffffffffffffffffffffffffffffffffffff16600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663b4799e01836040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b15801561051c57600080fd5b505af1158015610530573d6000803e3d6000fd5b505050506040513d602081101561054657600080fd5b810190808051906020019092919050505073ffffffffffffffffffffffffffffffffffffffff1614151561057957600080fd5b8160011515600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663bf08bca6836040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b15801561063b57600080fd5b505af115801561064f573d6000803e3d6000fd5b505050506040513d602081101561066557600080fd5b8101908080519060200190929190505050151514151561068457600080fd5b6106d76001600a60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610ae690919063ffffffff16565b600a60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16866107af610b70565b808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200195505050505050604051809103906000f0801580156108cd573d6000803e3d6000fd5b50600760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600b60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000600a60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550505050565b6000809054906101000a900478010000000000000000000000000000000000000000000000000281565b600b6020528160005260406000206020528060005260406000206000915091509054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600060089054906101000a900478010000000000000000000000000000000000000000000000000281565b6000808284019050838110151515610b66576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b6040516121568062000b82833901905600608060405234801561001057600080fd5b5060405160a0806200215683398101806040528101908080519060200190929190805190602001909291908051906020019092919080519060200190929190805190602001909291905050506100af858560017801000000000000000000000000000000000000000000000000026004780100000000000000000000000000000000000000000000000002610328640100000000026401000000009004565b82600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555081600660006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555082600860006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555081600960006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555080600a60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166318160ddd6040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b1580156102dd57600080fd5b505af11580156102f1573d6000803e3d6000fd5b505050506040513d602081101561030757600080fd5b8101908080519060200190929190505050600b8190555050505050506104a7565b83600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555082600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555083600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555082600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550816000806101000a81548167ffffffffffffffff021916908378010000000000000000000000000000000000000000000000009004021790555080600060086101000a81548167ffffffffffffffff021916908378010000000000000000000000000000000000000000000000009004021790555050505050565b611c9f80620004b76000396000f3006080604052600436106100fc576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680632864faea146101015780632894516e146101585780632e1a7d4d146101af578063391f98fe146101f45780634bb278f31461024b5780635683d9df1461027a5780636873da30146102a55780637381ea03146103235780637705831b14610384578063aba3a7f9146103db578063b1e5db4014610432578063b81b86301461045d578063be040fb0146104d1578063be183957146104f3578063c19d93fb1461051e578063c34b59eb1461054d578063cb2ef6f7146105a4578063d0e30db014610605575b600080fd5b34801561010d57600080fd5b50610116610627565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561016457600080fd5b5061016d61064d565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156101bb57600080fd5b506101da60048036038101908080359060200190929190505050610673565b604051808215151515815260200191505060405180910390f35b34801561020057600080fd5b50610209610b3f565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561025757600080fd5b50610260610b65565b604051808215151515815260200191505060405180910390f35b34801561028657600080fd5b5061028f610e0b565b6040518082815260200191505060405180910390f35b3480156102b157600080fd5b5061030960048036038101908080359060200190820180359060200190808060200260200160405190810160405280939291908181526020018383602002808284378201915050505050509192919290505050610e11565b604051808215151515815260200191505060405180910390f35b34801561032f57600080fd5b506103386112a5565b604051808277ffffffffffffffffffffffffffffffffffffffffffffffff191677ffffffffffffffffffffffffffffffffffffffffffffffff1916815260200191505060405180910390f35b34801561039057600080fd5b506103c5600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506112cf565b6040518082815260200191505060405180910390f35b3480156103e757600080fd5b506103f0611343565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561043e57600080fd5b50610447611369565b6040518082815260200191505060405180910390f35b34801561046957600080fd5b5061049e600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061136f565b60405180858152602001848152602001831515151581526020018215151515815260200194505050505060405180910390f35b6104d96113b9565b604051808215151515815260200191505060405180910390f35b3480156104ff57600080fd5b506105086116e6565b6040518082815260200191505060405180910390f35b34801561052a57600080fd5b506105336116ec565b604051808215151515815260200191505060405180910390f35b34801561055957600080fd5b506105626116ff565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156105b057600080fd5b506105b9611725565b604051808277ffffffffffffffffffffffffffffffffffffffffffffffff191677ffffffffffffffffffffffffffffffffffffffffffffffff1916815260200191505060405180910390f35b61060d611750565b604051808215151515815260200191505060405180910390f35b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008060011515600d60009054906101000a900460ff16151514151561069857600080fd5b7fc26f22db83dc51cea1eb7fe4efcae8c4b4ad5e40c296b9de77cfd16ae68caa94600102600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663635912d5600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166382f6f815336040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b1580156107b757600080fd5b505af11580156107cb573d6000803e3d6000fd5b505050506040513d60208110156107e157600080fd5b8101908080519060200190929190505050600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166305ad1456856040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808260001916600019168152602001915050602060405180830381600087803b15801561088b57600080fd5b505af115801561089f573d6000803e3d6000fd5b505050506040513d60208110156108b557600080fd5b81019080805190602001909291905050506040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808377ffffffffffffffffffffffffffffffffffffffffffffffff191677ffffffffffffffffffffffffffffffffffffffffffffffff191681526020018277ffffffffffffffffffffffffffffffffffffffffffffffff191677ffffffffffffffffffffffffffffffffffffffffffffffff1916815260200192505050602060405180830381600087803b15801561098b57600080fd5b505af115801561099f573d6000803e3d6000fd5b505050506040513d60208110156109b557600080fd5b810190808051906020019092919050505015156109d157600080fd5b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663b4799e01600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b158015610ab057600080fd5b505af1158015610ac4573d6000803e3d6000fd5b505050506040513d6020811015610ada57600080fd5b810190808051906020019092919050505091508173ffffffffffffffffffffffffffffffffffffffff166108fc859081150290604051600060405180830381858888f19350505050158015610b33573d6000803e3d6000fd5b50600192505050919050565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000801515600d60009054906101000a900460ff161515141515610b8857600080fd5b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1660011515600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663bf08bca6836040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b158015610c6c57600080fd5b505af1158015610c80573d6000803e3d6000fd5b505050506040513d6020811015610c9657600080fd5b81019080805190602001909291905050501515141515610cb557600080fd5b333373ffffffffffffffffffffffffffffffffffffffff16600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663b4799e01836040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b158015610d8a57600080fd5b505af1158015610d9e573d6000803e3d6000fd5b505050506040513d6020811015610db457600080fd5b810190808051906020019092919050505073ffffffffffffffffffffffffffffffffffffffff16141515610de757600080fd5b6001600d60006101000a81548160ff02191690831515021790555060019250505090565b600b5481565b6000806000801515600d60009054906101000a900460ff161515141515610e3757600080fd5b333373ffffffffffffffffffffffffffffffffffffffff16600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663b4799e01836040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b158015610f0c57600080fd5b505af1158015610f20573d6000803e3d6000fd5b505050506040513d6020811015610f3657600080fd5b810190808051906020019092919050505073ffffffffffffffffffffffffffffffffffffffff16141515610f6957600080fd5b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1660011515600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663bf08bca6836040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b15801561104d57600080fd5b505af1158015611061573d6000803e3d6000fd5b505050506040513d602081101561107757600080fd5b8101908080519060200190929190505050151514151561109657600080fd5b600093505b855184101561129857600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a0823187868151811015156110f057fe5b906020019060200201516040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b15801561117857600080fd5b505af115801561118c573d6000803e3d6000fd5b505050506040513d60208110156111a257600080fd5b810190808051906020019092919050505092506080604051908101604052808481526020016000815260200160011515815260200160001515815250600c600088878151811015156111f057fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082015181600001556020820151816001015560408201518160020160006101000a81548160ff02191690831515021790555060608201518160020160016101000a81548160ff021916908315150217905550905050838060010194505061109b565b6001945050505050919050565b6000809054906101000a900478010000000000000000000000000000000000000000000000000281565b600061133c600b5461132e600e54600c60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001546119ff90919063ffffffff16565b611acc90919063ffffffff16565b9050919050565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600e5481565b600c6020528060005260406000206000915090508060000154908060010154908060020160009054906101000a900460ff16908060020160019054906101000a900460ff16905084565b60008060011515600d60009054906101000a900460ff1615151415156113de57600080fd5b3360001515600c60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020160019054906101000a900460ff161515148015611495575060011515600c60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020160009054906101000a900460ff161515145b15156114a057600080fd5b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1660011515600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663bf08bca6836040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b15801561158457600080fd5b505af1158015611598573d6000803e3d6000fd5b505050506040513d60208110156115ae57600080fd5b810190808051906020019092919050505015151415156115cd57600080fd5b6115d6336112cf565b92506115ed83600f54611b5f90919063ffffffff16565b600f8190555082600c60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600101819055506001600c60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020160016101000a81548160ff0219169083151502179055503373ffffffffffffffffffffffffffffffffffffffff166108fc849081150290604051600060405180830381858888f193505050501580156116db573d6000803e3d6000fd5b506001935050505090565b600f5481565b600d60009054906101000a900460ff1681565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600060089054906101000a900478010000000000000000000000000000000000000000000000000281565b6000801515600d60009054906101000a900460ff16151514151561177357600080fd5b333373ffffffffffffffffffffffffffffffffffffffff16600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663b4799e01836040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b15801561184857600080fd5b505af115801561185c573d6000803e3d6000fd5b505050506040513d602081101561187257600080fd5b810190808051906020019092919050505073ffffffffffffffffffffffffffffffffffffffff161415156118a557600080fd5b600a60009054906101000a900473fffffffffffffffffffffffffffff