1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
| # 注意这个 0x 要手动加上去 var code = '0x6060604052341561000f57600080fd5b336000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061038a8061005e6000396000f30060606040526004361061006d576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306661abd14610072578063771602f71461009b5780638da5cb5b146100db578063a87d942c14610130578063e752be4e14610159575b600080fd5b341561007d57600080fd5b610085610199565b6040518082815260200191505060405180910390f35b34156100a657600080fd5b6100c5600480803590602001909190803590602001909190505061019f565b6040518082815260200191505060405180910390f35b34156100e657600080fd5b6100ee61027d565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561013b57600080fd5b6101436102a2565b6040518082815260200191505060405180910390f35b341561016457600080fd5b6101836004808035906020019091908035906020019091905050610351565b6040518082815260200191505060405180910390f35b60015481565b6000806001600081548092919060010191905055506101be8484610351565b90506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167fbcc141744793f7e93083ceb1e4a61664d4a6428dadf6db4d2e8b1a162d0582b233868685604051808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200184815260200183815260200182815260200194505050505060405180910390a28091505092915050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167fd54b813e36aaac7612686fa27ef81917785024960e408194ccaeb6b17926cecc33600154604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a2600154905090565b60008183019050929150505600a165627a7a72305820d297e7e10c1b3d3f05cad089467287d5315e1957fe323040bcdea71f4eed65ad0029'; var abi = [{"constant":true,"inputs":[],"name":"count","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"a","type":"uint256"},{"name":"b","type":"uint256"}],"name":"add","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"owner","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"getCount","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"a","type":"uint256"},{"name":"b","type":"uint256"}],"name":"realAdd","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"pure","type":"function"},{"inputs":[],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"name":"from","type":"address"},{"indexed":false,"name":"transactionSender","type":"address"},{"indexed":false,"name":"a","type":"uint256"},{"indexed":false,"name":"b","type":"uint256"},{"indexed":false,"name":"result","type":"uint256"}],"name":"AddEvent","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"from","type":"address"},{"indexed":false,"name":"transactionSender","type":"address"},{"indexed":false,"name":"result","type":"uint256"}],"name":"CountEvent","type":"event"}]; myContract = eth.contract(abi) contract = myContract.new({from:eth.accounts[0],data:code,gas:1000000})#部署 INFO [09-12|08:05:19] Submitted contract creation fullhash=0x0a7dfa9cac7ef836a72ed1d5bbfa65c0220347cde4efb067a0b03b15fb70bce1 contract=0x7cbe4019e993f9922b8233502d94890099ee59e6 { abi: [{ constant: false, inputs: [{...}, {...}], name: "multiply", outputs: [{...}], payable: false, stateMutability: "nonpayable", type: "function" }], address: undefined, transactionHash: "0x0a7dfa9cac7ef836a72ed1d5bbfa65c0220347cde4efb067a0b03b15fb70bce1" }
|