就是操作记录一下
smabi = ‘[{“constant”:false,”inputs”:[{“name”:”_to”,”type”:”address”},{“name”:”_value”,”type”:”uint256″}],”name”:”transfer”,”outputs”:[],”payable”:false,”stateMutability”:”nonpayable”,”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”},{“inputs”:[{“name”:”_supply”,”type”:”uint256″},{“name”:”_name”,”type”:”string”},{“name”:”_symbol”,”type”:”string”},{“name”:”_decimals”,”type”:”uint8″}],”payable”:false,”stateMutability”:”nonpayable”,”type”:”constructor”},{“constant”:true,”inputs”:[{“name”:””,”type”:”address”}],”name”:”balanceOf”,”outputs”:[{“name”:””,”type”:”uint256″}],”payable”:false,”stateMutability”:”view”,”type”:”function”},{“constant”:true,”inputs”:[],”name”:”decimals”,”outputs”:[{“name”:””,”type”:”uint8″}],”payable”:false,”stateMutability”:”view”,”type”:”function”},{“constant”:true,”inputs”:[],”name”:”name”,”outputs”:[{“name”:””,”type”:”string”}],”payable”:false,”stateMutability”:”view”,”type”:”function”},{“constant”:true,”inputs”:[],”name”:”symbol”,”outputs”:[{“name”:””,”type”:”string”}],”payable”:false,”stateMutability”:”view”,”type”:”function”}]’
smtokenbin = ‘0x6060604052341561000f57600080fd5b60405161075f38038061075f83398101604052808051906020019091908051820191906020018051820191906020018051906020019091905050600084141561005957620f424093505b83600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555082600090805190602001906100b39291906100ef565b5081600190805190602001906100ca9291906100ef565b5080600260006101000a81548160ff021916908360ff16021790555050505050610194565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061013057805160ff191683800117855561015e565b8280016001018555821561015e579182015b8281111561015d578251825591602001919060010190610142565b5b50905061016b919061016f565b5090565b61019191905b8082111561018d576000816000905550600101610175565b5090565b90565b6105bc806101a36000396000f30060606040526004361061006d576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde0314610072578063313ce5671461010057806370a082311461012f57806395d89b411461017c578063a9059cbb1461020a575b600080fd5b341561007d57600080fd5b61008561024c565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100c55780820151818401526020810190506100aa565b50505050905090810190601f1680156100f25780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561010b57600080fd5b6101136102ea565b604051808260ff1660ff16815260200191505060405180910390f35b341561013a57600080fd5b610166600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506102fd565b6040518082815260200191505060405180910390f35b341561018757600080fd5b61018f610315565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101cf5780820151818401526020810190506101b4565b50505050905090810190601f1680156101fc5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561021557600080fd5b61024a600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506103b3565b005b60008054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156102e25780601f106102b7576101008083540402835291602001916102e2565b820191906000526020600020905b8154815290600101906020018083116102c557829003601f168201915b505050505081565b600260009054906101000a900460ff1681565b60036020528060005260406000206000915090505481565b60018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156103ab5780601f10610380576101008083540402835291602001916103ab565b820191906000526020600020905b81548152906001019060200180831161038e57829003601f168201915b505050505081565b80600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410156103ff5761058c565b600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205481600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205401101561048c5761058c565b80600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254039250508190555080600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055508173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35b50505600a165627a7a723058207ea76ab99250fe19577b78ce99399a7dd2377b86c5db4ff3395d528766b179650029’
contract = web3.eth.contract(JSON.parse(smabi));
initializer = {from:user2,data:smtokenbin,gas:600000}
eth.getBlock(“pending”).gasLimit
web3.eth.estimateGas({data:smtokenbin})
token3 = contract.new(1000000000000000000000000000,”ShanMaoLaLa Token”,”SML”,18,initializer)
以上等待发币完成
以下查询余额和转账
smb = web3.eth.contract(JSON.parse(smabi)).at(‘0xe841f3fb87e57c73c599a4c74197ae2120abbc51’)
smb.balanceOf(‘0x6a6ff28cc8ae641cd7fd60bd23afda9c8b89c5b3’)
smb.transfer(‘0xdc3f961b733eee8a370977d9854f64d86121ac31′,10000000,{from:’0x6a6ff28cc8ae641cd7fd60bd23afda9c8b89c5b3’})