1.首先部署合约,这是eos映射合约地址(0xd0a6E6C54DbC68Db5db3A091B171A77407Ff7ccf),当真正公有链上替换成这个(0xd0a6E6C54DbC68Db5db3A091B171A77407Ff7ccf)
var abi = [{"constant":true,"inputs":[{"name":"","type":"uint256"},{"name":"","type":"address"}],"name":"claimed","outputs":[{"name":"","type":"bool"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"owner_","type":"address"}],"name":"setOwner","outputs":[],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"time","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"totalSupply","outputs":[{"name":"","type":"uint128"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"foundersAllocation","outputs":[{"name":"","type":"uint128"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"day","type":"uint256"}],"name":"claim","outputs":[],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"foundersKey","outputs":[{"name":"","type":"string"}],"payable":false,"type":"function"},{"constant":true,"inputs":[{"name":"","type":"uint256"},{"name":"","type":"address"}],"name":"userBuys","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":true,"inputs":[{"name":"day","type":"uint256"}],"name":"createOnDay","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":false,"inputs":[],"name":"freeze","outputs":[],"payable":false,"type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"keys","outputs":[{"name":"","type":"string"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"startTime","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"authority_","type":"address"}],"name":"setAuthority","outputs":[],"payable":false,"type":"function"},{"constant":true,"inputs":[{"name":"","type":"uint256"}],"name":"dailyTotals","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"owner","outputs":[{"name":"","type":"address"}],"payable":false,"type":"function"},{"constant":false,"inputs":[],"name":"buy","outputs":[],"payable":true,"type":"function"},{"constant":true,"inputs":[],"name":"openTime","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"EOS","outputs":[{"name":"","type":"address"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"today","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"authority","outputs":[{"name":"","type":"address"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"eos","type":"address"}],"name":"initialize","outputs":[],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"createFirstDay","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":false,"inputs":[],"name":"claimAll","outputs":[],"payable":false,"type":"function"},{"constant":true,"inputs":[{"name":"timestamp","type":"uint256"}],"name":"dayFor","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"day","type":"uint256"},{"name":"limit","type":"uint256"}],"name":"buyWithLimit","outputs":[],"payable":true,"type":"function"},{"constant":false,"inputs":[],"name":"collect","outputs":[],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"numberOfDays","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"key","type":"string"}],"name":"register","outputs":[],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"createPerDay","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"inputs":[{"name":"_numberOfDays","type":"uint256"},{"name":"_totalSupply","type":"uint128"},{"name":"_openTime","type":"uint256"},{"name":"_startTime","type":"uint256"},{"name":"_foundersAllocation","type":"uint128"},{"name":"_foundersKey","type":"string"}],"payable":false,"type":"constructor"},{"payable":true,"type":"fallback"},{"anonymous":false,"inputs":[{"indexed":false,"name":"window","type":"uint256"},{"indexed":false,"name":"user","type":"address"},{"indexed":false,"name":"amount","type":"uint256"}],"name":"LogBuy","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"window","type":"uint256"},{"indexed":false,"name":"user","type":"address"},{"indexed":false,"name":"amount","type":"uint256"}],"name":"LogClaim","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"user","type":"address"},{"indexed":false,"name":"key","type":"string"}],"name":"LogRegister","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"amount","type":"uint256"}],"name":"LogCollect","type":"event"},{"anonymous":false,"inputs":[],"name":"LogFreeze","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"authority","type":"address"}],"name":"LogSetAuthority","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"owner","type":"address"}],"name":"LogSetOwner","type":"event"}]; //部署合约 var tokenContract = web3.eth.contract(abi); var myContractCode = '0x606060405234156200000d57fe5b6040516200268238038062002682833981016040528080519060200190919080519060200190919080519060200190919080519060200190919080519060200190919080518201919050505b5b33600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055503373ffffffffffffffffffffffffffffffffffffffff167fce241d7ca1f669fee44b6fc00b8eba2df3bb514eed0f6f668f8f89096e81ed9460405180905060405180910390a25b8560088190555084600360006101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff160217905550836005819055508260078190555081600360106101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff1602179055508060049080519060200190620001819291906200049e565b50620001c8600360009054906101000a90046fffffffffffffffffffffffffffffffff166702c68af0bb1400006200037f6401000000000262001e13176401000000009004565b6fffffffffffffffffffffffffffffffff16600681905550620002a26200028562000268600360009054906101000a90046fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff16600360109054906101000a90046fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff16620004306401000000000262001eac176401000000009004565b600654620004306401000000000262001eac176401000000009004565b6008546200044b64010000000002620020e2176401000000009004565b600981905550620002cc600060085411620004636401000000000262001d49176401000000009004565b6200034d600360109054906101000a90046fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff16600360009054906101000a90046fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff1611620004636401000000000262001d49176401000000009004565b6200037260075460055410620004636401000000000262001d49176401000000009004565b5b5050505050506200054d565b600062000427670de0b6b3a76400006fffffffffffffffffffffffffffffffff166002670de0b6b3a76400006fffffffffffffffffffffffffffffffff16811515620003c757fe5b046fffffffffffffffffffffffffffffffff16846fffffffffffffffffffffffffffffffff16866fffffffffffffffffffffffffffffffff1602018115156200040c57fe5b04620004756401000000000262001d5a176401000000009004565b90505b92915050565b600082828403915081111515156200044457fe5b5b92915050565b600081838115156200045957fe5b0490505b92915050565b801515620004715760006000fd5b5b50565b600081829150816fffffffffffffffffffffffffffffffff161415156200049857fe5b5b919050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10620004e157805160ff191683800117855562000512565b8280016001018555821562000512579182015b8281111562000511578251825591602001919060010190620004f4565b5b50905062000521919062000525565b5090565b6200054a91905b80821115620005465760008160009055506001016200052c565b5090565b90565b612125806200055d6000396000f30060606040523615610173576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168063120aa8771461018457806313af4035146101db57806316ada5471461021157806318160ddd146102375780631db580fa14610281578063379607f5146102cb578063389ae4d1146102eb5780633904e1bf146103845780635ca81139146103d757806362a5af3b1461040b578063670d14b21461041d57806378e97925146104da5780637a9e5e4b146105005780637d34f5ac146105365780638da5cb5b1461056a578063a6f2ae3a146105bc578063b4256888146105c6578063b6834572146105ec578063b74e452b1461063e578063bf7e214f14610664578063c4d66de8146106b6578063cfae52e1146106ec578063d1058e5914610712578063d90c175914610724578063e0cb3aa014610758578063e522538114610779578063e9f6bd0b1461078b578063f2c298be146107b1578063f96512cc1461080b575b6101825b61017f610831565b5b565b005b341561018c57fe5b6101c1600480803590602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610846565b604051808215151515815260200191505060405180910390f35b34156101e357fe5b61020f600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610875565b005b341561021957fe5b610221610959565b6040518082815260200191505060405180910390f35b341561023f57fe5b610247610962565b60405180826fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561028957fe5b610291610984565b60405180826fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156102d357fe5b6102e960048080359060200190919050506109a6565b005b34156102f357fe5b6102fb610ce4565b604051808060200182810382528381815181526020019150805190602001908083836000831461034a575b80518252602083111561034a57602082019150602081019050602083039250610326565b505050905090810190601f1680156103765780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561038c57fe5b6103c1600480803590602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610d82565b6040518082815260200191505060405180910390f35b34156103df57fe5b6103f56004808035906020019091905050610da7565b6040518082815260200191505060405180910390f35b341561041357fe5b61041b610dc5565b005b341561042557fe5b610451600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610ea4565b60405180806020018281038252838181518152602001915080519060200190808383600083146104a0575b8051825260208311156104a05760208201915060208101905060208303925061047c565b505050905090810190601f1680156104cc5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156104e257fe5b6104ea610f54565b6040518082815260200191505060405180910390f35b341561050857fe5b610534600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610f5a565b005b341561053e57fe5b610554600480803590602001909190505061103e565b6040518082815260200191505060405180910390f35b341561057257fe5b61057a611056565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6105c4610831565b005b34156105ce57fe5b6105d661107c565b6040518082815260200191505060405180910390f35b34156105f457fe5b6105fc611082565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561064657fe5b61064e6110a8565b6040518082815260200191505060405180910390f35b341561066c57fe5b6106746110c0565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156106be57fe5b6106ea600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506110e6565b005b34156106f457fe5b6106fc6116d5565b6040518082815260200191505060405180910390f35b341561071a57fe5b6107226116db565b005b341561072c57fe5b610742600480803590602001909190505061170c565b6040518082815260200191505060405180910390f35b6107776004808035906020019091908035906020019091905050611744565b005b341561078157fe5b6107896118c3565b005b341561079357fe5b61079b61197f565b6040518082815260200191505060405180910390f35b34156107b957fe5b610809600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050611985565b005b341561081357fe5b61081b611ae1565b6040518082815260200191505060405180910390f35b61084361083c6110a8565b6000611744565b5b565b600c6020528160005260406000206020528060005260406000206000915091509054906101000a900460ff1681565b6108ab6108a6336000357fffffffff0000000000000000000000000000000000000000000000000000000016611ae7565b611d49565b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167fce241d7ca1f669fee44b6fc00b8eba2df3bb514eed0f6f668f8f89096e81ed9460405180905060405180910390a25b5b50565b60004290505b90565b600360009054906101000a90046fffffffffffffffffffffffffffffffff1681565b600360109054906101000a90046fffffffffffffffffffffffffffffffff1681565b60006000600060006109c0856109ba6110a8565b11611d49565b600c600086815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680610a3c57506000600a600087815260200190815260200160002054145b15610a4657610cdd565b610a62600a600087815260200190815260200160002054611d5a565b9350610abd600b600087815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d5a565b9250610ad9610ad3610ace87610da7565b611d5a565b85611d82565b9150610ae58284611e13565b90506001600c600087815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16633452f51d33836000604051602001526040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001826fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff16815260200192505050602060405180830381600087803b1515610c3e57fe5b6102c65a03f11515610c4c57fe5b50505060405180519050507f51223fdc0a25891366fb358b4af9fe3c381b1566e287c61a29d01c8a173fe4f4853383604051808481526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001826fffffffffffffffffffffffffffffffff168152602001935050505060405180910390a15b5050505050565b60048054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610d7a5780601f10610d4f57610100808354040283529160200191610d7a565b820191906000526020600020905b815481529060010190602001808311610d5d57829003601f168201915b505050505081565b600b602052816000526040600020602052806000526040600020600091509150505481565b600060008214610db957600954610dbd565b6006545b90505b919050565b610ddc600160085401610dd66110a8565b11611d49565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166307da68f56040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401809050600060405180830381600087803b1515610e6157fe5b6102c65a03f11515610e6f57fe5b5050507fad487f3c412409f5b36d6b5ae6f3bb9c34e15234b3e9f101bb6ef0d584593c6160405180905060405180910390a15b565b600d6020528060005260406000206000915090508054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610f4c5780601f10610f2157610100808354040283529160200191610f4c565b820191906000526020600020905b815481529060010190602001808311610f2f57829003601f168201915b505050505081565b60075481565b610f90610f8b336000357fffffffff0000000000000000000000000000000000000000000000000000000016611ae7565b611d49565b80600060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f1abebea81bfa2637f28358c371278fb15ede7ea8dd28d2e03b112ff6d936ada460405180905060405180910390a25b5b50565b600a6020528060005260406000206000915090505481565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60055481565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60006110ba6110b5610959565b61170c565b90505b90565b600060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b61111c611117336000357fffffffff0000000000000000000000000000000000000000000000000000000016611ae7565b611d49565b611176600073ffffffffffffffffffffffffffffffffffffffff16600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611d49565b6112303073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16638da5cb5b6000604051602001526040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401809050602060405180830381600087803b15156111fc57fe5b6102c65a03f1151561120a57fe5b5050506040518051905073ffffffffffffffffffffffffffffffffffffffff1614611d49565b6112eb600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1663bf7e214f6000604051602001526040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401809050602060405180830381600087803b15156112b757fe5b6102c65a03f115156112c557fe5b5050506040518051905073ffffffffffffffffffffffffffffffffffffffff1614611d49565b61137a60008273ffffffffffffffffffffffffffffffffffffffff166318160ddd6000604051602001526040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401809050602060405180830381600087803b151561135c57fe5b6102c65a03f1151561136a57fe5b5050506040518051905014611d49565b80600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166369d3e20e600360009054906101000a90046fffffffffffffffffffffffffffffffff166040518263ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040180826fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff168152602001915050600060405180830381600087803b151561148a57fe5b6102c65a03f1151561149857fe5b505050600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16633452f51d60b1600360109054906101000a90046fffffffffffffffffffffffffffffffff166000604051602001526040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff168152602001826fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff16815260200192505050602060405180830381600087803b151561159257fe5b6102c65a03f115156115a057fe5b50505060405180519050506004600d600060b173ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002090805460018160011615610100020316600290046115f6929190611fa2565b507fd80364ba2cbb1e827ab8adac9651cdfc27fb7b61c0a95663cb80b82d7636ad2260b16004604051808373ffffffffffffffffffffffffffffffffffffffff168152602001806020018281038252838181546001816001161561010002031660029004815260200191508054600181600116156101000203166002900480156116c15780601f10611696576101008083540402835291602001916116c1565b820191906000526020600020905b8154815290600101906020018083116116a457829003601f168201915b5050935050505060405180910390a15b5b50565b60065481565b6000600090505b6116ea6110a8565b811015611708576116fa816109a6565b5b80806001019150506116e2565b5b50565b600060075482106117395760016201437061172984600754611eac565b81151561173257fe5b040161173c565b60005b90505b919050565b61176e600554611752610959565b1015801561176957506008546117666110a8565b11155b611d49565b611781662386f26fc10000341015611d49565b61179461178c6110a8565b831015611d49565b6117a2600854831115611d49565b34600b600084815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254019250508190555034600a60008481526020019081526020016000206000828254019250508190555060008114151561184b5761184a81600a6000858152602001908152602001600020541115611d49565b5b7fe054057d0479c6218d6ec87be73f88230a7e4e1f064cee6e7504e2c4cd9d6150823334604051808481526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001828152602001935050505060405180910390a15b5050565b6118f96118f4336000357fffffffff0000000000000000000000000000000000000000000000000000000016611ae7565b611d49565b61190c60006119066110a8565b11611d49565b61192d333073ffffffffffffffffffffffffffffffffffffffff1631611ec6565b7f4ceba015d961d93f1d6825703b730a8ba05619c005dfd8073aee773dc6725fbb3073ffffffffffffffffffffffffffffffffffffffff16316040518082815260200191505060405180910390a15b5b565b60085481565b61199d6001600854016119966110a8565b1115611d49565b6119ab604082511115611d49565b80600d60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002090805190602001906119fe929190612029565b507fd80364ba2cbb1e827ab8adac9651cdfc27fb7b61c0a95663cb80b82d7636ad223382604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200180602001828103825283818151815260200191508051906020019080838360008314611aa3575b805182526020831115611aa357602082019150602081019050602083039250611a7f565b505050905090810190601f168015611acf5780820380516001836020036101000a031916815260200191505b50935050505060405180910390a15b50565b60095481565b60003073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611b265760019050611d43565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611b855760019050611d43565b600073ffffffffffffffffffffffffffffffffffffffff16600060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415611be55760009050611d43565b600060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663b70096138430856000604051602001526040518463ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191681526020019350505050602060405180830381600087803b1515611d2157fe5b6102c65a03f11515611d2f57fe5b505050604051805190509050611d43565b5b5b5b92915050565b801515611d565760006000fd5b5b50565b600081829150816fffffffffffffffffffffffffffffffff16141515611d7c57fe5b5b919050565b6000611e0a826fffffffffffffffffffffffffffffffff166002846fffffffffffffffffffffffffffffffff16811515611db857fe5b046fffffffffffffffffffffffffffffffff16670de0b6b3a76400006fffffffffffffffffffffffffffffffff16866fffffffffffffffffffffffffffffffff160201811515611e0457fe5b04611d5a565b90505b92915050565b6000611ea3670de0b6b3a76400006fffffffffffffffffffffffffffffffff166002670de0b6b3a76400006fffffffffffffffffffffffffffffffff16811515611e5957fe5b046fffffffffffffffffffffffffffffffff16846fffffffffffffffffffffffffffffffff16866fffffffffffffffffffffffffffffffff160201811515611e9d57fe5b04611d5a565b90505b92915050565b60008282840391508111151515611ebf57fe5b5b92915050565b611ece6120a9565b611ed9838284611edf565b5b505050565b611eea838383611efc565b1515611ef65760006000fd5b5b505050565b60008373ffffffffffffffffffffffffffffffffffffffff16828460405180828051906020019080838360008314611f53575b805182526020831115611f5357602082019150602081019050602083039250611f2f565b505050905090810190601f168015611f7f5780820380516001836020036101000a031916815260200191505b5091505060006040518083038185876187965a03f19250505090505b9392505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10611fdb5780548555612018565b8280016001018555821561201857600052602060002091601f016020900482015b82811115612017578254825591600101919060010190611ffc565b5b50905061202591906120bd565b5090565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061206a57805160ff1916838001178555612098565b82800160010185558215612098579182015b8281111561209757825182559160200191906001019061207c565b5b5090506120a591906120bd565b5090565b602060405190810160405280600081525090565b6120df91905b808211156120db5760008160009055506001016120c3565b5090565b90565b600081838115156120ef57fe5b0490505b929150505600a165627a7a723058201fe2e7b57da9c285767eb5350b4a1706caa7601d6a539191fae0ab14fce0141e0029000000000000000000000000000000000000000000000000000000000000015e0000000000000000000000000000000000000000033b2e3c9fd0803ce800000000000000000000000000000000000000000000000000000000000000595105500000000000000000000000000000000000000000000000000000000059579cd000000000000000000000000000000000000000000052b7d2dcc80cd2e400000000000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000006a3435346635333335363337353661346534383437346435393561356133323734363734323739373934653435353536313666353034633436363835613536366434373538363235613633333934323463346136353531366234623561343637313437353934353639353100000000000000000000000000000000000000000000';
var myContractInstance = tokenContract.new( {data: myContractCode, gas: 9000000, from: '0x01DA1C5xxxxxxxxxxx63c4F'}); |
2.通过myContractInstance返回的hash,使用web3.eth.getTransaction()查出合约地址
3.加载合约
var contract = web3.eth.contract(abi).at(你在第二步查询到的合约地址) |
4.进行用户解锁
|
5.解锁成功后,去注册eos私钥(https://www.oheth.com/eosgenerate/)
var str = 'EOS53bg738gyNrKz5XicvJke7xph5t51Tys5dQw7i43MrTj941bAq'; |
6.调用合约中的方法register
|
7.对数据进行签名发送交易,这是验证数据是合法,是当前人提交的
|
8.由于矿工时间问题,交易不一定成功,多种原因,如果成功,调用该方法,是能看到你
刚才注册的eos公共地址
contract.keys('0xC9130B8xxxxxxxx8826Cb87cb36dFe6F5a3') |
9.写的技术点,不是很完全,大家多多指正,更加交流