ANSHENG'S BLOG
利用Clef生成以太坊离线签名以及如何发送转账、合约和Token
# clef# web3publishDate · 2021-12-30 / lastEditedTime · 2022-04-06 04:48:00

上篇中我们介绍了一些Clef的使用,这篇文章将通过account_signTransaction api来进行交易签名,通过通过离线创建转账、合约和Token。

环境

  • 运行clef

运行clef的指令如下,参数比较简单,只是为了方便测试

clef --advanced --chainid 3 --http
  • 创建账户

创建两个账户,用于转账测试,下面的指令执行两次

curl <http://localhost:8550> \\ -X POST \\ -H "Content-Type: application/json" \\ --data '{ "id": 0, "jsonrpc": "2.0", "method": "account_new", "params": [] }'

获取刚在创建的账户列表

$ curl <http://localhost:8550> \\ -X POST \\ -H "Content-Type: application/json" \\ --data '{"id": 1, "jsonrpc": "2.0", "method": "account_list"}' {"jsonrpc":"2.0","id":1,"result":["0xfeee984725e719ad207b20d92a661475be96b0d4","0xb8d539092b3360c89b708bed479150e55260dea7"]}
  • 账户充值

在运行clef的时候,指定了参数--chainid 3,也就是运行的Ropsten网络,可以通过下面的一些水龙头领取测试币

我这里领取了1个ETH到0xfeee984725e719ad207b20d92a661475be96b0d4这个地址,也够我们测试了

转账

首先通过调用API生成离线签名

$ curl <http://localhost:8550> \\ -X POST \\ -H "Content-Type: application/json" \\ --data '{ "id": 2, "jsonrpc": "2.0", "method": "account_signTransaction", "params": [ { "from": "0xfeee984725e719ad207b20d92a661475be96b0d4", "to": "0xb8d539092b3360c89b708bed479150e55260dea7", "gas": "0x7918", "gasPrice": "0x77359400", "value": "0x16345785d8a0000", "nonce": "0x0"} ] }' {"jsonrpc":"2.0","id":2,"result":{"raw":"0xf86b80847735940082791894b8d539092b3360c89b708bed479150e55260dea788016345785d8a00008029a0e3d231691f6bf9aeae97b4922585ce2b8ac22ab903c9bd0d61b9a12ad6c013c7a0234d7bd0a9e5ecc7d0708fa24d4a843fec28bc1925642728085235471927ab4c","tx":{"type":"0x0","nonce":"0x0","gasPrice":"0x77359400","maxPriorityFeePerGas":null,"maxFeePerGas":null,"gas":"0x7918","value":"0x16345785d8a0000","input":"0x","v":"0x29","r":"0xe3d231691f6bf9aeae97b4922585ce2b8ac22ab903c9bd0d61b9a12ad6c013c7","s":"0x234d7bd0a9e5ecc7d0708fa24d4a843fec28bc1925642728085235471927ab4c","to":"0xb8d539092b3360c89b708bed479150e55260dea7","hash":"0x42a6f4d71439f1c0a7dbb4276d25a5b482f2d17d0aa8dd44ef09932e99c3ba2d"}}}
  • from

发起转账的地址

  • to

收款地址

  • gas和gasPrice

可以通过查看这个地址,查看Gas PriceGas Limit,Gas Limit=gas

我们上面的参数中设置了gas为31000=7918(16进制)=0x7918gasPrice为2 Gwei=2000000000 Wei=77359400(16进制)=0x77359400,两个很好用的在线工具可以计算ether单位转换进制转换

  • value

此次转账的eth数量,这里的单位设置为wei,需要转换为16进制,我这里设置的是:0.1 ether = 100000000000000000 wei = 16345785d8a0000(16进制) = 0x16345785d8a0000

  • nonce

from地址交易笔数,我们可以通过Python的web3库调用web3.eth.get_transaction_count方法获取nonce数量

# 安装web3 $ pip3 install web3 $ python3 >>> from web3 import Web3 # 我这里使用的infura免费ropsten全节点的API,如果你有自己搭建的geth也可以使用 >>> web3 = Web3(Web3.HTTPProvider("<https://ropsten.infura.io/v3/9aa3d95b3bc440fa88ea12eaa4456161>")) # 测试连通性 >>> web3.isConnected() True # 获取from地址的交易数量 >>> web3.eth.get_transaction_count(Web3.toChecksumAddress("0xfeee984725e719ad207b20d92a661475be96b0d4")) 0 # 这里获取的0,所以我们设置的参数nonce=0x0,如果是1则设置为nonce=0x1

为防止双花,每笔交易中都有一个随机数nonce。对于同一个账户,这个nonce是一个连续递增的整数,每发送1笔交易,nonce值加1。一个以太坊的账号,它发起的第1笔交易的nonce值是0,第2笔交易的nonce值是1,如此类推。使用接口get_transaction_count获取指定账号发起过的交易笔数,可作为下一笔交易的nonce值.

使用返回中的raw字段作为sendRawTransaction的参数将已经签名的交易上链

>>> r = web3.eth.sendRawTransaction("0xf86b80847735940082791894b8d539092b3360c89b708bed479150e55260dea788016345785d8a00008029a0e3d231691f6bf9aeae97b4922585ce2b8ac22ab903c9bd0d61b9a12ad6c013c7a0234d7bd0a9e5ecc7d0708fa24d4a843fec28bc1925642728085235471927ab4c") >>> r HexBytes('0x42a6f4d71439f1c0a7dbb4276d25a5b482f2d17d0aa8dd44ef09932e99c3ba2d')

0x42a6f4d71439f1c0a7dbb4276d25a5b482f2d17d0aa8dd44ef09932e99c3ba2d就是交易ID,可以在浏览器中查询

或者可以使用接口`getTransaction()·获取交易成功后的交易详情

>>> web3.eth.getTransaction("0x42a6f4d71439f1c0a7dbb4276d25a5b482f2d17d0aa8dd44ef09932e99c3ba2d") AttributeDict({'blockHash': HexBytes('0x7d5d6d73d63f2d36c8316cac2227e748385ff3db69e618f600078f5d4be4f541'), 'blockNumber': 11716265, 'from': '0xfeEe984725e719AD207b20d92a661475BE96B0D4', 'gas': 31000, 'gasPrice': 2000000000, 'hash': HexBytes('0x42a6f4d71439f1c0a7dbb4276d25a5b482f2d17d0aa8dd44ef09932e99c3ba2d'), 'input': '0x', 'nonce': 0, 'r': HexBytes('0xe3d231691f6bf9aeae97b4922585ce2b8ac22ab903c9bd0d61b9a12ad6c013c7'), 's': HexBytes('0x234d7bd0a9e5ecc7d0708fa24d4a843fec28bc1925642728085235471927ab4c'), 'to': '0xB8d539092b3360c89b708bed479150e55260dEA7', 'transactionIndex': 5, 'type': '0x0', 'v': 41, 'value': 100000000000000000})

使用接口getTransactionReceipt()获取交易成功后的交易收据

>>> web3.eth.getTransactionReceipt("0x42a6f4d71439f1c0a7dbb4276d25a5b482f2d17d0aa8dd44ef09932e99c3ba2d") AttributeDict({'blockHash': HexBytes('0x7d5d6d73d63f2d36c8316cac2227e748385ff3db69e618f600078f5d4be4f541'), 'blockNumber': 11716265, 'contractAddress': None, 'cumulativeGasUsed': 3257739, 'effectiveGasPrice': 2000000000, 'from': '0xfeEe984725e719AD207b20d92a661475BE96B0D4', 'gasUsed': 21000, 'logs': [], 'logsBloom': HexBytes('0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000'), 'status': 1, 'to': '0xB8d539092b3360c89b708bed479150e55260dEA7', 'transactionHash': HexBytes('0x42a6f4d71439f1c0a7dbb4276d25a5b482f2d17d0aa8dd44ef09932e99c3ba2d'), 'transactionIndex': 5, 'type': '0x0'})

然后再查询fromto两个地址的余额

>>> web3.eth.get_balance(Web3.toChecksumAddress("0xfeee984725e719ad207b20d92a661475be96b0d4")) 899958000000000000 >>> web3.eth.get_balance(Web3.toChecksumAddress("0xb8d539092b3360c89b708bed479150e55260dea7")) 100000000000000000

合约、Token

创建合约或者Token的方式是一样的,只需要把to字段去掉,然后再加一个参数data,把sol文件编译之后的二进制码放进去即可。

  • 测试合约
// Faucet.sol pragma solidity ^0.8.0; import "@openzeppelin/contracts/access/Ownable.sol"; contract Mortal is Ownable { function destroy() public onlyOwner { address payable addr = payable(address(owner())); selfdestruct(addr); } } // contract Faucet is Mortal { contract Faucet is Mortal { // Give out ether to anyone who asks function withdraw(address payable _to, uint _amount) public { // Limit withdrawal amount require(_amount <= 0.1 ether); // Send the amount to the address that requested it _to.transfer(_amount); } // Accept any incoming amount receive() external payable {} }

Bytecode

{ "object": "608060405234801561001057600080fd5b5061002d61002261003260201b60201c565b61003a60201b60201c565b6100fe565b600033905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b61072e8061010d6000396000f3fe60806040526004361061004e5760003560e01c8063715018a61461005a57806383197ef0146100715780638da5cb5b14610088578063f2fde38b146100b3578063f3fef3a3146100dc57610055565b3661005557005b600080fd5b34801561006657600080fd5b5061006f610105565b005b34801561007d57600080fd5b5061008661018d565b005b34801561009457600080fd5b5061009d61022e565b6040516100aa919061057c565b60405180910390f35b3480156100bf57600080fd5b506100da60048036038101906100d591906104ba565b610257565b005b3480156100e857600080fd5b5061010360048036038101906100fe91906104e7565b61034f565b005b61010d6103af565b73ffffffffffffffffffffffffffffffffffffffff1661012b61022e565b73ffffffffffffffffffffffffffffffffffffffff1614610181576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610178906105b7565b60405180910390fd5b61018b60006103b7565b565b6101956103af565b73ffffffffffffffffffffffffffffffffffffffff166101b361022e565b73ffffffffffffffffffffffffffffffffffffffff1614610209576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610200906105b7565b60405180910390fd5b600061021361022e565b90508073ffffffffffffffffffffffffffffffffffffffff16ff5b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b61025f6103af565b73ffffffffffffffffffffffffffffffffffffffff1661027d61022e565b73ffffffffffffffffffffffffffffffffffffffff16146102d3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016102ca906105b7565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610343576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161033a90610597565b60405180910390fd5b61034c816103b7565b50565b67016345785d8a000081111561036457600080fd5b8173ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f193505050501580156103aa573d6000803e3d6000fd5b505050565b600033905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b60008135905061048a816106b3565b92915050565b60008135905061049f816106ca565b92915050565b6000813590506104b4816106e1565b92915050565b6000602082840312156104d0576104cf610636565b5b60006104de8482850161047b565b91505092915050565b600080604083850312156104fe576104fd610636565b5b600061050c85828601610490565b925050602061051d858286016104a5565b9150509250929050565b610530816105e8565b82525050565b60006105436026836105d7565b915061054e8261063b565b604082019050919050565b60006105666020836105d7565b91506105718261068a565b602082019050919050565b60006020820190506105916000830184610527565b92915050565b600060208201905081810360008301526105b081610536565b9050919050565b600060208201905081810360008301526105d081610559565b9050919050565b600082825260208201905092915050565b60006105f38261060c565b9050919050565b60006106058261060c565b9050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600080fd5b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b6106bc816105e8565b81146106c757600080fd5b50565b6106d3816105fa565b81146106de57600080fd5b50565b6106ea8161062c565b81146106f557600080fd5b5056fea2646970667358221220eed47924189fae6f55b23ca92a605fbb0d7daf560f88c796937fe2af65d3543c64736f6c63430008070033" ...... }

创建交易签名

$ curl <http://localhost:8550> \\ -X POST \\ -H "Content-Type: application/json" \\ --data '{ "id": 2, "jsonrpc": "2.0", "method": "account_signTransaction", "params": [ { "from": "0xfeee984725e719ad207b20d92a661475be96b0d4", "gas": "0x7a120", "gasPrice": "0x2540be400", "value": "0x0", "nonce": "0x1", "data": "0x608060405234801561001057600080fd5b5061002d61002261003260201b60201c565b61003a60201b60201c565b6100fe565b600033905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b61072e8061010d6000396000f3fe60806040526004361061004e5760003560e01c8063715018a61461005a57806383197ef0146100715780638da5cb5b14610088578063f2fde38b146100b3578063f3fef3a3146100dc57610055565b3661005557005b600080fd5b34801561006657600080fd5b5061006f610105565b005b34801561007d57600080fd5b5061008661018d565b005b34801561009457600080fd5b5061009d61022e565b6040516100aa919061057c565b60405180910390f35b3480156100bf57600080fd5b506100da60048036038101906100d591906104ba565b610257565b005b3480156100e857600080fd5b5061010360048036038101906100fe91906104e7565b61034f565b005b61010d6103af565b73ffffffffffffffffffffffffffffffffffffffff1661012b61022e565b73ffffffffffffffffffffffffffffffffffffffff1614610181576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610178906105b7565b60405180910390fd5b61018b60006103b7565b565b6101956103af565b73ffffffffffffffffffffffffffffffffffffffff166101b361022e565b73ffffffffffffffffffffffffffffffffffffffff1614610209576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610200906105b7565b60405180910390fd5b600061021361022e565b90508073ffffffffffffffffffffffffffffffffffffffff16ff5b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b61025f6103af565b73ffffffffffffffffffffffffffffffffffffffff1661027d61022e565b73ffffffffffffffffffffffffffffffffffffffff16146102d3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016102ca906105b7565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610343576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161033a90610597565b60405180910390fd5b61034c816103b7565b50565b67016345785d8a000081111561036457600080fd5b8173ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f193505050501580156103aa573d6000803e3d6000fd5b505050565b600033905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b60008135905061048a816106b3565b92915050565b60008135905061049f816106ca565b92915050565b6000813590506104b4816106e1565b92915050565b6000602082840312156104d0576104cf610636565b5b60006104de8482850161047b565b91505092915050565b600080604083850312156104fe576104fd610636565b5b600061050c85828601610490565b925050602061051d858286016104a5565b9150509250929050565b610530816105e8565b82525050565b60006105436026836105d7565b915061054e8261063b565b604082019050919050565b60006105666020836105d7565b91506105718261068a565b602082019050919050565b60006020820190506105916000830184610527565b92915050565b600060208201905081810360008301526105b081610536565b9050919050565b600060208201905081810360008301526105d081610559565b9050919050565b600082825260208201905092915050565b60006105f38261060c565b9050919050565b60006106058261060c565b9050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600080fd5b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b6106bc816105e8565b81146106c757600080fd5b50565b6106d3816105fa565b81146106de57600080fd5b50565b6106ea8161062c565b81146106f557600080fd5b5056fea2646970667358221220eed47924189fae6f55b23ca92a605fbb0d7daf560f88c796937fe2af65d3543c64736f6c63430008070033"} ] }' {"jsonrpc":"2.0","id":2,"result":{"raw":"0xf9088e018502540be4008307a1208080b9083b608060405234801561001057600080fd5b5061002d61002261003260201b60201c565b61003a60201b60201c565b6100fe565b600033905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b61072e8061010d6000396000f3fe60806040526004361061004e5760003560e01c8063715018a61461005a57806383197ef0146100715780638da5cb5b14610088578063f2fde38b146100b3578063f3fef3a3146100dc57610055565b3661005557005b600080fd5b34801561006657600080fd5b5061006f610105565b005b34801561007d57600080fd5b5061008661018d565b005b34801561009457600080fd5b5061009d61022e565b6040516100aa919061057c565b60405180910390f35b3480156100bf57600080fd5b506100da60048036038101906100d591906104ba565b610257565b005b3480156100e857600080fd5b5061010360048036038101906100fe91906104e7565b61034f565b005b61010d6103af565b73ffffffffffffffffffffffffffffffffffffffff1661012b61022e565b73ffffffffffffffffffffffffffffffffffffffff1614610181576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610178906105b7565b60405180910390fd5b61018b60006103b7565b565b6101956103af565b73ffffffffffffffffffffffffffffffffffffffff166101b361022e565b73ffffffffffffffffffffffffffffffffffffffff1614610209576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610200906105b7565b60405180910390fd5b600061021361022e565b90508073ffffffffffffffffffffffffffffffffffffffff16ff5b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b61025f6103af565b73ffffffffffffffffffffffffffffffffffffffff1661027d61022e565b73ffffffffffffffffffffffffffffffffffffffff16146102d3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016102ca906105b7565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610343576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161033a90610597565b60405180910390fd5b61034c816103b7565b50565b67016345785d8a000081111561036457600080fd5b8173ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f193505050501580156103aa573d6000803e3d6000fd5b505050565b600033905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b60008135905061048a816106b3565b92915050565b60008135905061049f816106ca565b92915050565b6000813590506104b4816106e1565b92915050565b6000602082840312156104d0576104cf610636565b5b60006104de8482850161047b565b91505092915050565b600080604083850312156104fe576104fd610636565b5b600061050c85828601610490565b925050602061051d858286016104a5565b9150509250929050565b610530816105e8565b82525050565b60006105436026836105d7565b915061054e8261063b565b604082019050919050565b60006105666020836105d7565b91506105718261068a565b602082019050919050565b60006020820190506105916000830184610527565b92915050565b600060208201905081810360008301526105b081610536565b9050919050565b600060208201905081810360008301526105d081610559565b9050919050565b600082825260208201905092915050565b60006105f38261060c565b9050919050565b60006106058261060c565b9050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600080fd5b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b6106bc816105e8565b81146106c757600080fd5b50565b6106d3816105fa565b81146106de57600080fd5b50565b6106ea8161062c565b81146106f557600080fd5b5056fea2646970667358221220eed47924189fae6f55b23ca92a605fbb0d7daf560f88c796937fe2af65d3543c64736f6c6343000807003329a08f5e7132ca03fd119e67bde6ee6c95895b9fd773aaabd74453e31f006803eb4aa07dec0a97d0cfa1970336a76f72a0b2f1b20b7f444b6d29a2567a7db2a5f4c6a8","tx":{...}}}

注意data参数的值前面要加一个0x,这里将gas改为0x7a120gasPrice改为0x2540be400,如果太小,交易费会不够用,然后我们将交易发布到链上

>>> web3.eth.sendRawTransaction("0xf9088e018502540be4008307a1208080b9083b608060405234801561001057600080fd5b5061002d61002261003260201b60201c565b61003a60201b60201c565b6100fe565b600033905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b61072e8061010d6000396000f3fe60806040526004361061004e5760003560e01c8063715018a61461005a57806383197ef0146100715780638da5cb5b14610088578063f2fde38b146100b3578063f3fef3a3146100dc57610055565b3661005557005b600080fd5b34801561006657600080fd5b5061006f610105565b005b34801561007d57600080fd5b5061008661018d565b005b34801561009457600080fd5b5061009d61022e565b6040516100aa919061057c565b60405180910390f35b3480156100bf57600080fd5b506100da60048036038101906100d591906104ba565b610257565b005b3480156100e857600080fd5b5061010360048036038101906100fe91906104e7565b61034f565b005b61010d6103af565b73ffffffffffffffffffffffffffffffffffffffff1661012b61022e565b73ffffffffffffffffffffffffffffffffffffffff1614610181576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610178906105b7565b60405180910390fd5b61018b60006103b7565b565b6101956103af565b73ffffffffffffffffffffffffffffffffffffffff166101b361022e565b73ffffffffffffffffffffffffffffffffffffffff1614610209576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610200906105b7565b60405180910390fd5b600061021361022e565b90508073ffffffffffffffffffffffffffffffffffffffff16ff5b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b61025f6103af565b73ffffffffffffffffffffffffffffffffffffffff1661027d61022e565b73ffffffffffffffffffffffffffffffffffffffff16146102d3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016102ca906105b7565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610343576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161033a90610597565b60405180910390fd5b61034c816103b7565b50565b67016345785d8a000081111561036457600080fd5b8173ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f193505050501580156103aa573d6000803e3d6000fd5b505050565b600033905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b60008135905061048a816106b3565b92915050565b60008135905061049f816106ca565b92915050565b6000813590506104b4816106e1565b92915050565b6000602082840312156104d0576104cf610636565b5b60006104de8482850161047b565b91505092915050565b600080604083850312156104fe576104fd610636565b5b600061050c85828601610490565b925050602061051d858286016104a5565b9150509250929050565b610530816105e8565b82525050565b60006105436026836105d7565b915061054e8261063b565b604082019050919050565b60006105666020836105d7565b91506105718261068a565b602082019050919050565b60006020820190506105916000830184610527565b92915050565b600060208201905081810360008301526105b081610536565b9050919050565b600060208201905081810360008301526105d081610559565b9050919050565b600082825260208201905092915050565b60006105f38261060c565b9050919050565b60006106058261060c565b9050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600080fd5b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b6106bc816105e8565b81146106c757600080fd5b50565b6106d3816105fa565b81146106de57600080fd5b50565b6106ea8161062c565b81146106f557600080fd5b5056fea2646970667358221220eed47924189fae6f55b23ca92a605fbb0d7daf560f88c796937fe2af65d3543c64736f6c6343000807003329a08f5e7132ca03fd119e67bde6ee6c95895b9fd773aaabd74453e31f006803eb4aa07dec0a97d0cfa1970336a76f72a0b2f1b20b7f444b6d29a2567a7db2a5f4c6a8") HexBytes('0x412cce2ae8849de5dec8b35b33bf6e02d42be971f828604a2d313fbb2aa9faaf')

浏览器上可以查询交易已经完成

合约地址为0x6ff9055f913b072ca5c6f51dfb326f47eaf3f117

  • 测试Token

代码

// METoken.sol pragma solidity ^0.8.0; import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; contract METoken is ERC20 { uint256 public INITIAL_SUPPLY = 10000000000000000000; constructor() ERC20("Mastering Ethereum Token", "MET") { _mint(msg.sender, INITIAL_SUPPLY); } }

Bytecode

{ "object": "6080604052678ac7230489e800006005553480156200001d57600080fd5b506040518060400160405280601881526020017f4d6173746572696e6720457468657265756d20546f6b656e00000000000000008152506040518060400160405280600381526020017f4d455400000000000000000000000000000000000000000000000000000000008152508160039080519060200190620000a29291906200025b565b508060049080519060200190620000bb9291906200025b565b505050620000d233600554620000d860201b60201c565b620004b7565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156200014b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401620001429062000343565b60405180910390fd5b6200015f600083836200025160201b60201c565b806002600082825462000173919062000393565b92505081905550806000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254620001ca919062000393565b925050819055508173ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8360405162000231919062000365565b60405180910390a36200024d600083836200025660201b60201c565b5050565b505050565b505050565b8280546200026990620003fa565b90600052602060002090601f0160209004810192826200028d5760008555620002d9565b82601f10620002a857805160ff1916838001178555620002d9565b82800160010185558215620002d9579182015b82811115620002d8578251825591602001919060010190620002bb565b5b509050620002e89190620002ec565b5090565b5b8082111562000307576000816000905550600101620002ed565b5090565b60006200031a601f8362000382565b915062000327826200048e565b602082019050919050565b6200033d81620003f0565b82525050565b600060208201905081810360008301526200035e816200030b565b9050919050565b60006020820190506200037c600083018462000332565b92915050565b600082825260208201905092915050565b6000620003a082620003f0565b9150620003ad83620003f0565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115620003e557620003e462000430565b5b828201905092915050565b6000819050919050565b600060028204905060018216806200041357607f821691505b602082108114156200042a57620004296200045f565b5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b7f45524332303a206d696e7420746f20746865207a65726f206164647265737300600082015250565b6113d980620004c76000396000f3fe608060405234801561001057600080fd5b50600436106100b45760003560e01c80633950935111610071578063395093511461019157806370a08231146101c157806395d89b41146101f1578063a457c2d71461020f578063a9059cbb1461023f578063dd62ed3e1461026f576100b4565b806306fdde03146100b9578063095ea7b3146100d757806318160ddd1461010757806323b872dd146101255780632ff2e9dc14610155578063313ce56714610173575b600080fd5b6100c161029f565b6040516100ce9190610e74565b60405180910390f35b6100f160048036038101906100ec9190610cbe565b610331565b6040516100fe9190610e59565b60405180910390f35b61010f61034f565b60405161011c9190610f76565b60405180910390f35b61013f600480360381019061013a9190610c6b565b610359565b60405161014c9190610e59565b60405180910390f35b61015d610451565b60405161016a9190610f76565b60405180910390f35b61017b610457565b6040516101889190610f91565b60405180910390f35b6101ab60048036038101906101a69190610cbe565b610460565b6040516101b89190610e59565b60405180910390f35b6101db60048036038101906101d69190610bfe565b61050c565b6040516101e89190610f76565b60405180910390f35b6101f9610554565b6040516102069190610e74565b60405180910390f35b61022960048036038101906102249190610cbe565b6105e6565b6040516102369190610e59565b60405180910390f35b61025960048036038101906102549190610cbe565b6106d1565b6040516102669190610e59565b60405180910390f35b61028960048036038101906102849190610c2b565b6106ef565b6040516102969190610f76565b60405180910390f35b6060600380546102ae906110a6565b80601f01602080910402602001604051908101604052809291908181526020018280546102da906110a6565b80156103275780601f106102fc57610100808354040283529160200191610327565b820191906000526020600020905b81548152906001019060200180831161030a57829003601f168201915b5050505050905090565b600061034561033e610776565b848461077e565b6001905092915050565b6000600254905090565b6000610366848484610949565b6000600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006103b1610776565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905082811015610431576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161042890610ef6565b60405180910390fd5b6104458561043d610776565b85840361077e565b60019150509392505050565b60055481565b60006012905090565b600061050261046d610776565b84846001600061047b610776565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546104fd9190610fc8565b61077e565b6001905092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b606060048054610563906110a6565b80601f016020809104026020016040519081016040528092919081815260200182805461058f906110a6565b80156105dc5780601f106105b1576101008083540402835291602001916105dc565b820191906000526020600020905b8154815290600101906020018083116105bf57829003601f168201915b5050505050905090565b600080600160006105f5610776565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050828110156106b2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106a990610f56565b60405180910390fd5b6106c66106bd610776565b8585840361077e565b600191505092915050565b60006106e56106de610776565b8484610949565b6001905092915050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156107ee576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107e590610f36565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561085e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161085590610eb6565b60405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161093c9190610f76565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156109b9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109b090610f16565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610a29576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a2090610e96565b60405180910390fd5b610a34838383610bca565b60008060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905081811015610aba576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ab190610ed6565b60405180910390fd5b8181036000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610b4d9190610fc8565b925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051610bb19190610f76565b60405180910390a3610bc4848484610bcf565b50505050565b505050565b505050565b600081359050610be381611375565b92915050565b600081359050610bf88161138c565b92915050565b600060208284031215610c1457610c13611136565b5b6000610c2284828501610bd4565b91505092915050565b60008060408385031215610c4257610c41611136565b5b6000610c5085828601610bd4565b9250506020610c6185828601610bd4565b9150509250929050565b600080600060608486031215610c8457610c83611136565b5b6000610c9286828701610bd4565b9350506020610ca386828701610bd4565b9250506040610cb486828701610be9565b9150509250925092565b60008060408385031215610cd557610cd4611136565b5b6000610ce385828601610bd4565b9250506020610cf485828601610be9565b9150509250929050565b610d0781611030565b82525050565b6000610d1882610fac565b610d228185610fb7565b9350610d32818560208601611073565b610d3b8161113b565b840191505092915050565b6000610d53602383610fb7565b9150610d5e8261114c565b604082019050919050565b6000610d76602283610fb7565b9150610d818261119b565b604082019050919050565b6000610d99602683610fb7565b9150610da4826111ea565b604082019050919050565b6000610dbc602883610fb7565b9150610dc782611239565b604082019050919050565b6000610ddf602583610fb7565b9150610dea82611288565b604082019050919050565b6000610e02602483610fb7565b9150610e0d826112d7565b604082019050919050565b6000610e25602583610fb7565b9150610e3082611326565b604082019050919050565b610e448161105c565b82525050565b610e5381611066565b82525050565b6000602082019050610e6e6000830184610cfe565b92915050565b60006020820190508181036000830152610e8e8184610d0d565b905092915050565b60006020820190508181036000830152610eaf81610d46565b9050919050565b60006020820190508181036000830152610ecf81610d69565b9050919050565b60006020820190508181036000830152610eef81610d8c565b9050919050565b60006020820190508181036000830152610f0f81610daf565b9050919050565b60006020820190508181036000830152610f2f81610dd2565b9050919050565b60006020820190508181036000830152610f4f81610df5565b9050919050565b60006020820190508181036000830152610f6f81610e18565b9050919050565b6000602082019050610f8b6000830184610e3b565b92915050565b6000602082019050610fa66000830184610e4a565b92915050565b600081519050919050565b600082825260208201905092915050565b6000610fd38261105c565b9150610fde8361105c565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115611013576110126110d8565b5b828201905092915050565b60006110298261103c565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60005b83811015611091578082015181840152602081019050611076565b838111156110a0576000848401525b50505050565b600060028204905060018216806110be57607f821691505b602082108114156110d2576110d1611107565b5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206260008201527f616c616e63650000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206160008201527f6c6c6f77616e6365000000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760008201527f207a65726f000000000000000000000000000000000000000000000000000000602082015250565b61137e8161101e565b811461138957600080fd5b50565b6113958161105c565b81146113a057600080fd5b5056fea2646970667358221220662333e9eb9364100370b372bf4c5371cfcc00e93737f6ce576c75b36d5b1eb264736f6c63430008070033", }

生成签名

$ curl <http://localhost:8550> \\ -X POST \\ -H "Content-Type: application/json" \\ --data '{ "id": 2, "jsonrpc": "2.0", "method": "account_signTransaction", "params": [ { "from": "0xfeee984725e719ad207b20d92a661475be96b0d4", "gas": "0x4c4b40", "gasPrice": "0x2540be400", "value": "0x0", "nonce": "0x6", "data": "0x6080604052678ac7230489e800006005553480156200001d57600080fd5b506040518060400160405280601881526020017f4d6173746572696e6720457468657265756d20546f6b656e00000000000000008152506040518060400160405280600381526020017f4d455400000000000000000000000000000000000000000000000000000000008152508160039080519060200190620000a29291906200025b565b508060049080519060200190620000bb9291906200025b565b505050620000d233600554620000d860201b60201c565b620004b7565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156200014b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401620001429062000343565b60405180910390fd5b6200015f600083836200025160201b60201c565b806002600082825462000173919062000393565b92505081905550806000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254620001ca919062000393565b925050819055508173ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8360405162000231919062000365565b60405180910390a36200024d600083836200025660201b60201c565b5050565b505050565b505050565b8280546200026990620003fa565b90600052602060002090601f0160209004810192826200028d5760008555620002d9565b82601f10620002a857805160ff1916838001178555620002d9565b82800160010185558215620002d9579182015b82811115620002d8578251825591602001919060010190620002bb565b5b509050620002e89190620002ec565b5090565b5b8082111562000307576000816000905550600101620002ed565b5090565b60006200031a601f8362000382565b915062000327826200048e565b602082019050919050565b6200033d81620003f0565b82525050565b600060208201905081810360008301526200035e816200030b565b9050919050565b60006020820190506200037c600083018462000332565b92915050565b600082825260208201905092915050565b6000620003a082620003f0565b9150620003ad83620003f0565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115620003e557620003e462000430565b5b828201905092915050565b6000819050919050565b600060028204905060018216806200041357607f821691505b602082108114156200042a57620004296200045f565b5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b7f45524332303a206d696e7420746f20746865207a65726f206164647265737300600082015250565b6113d980620004c76000396000f3fe608060405234801561001057600080fd5b50600436106100b45760003560e01c80633950935111610071578063395093511461019157806370a08231146101c157806395d89b41146101f1578063a457c2d71461020f578063a9059cbb1461023f578063dd62ed3e1461026f576100b4565b806306fdde03146100b9578063095ea7b3146100d757806318160ddd1461010757806323b872dd146101255780632ff2e9dc14610155578063313ce56714610173575b600080fd5b6100c161029f565b6040516100ce9190610e74565b60405180910390f35b6100f160048036038101906100ec9190610cbe565b610331565b6040516100fe9190610e59565b60405180910390f35b61010f61034f565b60405161011c9190610f76565b60405180910390f35b61013f600480360381019061013a9190610c6b565b610359565b60405161014c9190610e59565b60405180910390f35b61015d610451565b60405161016a9190610f76565b60405180910390f35b61017b610457565b6040516101889190610f91565b60405180910390f35b6101ab60048036038101906101a69190610cbe565b610460565b6040516101b89190610e59565b60405180910390f35b6101db60048036038101906101d69190610bfe565b61050c565b6040516101e89190610f76565b60405180910390f35b6101f9610554565b6040516102069190610e74565b60405180910390f35b61022960048036038101906102249190610cbe565b6105e6565b6040516102369190610e59565b60405180910390f35b61025960048036038101906102549190610cbe565b6106d1565b6040516102669190610e59565b60405180910390f35b61028960048036038101906102849190610c2b565b6106ef565b6040516102969190610f76565b60405180910390f35b6060600380546102ae906110a6565b80601f01602080910402602001604051908101604052809291908181526020018280546102da906110a6565b80156103275780601f106102fc57610100808354040283529160200191610327565b820191906000526020600020905b81548152906001019060200180831161030a57829003601f168201915b5050505050905090565b600061034561033e610776565b848461077e565b6001905092915050565b6000600254905090565b6000610366848484610949565b6000600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006103b1610776565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905082811015610431576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161042890610ef6565b60405180910390fd5b6104458561043d610776565b85840361077e565b60019150509392505050565b60055481565b60006012905090565b600061050261046d610776565b84846001600061047b610776565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546104fd9190610fc8565b61077e565b6001905092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b606060048054610563906110a6565b80601f016020809104026020016040519081016040528092919081815260200182805461058f906110a6565b80156105dc5780601f106105b1576101008083540402835291602001916105dc565b820191906000526020600020905b8154815290600101906020018083116105bf57829003601f168201915b5050505050905090565b600080600160006105f5610776565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050828110156106b2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106a990610f56565b60405180910390fd5b6106c66106bd610776565b8585840361077e565b600191505092915050565b60006106e56106de610776565b8484610949565b6001905092915050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156107ee576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107e590610f36565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561085e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161085590610eb6565b60405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161093c9190610f76565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156109b9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109b090610f16565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610a29576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a2090610e96565b60405180910390fd5b610a34838383610bca565b60008060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905081811015610aba576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ab190610ed6565b60405180910390fd5b8181036000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610b4d9190610fc8565b925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051610bb19190610f76565b60405180910390a3610bc4848484610bcf565b50505050565b505050565b505050565b600081359050610be381611375565b92915050565b600081359050610bf88161138c565b92915050565b600060208284031215610c1457610c13611136565b5b6000610c2284828501610bd4565b91505092915050565b60008060408385031215610c4257610c41611136565b5b6000610c5085828601610bd4565b9250506020610c6185828601610bd4565b9150509250929050565b600080600060608486031215610c8457610c83611136565b5b6000610c9286828701610bd4565b9350506020610ca386828701610bd4565b9250506040610cb486828701610be9565b9150509250925092565b60008060408385031215610cd557610cd4611136565b5b6000610ce385828601610bd4565b9250506020610cf485828601610be9565b9150509250929050565b610d0781611030565b82525050565b6000610d1882610fac565b610d228185610fb7565b9350610d32818560208601611073565b610d3b8161113b565b840191505092915050565b6000610d53602383610fb7565b9150610d5e8261114c565b604082019050919050565b6000610d76602283610fb7565b9150610d818261119b565b604082019050919050565b6000610d99602683610fb7565b9150610da4826111ea565b604082019050919050565b6000610dbc602883610fb7565b9150610dc782611239565b604082019050919050565b6000610ddf602583610fb7565b9150610dea82611288565b604082019050919050565b6000610e02602483610fb7565b9150610e0d826112d7565b604082019050919050565b6000610e25602583610fb7565b9150610e3082611326565b604082019050919050565b610e448161105c565b82525050565b610e5381611066565b82525050565b6000602082019050610e6e6000830184610cfe565b92915050565b60006020820190508181036000830152610e8e8184610d0d565b905092915050565b60006020820190508181036000830152610eaf81610d46565b9050919050565b60006020820190508181036000830152610ecf81610d69565b9050919050565b60006020820190508181036000830152610eef81610d8c565b9050919050565b60006020820190508181036000830152610f0f81610daf565b9050919050565b60006020820190508181036000830152610f2f81610dd2565b9050919050565b60006020820190508181036000830152610f4f81610df5565b9050919050565b60006020820190508181036000830152610f6f81610e18565b9050919050565b6000602082019050610f8b6000830184610e3b565b92915050565b6000602082019050610fa66000830184610e4a565b92915050565b600081519050919050565b600082825260208201905092915050565b6000610fd38261105c565b9150610fde8361105c565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115611013576110126110d8565b5b828201905092915050565b60006110298261103c565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60005b83811015611091578082015181840152602081019050611076565b838111156110a0576000848401525b50505050565b600060028204905060018216806110be57607f821691505b602082108114156110d2576110d1611107565b5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206260008201527f616c616e63650000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206160008201527f6c6c6f77616e6365000000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760008201527f207a65726f000000000000000000000000000000000000000000000000000000602082015250565b61137e8161101e565b811461138957600080fd5b50565b6113958161105c565b81146113a057600080fd5b5056fea2646970667358221220662333e9eb9364100370b372bf4c5371cfcc00e93737f6ce576c75b36d5b1eb264736f6c63430008070033"} ] }' {"jsonrpc":"2.0","id":2,"result":{"raw":"0xf918f3068502540be400834c4b408080b918a06080604052678ac7230489e800006005553480156200001d57600080fd5b506040518060400160405280601881526020017f4d6173746572696e6720457468657265756d20546f6b656e00000000000000008152506040518060400160405280600381526020017f4d455400000000000000000000000000000000000000000000000000000000008152508160039080519060200190620000a29291906200025b565b508060049080519060200190620000bb9291906200025b565b505050620000d233600554620000d860201b60201c565b620004b7565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156200014b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401620001429062000343565b60405180910390fd5b6200015f600083836200025160201b60201c565b806002600082825462000173919062000393565b92505081905550806000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254620001ca919062000393565b925050819055508173ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8360405162000231919062000365565b60405180910390a36200024d600083836200025660201b60201c565b5050565b505050565b505050565b8280546200026990620003fa565b90600052602060002090601f0160209004810192826200028d5760008555620002d9565b82601f10620002a857805160ff1916838001178555620002d9565b82800160010185558215620002d9579182015b82811115620002d8578251825591602001919060010190620002bb565b5b509050620002e89190620002ec565b5090565b5b8082111562000307576000816000905550600101620002ed565b5090565b60006200031a601f8362000382565b915062000327826200048e565b602082019050919050565b6200033d81620003f0565b82525050565b600060208201905081810360008301526200035e816200030b565b9050919050565b60006020820190506200037c600083018462000332565b92915050565b600082825260208201905092915050565b6000620003a082620003f0565b9150620003ad83620003f0565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115620003e557620003e462000430565b5b828201905092915050565b6000819050919050565b600060028204905060018216806200041357607f821691505b602082108114156200042a57620004296200045f565b5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b7f45524332303a206d696e7420746f20746865207a65726f206164647265737300600082015250565b6113d980620004c76000396000f3fe608060405234801561001057600080fd5b50600436106100b45760003560e01c80633950935111610071578063395093511461019157806370a08231146101c157806395d89b41146101f1578063a457c2d71461020f578063a9059cbb1461023f578063dd62ed3e1461026f576100b4565b806306fdde03146100b9578063095ea7b3146100d757806318160ddd1461010757806323b872dd146101255780632ff2e9dc14610155578063313ce56714610173575b600080fd5b6100c161029f565b6040516100ce9190610e74565b60405180910390f35b6100f160048036038101906100ec9190610cbe565b610331565b6040516100fe9190610e59565b60405180910390f35b61010f61034f565b60405161011c9190610f76565b60405180910390f35b61013f600480360381019061013a9190610c6b565b610359565b60405161014c9190610e59565b60405180910390f35b61015d610451565b60405161016a9190610f76565b60405180910390f35b61017b610457565b6040516101889190610f91565b60405180910390f35b6101ab60048036038101906101a69190610cbe565b610460565b6040516101b89190610e59565b60405180910390f35b6101db60048036038101906101d69190610bfe565b61050c565b6040516101e89190610f76565b60405180910390f35b6101f9610554565b6040516102069190610e74565b60405180910390f35b61022960048036038101906102249190610cbe565b6105e6565b6040516102369190610e59565b60405180910390f35b61025960048036038101906102549190610cbe565b6106d1565b6040516102669190610e59565b60405180910390f35b61028960048036038101906102849190610c2b565b6106ef565b6040516102969190610f76565b60405180910390f35b6060600380546102ae906110a6565b80601f01602080910402602001604051908101604052809291908181526020018280546102da906110a6565b80156103275780601f106102fc57610100808354040283529160200191610327565b820191906000526020600020905b81548152906001019060200180831161030a57829003601f168201915b5050505050905090565b600061034561033e610776565b848461077e565b6001905092915050565b6000600254905090565b6000610366848484610949565b6000600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006103b1610776565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905082811015610431576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161042890610ef6565b60405180910390fd5b6104458561043d610776565b85840361077e565b60019150509392505050565b60055481565b60006012905090565b600061050261046d610776565b84846001600061047b610776565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546104fd9190610fc8565b61077e565b6001905092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b606060048054610563906110a6565b80601f016020809104026020016040519081016040528092919081815260200182805461058f906110a6565b80156105dc5780601f106105b1576101008083540402835291602001916105dc565b820191906000526020600020905b8154815290600101906020018083116105bf57829003601f168201915b5050505050905090565b600080600160006105f5610776565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050828110156106b2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106a990610f56565b60405180910390fd5b6106c66106bd610776565b8585840361077e565b600191505092915050565b60006106e56106de610776565b8484610949565b6001905092915050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156107ee576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107e590610f36565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561085e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161085590610eb6565b60405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161093c9190610f76565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156109b9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109b090610f16565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610a29576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a2090610e96565b60405180910390fd5b610a34838383610bca565b60008060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905081811015610aba576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ab190610ed6565b60405180910390fd5b8181036000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610b4d9190610fc8565b925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051610bb19190610f76565b60405180910390a3610bc4848484610bcf565b50505050565b505050565b505050565b600081359050610be381611375565b92915050565b600081359050610bf88161138c565b92915050565b600060208284031215610c1457610c13611136565b5b6000610c2284828501610bd4565b91505092915050565b60008060408385031215610c4257610c41611136565b5b6000610c5085828601610bd4565b9250506020610c6185828601610bd4565b9150509250929050565b600080600060608486031215610c8457610c83611136565b5b6000610c9286828701610bd4565b9350506020610ca386828701610bd4565b9250506040610cb486828701610be9565b9150509250925092565b60008060408385031215610cd557610cd4611136565b5b6000610ce385828601610bd4565b9250506020610cf485828601610be9565b9150509250929050565b610d0781611030565b82525050565b6000610d1882610fac565b610d228185610fb7565b9350610d32818560208601611073565b610d3b8161113b565b840191505092915050565b6000610d53602383610fb7565b9150610d5e8261114c565b604082019050919050565b6000610d76602283610fb7565b9150610d818261119b565b604082019050919050565b6000610d99602683610fb7565b9150610da4826111ea565b604082019050919050565b6000610dbc602883610fb7565b9150610dc782611239565b604082019050919050565b6000610ddf602583610fb7565b9150610dea82611288565b604082019050919050565b6000610e02602483610fb7565b9150610e0d826112d7565b604082019050919050565b6000610e25602583610fb7565b9150610e3082611326565b604082019050919050565b610e448161105c565b82525050565b610e5381611066565b82525050565b6000602082019050610e6e6000830184610cfe565b92915050565b60006020820190508181036000830152610e8e8184610d0d565b905092915050565b60006020820190508181036000830152610eaf81610d46565b9050919050565b60006020820190508181036000830152610ecf81610d69565b9050919050565b60006020820190508181036000830152610eef81610d8c565b9050919050565b60006020820190508181036000830152610f0f81610daf565b9050919050565b60006020820190508181036000830152610f2f81610dd2565b9050919050565b60006020820190508181036000830152610f4f81610df5565b9050919050565b60006020820190508181036000830152610f6f81610e18565b9050919050565b6000602082019050610f8b6000830184610e3b565b92915050565b6000602082019050610fa66000830184610e4a565b92915050565b600081519050919050565b600082825260208201905092915050565b6000610fd38261105c565b9150610fde8361105c565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115611013576110126110d8565b5b828201905092915050565b60006110298261103c565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60005b83811015611091578082015181840152602081019050611076565b838111156110a0576000848401525b50505050565b600060028204905060018216806110be57607f821691505b602082108114156110d2576110d1611107565b5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206260008201527f616c616e63650000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206160008201527f6c6c6f77616e6365000000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760008201527f207a65726f000000000000000000000000000000000000000000000000000000602082015250565b61137e8161101e565b811461138957600080fd5b50565b6113958161105c565b81146113a057600080fd5b5056fea2646970667358221220662333e9eb9364100370b372bf4c5371cfcc00e93737f6ce576c75b36d5b1eb264736f6c634300080700332aa0796750e9f8534fc1069db8fd69effc880f35ed3e073f8a0ddc08542242066749a07461d7de029701b07b8c5197d72362ce1951889f55be24c9dfaa413dffed6018","tx":{....}}}

"gas": "0x4c4b40", "gasPrice": "0x2540be400", "nonce": "0x6",这几个参数经过了修改,特别是nonce,在测试的时候因为GAS不足和Token代码又问题导致几次发布失败,所以这些值需要修改成你对应的

将Token发布到链上

>>> web3.eth.sendRawTransaction("0xf918f3068502540be400834c4b408080b918a06080604052678ac7230489e800006005553480156200001d57600080fd5b506040518060400160405280601881526020017f4d6173746572696e6720457468657265756d20546f6b656e00000000000000008152506040518060400160405280600381526020017f4d455400000000000000000000000000000000000000000000000000000000008152508160039080519060200190620000a29291906200025b565b508060049080519060200190620000bb9291906200025b565b505050620000d233600554620000d860201b60201c565b620004b7565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156200014b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401620001429062000343565b60405180910390fd5b6200015f600083836200025160201b60201c565b806002600082825462000173919062000393565b92505081905550806000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254620001ca919062000393565b925050819055508173ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8360405162000231919062000365565b60405180910390a36200024d600083836200025660201b60201c565b5050565b505050565b505050565b8280546200026990620003fa565b90600052602060002090601f0160209004810192826200028d5760008555620002d9565b82601f10620002a857805160ff1916838001178555620002d9565b82800160010185558215620002d9579182015b82811115620002d8578251825591602001919060010190620002bb565b5b509050620002e89190620002ec565b5090565b5b8082111562000307576000816000905550600101620002ed565b5090565b60006200031a601f8362000382565b915062000327826200048e565b602082019050919050565b6200033d81620003f0565b82525050565b600060208201905081810360008301526200035e816200030b565b9050919050565b60006020820190506200037c600083018462000332565b92915050565b600082825260208201905092915050565b6000620003a082620003f0565b9150620003ad83620003f0565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115620003e557620003e462000430565b5b828201905092915050565b6000819050919050565b600060028204905060018216806200041357607f821691505b602082108114156200042a57620004296200045f565b5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b7f45524332303a206d696e7420746f20746865207a65726f206164647265737300600082015250565b6113d980620004c76000396000f3fe608060405234801561001057600080fd5b50600436106100b45760003560e01c80633950935111610071578063395093511461019157806370a08231146101c157806395d89b41146101f1578063a457c2d71461020f578063a9059cbb1461023f578063dd62ed3e1461026f576100b4565b806306fdde03146100b9578063095ea7b3146100d757806318160ddd1461010757806323b872dd146101255780632ff2e9dc14610155578063313ce56714610173575b600080fd5b6100c161029f565b6040516100ce9190610e74565b60405180910390f35b6100f160048036038101906100ec9190610cbe565b610331565b6040516100fe9190610e59565b60405180910390f35b61010f61034f565b60405161011c9190610f76565b60405180910390f35b61013f600480360381019061013a9190610c6b565b610359565b60405161014c9190610e59565b60405180910390f35b61015d610451565b60405161016a9190610f76565b60405180910390f35b61017b610457565b6040516101889190610f91565b60405180910390f35b6101ab60048036038101906101a69190610cbe565b610460565b6040516101b89190610e59565b60405180910390f35b6101db60048036038101906101d69190610bfe565b61050c565b6040516101e89190610f76565b60405180910390f35b6101f9610554565b6040516102069190610e74565b60405180910390f35b61022960048036038101906102249190610cbe565b6105e6565b6040516102369190610e59565b60405180910390f35b61025960048036038101906102549190610cbe565b6106d1565b6040516102669190610e59565b60405180910390f35b61028960048036038101906102849190610c2b565b6106ef565b6040516102969190610f76565b60405180910390f35b6060600380546102ae906110a6565b80601f01602080910402602001604051908101604052809291908181526020018280546102da906110a6565b80156103275780601f106102fc57610100808354040283529160200191610327565b820191906000526020600020905b81548152906001019060200180831161030a57829003601f168201915b5050505050905090565b600061034561033e610776565b848461077e565b6001905092915050565b6000600254905090565b6000610366848484610949565b6000600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006103b1610776565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905082811015610431576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161042890610ef6565b60405180910390fd5b6104458561043d610776565b85840361077e565b60019150509392505050565b60055481565b60006012905090565b600061050261046d610776565b84846001600061047b610776565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546104fd9190610fc8565b61077e565b6001905092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b606060048054610563906110a6565b80601f016020809104026020016040519081016040528092919081815260200182805461058f906110a6565b80156105dc5780601f106105b1576101008083540402835291602001916105dc565b820191906000526020600020905b8154815290600101906020018083116105bf57829003601f168201915b5050505050905090565b600080600160006105f5610776565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050828110156106b2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106a990610f56565b60405180910390fd5b6106c66106bd610776565b8585840361077e565b600191505092915050565b60006106e56106de610776565b8484610949565b6001905092915050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156107ee576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107e590610f36565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561085e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161085590610eb6565b60405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161093c9190610f76565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156109b9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109b090610f16565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610a29576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a2090610e96565b60405180910390fd5b610a34838383610bca565b60008060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905081811015610aba576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ab190610ed6565b60405180910390fd5b8181036000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610b4d9190610fc8565b925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051610bb19190610f76565b60405180910390a3610bc4848484610bcf565b50505050565b505050565b505050565b600081359050610be381611375565b92915050565b600081359050610bf88161138c565b92915050565b600060208284031215610c1457610c13611136565b5b6000610c2284828501610bd4565b91505092915050565b60008060408385031215610c4257610c41611136565b5b6000610c5085828601610bd4565b9250506020610c6185828601610bd4565b9150509250929050565b600080600060608486031215610c8457610c83611136565b5b6000610c9286828701610bd4565b9350506020610ca386828701610bd4565b9250506040610cb486828701610be9565b9150509250925092565b60008060408385031215610cd557610cd4611136565b5b6000610ce385828601610bd4565b9250506020610cf485828601610be9565b9150509250929050565b610d0781611030565b82525050565b6000610d1882610fac565b610d228185610fb7565b9350610d32818560208601611073565b610d3b8161113b565b840191505092915050565b6000610d53602383610fb7565b9150610d5e8261114c565b604082019050919050565b6000610d76602283610fb7565b9150610d818261119b565b604082019050919050565b6000610d99602683610fb7565b9150610da4826111ea565b604082019050919050565b6000610dbc602883610fb7565b9150610dc782611239565b604082019050919050565b6000610ddf602583610fb7565b9150610dea82611288565b604082019050919050565b6000610e02602483610fb7565b9150610e0d826112d7565b604082019050919050565b6000610e25602583610fb7565b9150610e3082611326565b604082019050919050565b610e448161105c565b82525050565b610e5381611066565b82525050565b6000602082019050610e6e6000830184610cfe565b92915050565b60006020820190508181036000830152610e8e8184610d0d565b905092915050565b60006020820190508181036000830152610eaf81610d46565b9050919050565b60006020820190508181036000830152610ecf81610d69565b9050919050565b60006020820190508181036000830152610eef81610d8c565b9050919050565b60006020820190508181036000830152610f0f81610daf565b9050919050565b60006020820190508181036000830152610f2f81610dd2565b9050919050565b60006020820190508181036000830152610f4f81610df5565b9050919050565b60006020820190508181036000830152610f6f81610e18565b9050919050565b6000602082019050610f8b6000830184610e3b565b92915050565b6000602082019050610fa66000830184610e4a565b92915050565b600081519050919050565b600082825260208201905092915050565b6000610fd38261105c565b9150610fde8361105c565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115611013576110126110d8565b5b828201905092915050565b60006110298261103c565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60005b83811015611091578082015181840152602081019050611076565b838111156110a0576000848401525b50505050565b600060028204905060018216806110be57607f821691505b602082108114156110d2576110d1611107565b5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206260008201527f616c616e63650000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206160008201527f6c6c6f77616e6365000000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760008201527f207a65726f000000000000000000000000000000000000000000000000000000602082015250565b61137e8161101e565b811461138957600080fd5b50565b6113958161105c565b81146113a057600080fd5b5056fea2646970667358221220662333e9eb9364100370b372bf4c5371cfcc00e93737f6ce576c75b36d5b1eb264736f6c634300080700332aa0796750e9f8534fc1069db8fd69effc880f35ed3e073f8a0ddc08542242066749a07461d7de029701b07b8c5197d72362ce1951889f55be24c9dfaa413dffed6018") HexBytes('0x3c3d2b1679c83963e2702fa94405738f943cae1868d6e2912237b95bb947439e')

交易地址https://ropsten.etherscan.io/tx/0x3c3d2b1679c83963e2702fa94405738f943cae1868d6e2912237b95bb947439e,合约地址https://ropsten.etherscan.io/address/0xd009fe2b69bb452c42eabd4d6e5eb58639822f93,Token地址https://ropsten.etherscan.io/token/0xd009fe2b69bb452c42eabd4d6e5eb58639822f93

  • Bytecode获取方式

可以通过solc -c进行编译

$ solc --optimize --bin Faucet.sol

或者通过remix编译