Seele Doc
Search…
代币示例
本节内容将展示如何编译、部署、调用ERC20代币合约。
如果您对如何基于Seele开发和部署合约尚不熟悉,建议先阅读[基于Seele开发部署合约流程.md],尝试基础的合约部署成功后, 再开发和部署ERC20代币合约。

一个ERC20代币合约示例

这里我们使用一个LKBT代币合约作为示例,该合约包含了一个library的调用。
1
pragma solidity ^0.4.24;
2
3
4
library IterableMapping {
5
struct itmap
6
{
7
mapping(address => IndexValue) data;
8
KeyFlag[] keys;
9
uint size;
10
}
11
struct IndexValue { uint keyIndex; uint value; }
12
struct KeyFlag { address key; bool deleted; }
13
function insert(itmap storage self, address key, uint value) public returns (bool replaced)
14
{
15
uint keyIndex = self.data[key].keyIndex;
16
self.data[key].value = value;
17
if (keyIndex > 0)
18
return true;
19
else
20
{
21
keyIndex = self.keys.length++;
22
self.data[key].keyIndex = keyIndex + 1;
23
self.keys[keyIndex].key = key;
24
self.size++;
25
return false;
26
}
27
}
28
function iterate_start(itmap storage self) public view returns (uint keyIndex)
29
{
30
return iterate_next(self, uint(-1));
31
}
32
function iterate_valid(itmap storage self, uint keyIndex) public view returns (bool)
33
{
34
return keyIndex < self.keys.length;
35
}
36
function iterate_next(itmap storage self, uint keyIndex) public view returns (uint)
37
{
38
uint _tmpKeyIndex = keyIndex;
39
_tmpKeyIndex++;
40
while (_tmpKeyIndex < self.keys.length && self.keys[_tmpKeyIndex].deleted)
41
_tmpKeyIndex++;
42
return _tmpKeyIndex;
43
}
44
function iterate_get(itmap storage self, uint keyIndex) public view returns (address key, uint value)
45
{
46
key = self.keys[keyIndex].key;
47
value = self.data[key].value;
48
}
49
function iterate_getValue(itmap storage self, address key) public view returns (uint value) {
50
return self.data[key].value;
51
}
52
}
53
54
// File: zeppelin-solidity/contracts/ownership/Ownable.sol
55
56
/**
57
* @title Ownable
58
* @dev The Ownable contract has an owner address, and provides basic authorization control
59
* functions, this simplifies the implementation of "user permissions".
60
*/
61
contract Ownable {
62
address public owner;
63
64
65
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
66
67
68
/**
69
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
70
* account.
71
*/
72
constructor () public {
73
owner = msg.sender;
74
}
75
76
/**
77
* @dev Throws if called by any account other than the owner.
78
*/
79
modifier onlyOwner() {
80
require(msg.sender == owner,"called by any account other than the owner");
81
_;
82
}
83
84
85
/**
86
* @dev Allows the current owner to transfer control of the contract to a newOwner.
87
* @param newOwner The address to transfer ownership to.
88
*/
89
function transferOwnership(address newOwner) public onlyOwner {
90
require(newOwner != address(0),"owner address should not 0");
91
emit OwnershipTransferred(owner, newOwner);
92
owner = newOwner;
93
}
94
95
}
96
97
// File: zeppelin-solidity/contracts/lifecycle/Pausable.sol
98
99
/**
100
* @title Pausable
101
* @dev Base contract which allows children to implement an emergency stop mechanism.
102
*/
103
contract Pausable is Ownable {
104
event Pause();
105
event Unpause();
106
107
bool public paused = false;
108
109
110
/**
111
* @dev Modifier to make a function callable only when the contract is not paused.
112
*/
113
modifier whenNotPaused() {
114
require(!paused,"callable when the contract is not paused");
115
_;
116
}
117
118
/**
119
* @dev Modifier to make a function callable only when the contract is paused.
120
*/
121
modifier whenPaused() {
122
require(paused,"callable when the contract is paused");
123
_;
124
}
125
126
/**
127
* @dev called by the owner to pause, triggers stopped state
128
*/
129
function pause() public onlyOwner whenNotPaused {
130
paused = true;
131
emit Pause();
132
}
133
134
/**
135
* @dev called by the owner to unpause, returns to normal state
136
*/
137
function unpause() public onlyOwner whenPaused {
138
paused = false;
139
emit Unpause();
140
}
141
}
142
143
/**
144
* @title SafeMath
145
* @dev Math operations with safety checks that throw on error
146
*/
147
library SafeMath {
148
149
/**
150
* @dev Multiplies two numbers, throws on overflow.
151
*/
152
function mul(uint256 _a, uint256 _b) internal pure returns (uint256 c) {
153
// Gas optimization: this is cheaper than asserting 'a' not being zero, but the
154
// benefit is lost if 'b' is also tested.
155
// See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522
156
if (_a == 0) {
157
return 0;
158
}
159
160
c = _a * _b;
161
assert(c / _a == _b);
162
return c;
163
}
164
165
/**
166
* @dev Integer division of two numbers, truncating the quotient.
167
*/
168
function div(uint256 _a, uint256 _b) internal pure returns (uint256) {
169
assert(_b > 0); // Solidity automatically throws when dividing by 0
170
uint256 c = _a / _b;
171
assert(_a == _b * c + _a % _b); // There is no case in which this doesn't hold
172
return _a / _b;
173
}
174
175
/**
176
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
177
*/
178
function sub(uint256 _a, uint256 _b) internal pure returns (uint256) {
179
assert(_b <= _a);
180
return _a - _b;
181
}
182
183
/**
184
* @dev Adds two numbers, throws on overflow.
185
*/
186
function add(uint256 _a, uint256 _b) internal pure returns (uint256 c) {
187
c = _a + _b;
188
assert(c >= _a);
189
return c;
190
}
191
}
192
193
/**
194
* @title ERC20Basic
195
* @dev Simpler version of ERC20 interface
196
* See https://github.com/ethereum/EIPs/issues/179
197
*/
198
contract ERC20Basic {
199
function totalSupply() public view returns (uint256);
200
function balanceOf(address _who) public view returns (uint256);
201
function transfer(address _to, uint256 _value) public returns (bool);
202
event Transfer(address indexed from, address indexed to, uint256 value);
203
}
204
205
206
/**
207
* @title Basic token
208
* @dev Basic version of StandardToken, with no allowances.
209
*/
210
contract BasicToken is ERC20Basic {
211
using SafeMath for uint256;
212
IterableMapping.itmap balances;
213
214
uint256 internal totalSupply_;
215
216
/**
217
* @dev Total number of tokens in existence
218
*/
219
function totalSupply() public view returns (uint256) {
220
return totalSupply_;
221
}
222
223
/**
224
* @dev Transfer token for a specified address
225
* @param _to The address to transfer to.
226
* @param _value The amount to be transferred.
227
*/
228
function transfer(address _to, uint256 _value) public returns (bool) {
229
230
require(_value <= IterableMapping.iterate_getValue(balances, msg.sender),"not enough balances");
231
require(_to != address(0),"0 address not allow");
232
233
IterableMapping.insert(balances, msg.sender, IterableMapping.iterate_getValue(balances, msg.sender).sub(_value));
234
IterableMapping.insert(balances, _to, IterableMapping.iterate_getValue(balances, _to).add(_value));
235
emit Transfer(msg.sender, _to, _value);
236
return true;
237
}
238
239
/**
240
* @dev Gets the balance of the specified address.
241
* @param _owner The address to query the the balance of.
242
* @return An uint256 representing the amount owned by the passed address.
243
*/
244
function balanceOf(address _owner) public view returns (uint256) {
245
return IterableMapping.iterate_getValue(balances, _owner);
246
}
247
248
}
249
250
251
252
/**
253
* @title ERC20 interface
254
* @dev see https://github.com/ethereum/EIPs/issues/20
255
*/
256
contract ERC20 is ERC20Basic {
257
function allowance(address _owner, address _spender)
258
public view returns (uint256);
259
260
function transferFrom(address _from, address _to, uint256 _value)
261
public returns (bool);
262
263
function approve(address _spender, uint256 _value) public returns (bool);
264
event Approval(
265
address indexed owner,
266
address indexed spender,
267
uint256 value
268
);
269
}
270
271
/**
272
* @title Standard ERC20 token
273
*
274
* @dev Implementation of the basic standard token.
275
* https://github.com/ethereum/EIPs/issues/20
276
* Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
277
*/
278
contract StandardToken is ERC20, BasicToken {
279
280
mapping (address => mapping (address => uint256)) internal allowed;
281
282
283
/**
284
* @dev Transfer tokens from one address to another
285
* @param _from address The address which you want to send tokens from
286
* @param _to address The address which you want to transfer to
287
* @param _value uint256 the amount of tokens to be transferred
288
*/
289
function transferFrom(
290
address _from,
291
address _to,
292
uint256 _value
293
)
294
public
295
returns (bool)
296
{
297
298
require(_value <= IterableMapping.iterate_getValue(balances, _from),"balance not enough");
299
require(_value <= allowed[_from][msg.sender],"balance not enough");
300
require(_to != address(0),"0 address not allow");
301
302
IterableMapping.insert(balances, _from, IterableMapping.iterate_getValue(balances, _from).sub(_value));
303
IterableMapping.insert(balances, _to, IterableMapping.iterate_getValue(balances, _to).add(_value));
304
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
305
emit Transfer(_from, _to, _value);
306
return true;
307
}
308
309
/**
310
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
311
* Beware that changing an allowance with this method brings the risk that someone may use both the old
312
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
313
* race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
314
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
315
* @param _spender The address which will spend the funds.
316
* @param _value The amount of tokens to be spent.
317
*/
318
function approve(address _spender, uint256 _value) public returns (bool) {
319
allowed[msg.sender][_spender] = _value;
320
emit Approval(msg.sender, _spender, _value);
321
return true;
322
}
323
324
/**
325
* @dev Function to check the amount of tokens that an owner allowed to a spender.
326
* @param _owner address The address which owns the funds.
327
* @param _spender address The address which will spend the funds.
328
* @return A uint256 specifying the amount of tokens still available for the spender.
329
*/
330
function allowance(
331
address _owner,
332
address _spender
333
)
334
public
335
view
336
returns (uint256)
337
{
338
return allowed[_owner][_spender];
339
}
340
341
/**
342
* @dev Increase the amount of tokens that an owner allowed to a spender.
343
* approve should be called when allowed[_spender] == 0. To increment
344
* allowed value is better to use this function to avoid 2 calls (and wait until
345
* the first transaction is mined)
346
* From MonolithDAO Token.sol
347
* @param _spender The address which will spend the funds.
348
* @param _addedValue The amount of tokens to increase the allowance by.
349
*/
350
function increaseApproval(
351
address _spender,
352
uint256 _addedValue
353
)
354
public
355
returns (bool)
356
{
357
allowed[msg.sender][_spender] = (
358
allowed[msg.sender][_spender].add(_addedValue));
359
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
360
return true;
361
}
362
363
/**
364
* @dev Decrease the amount of tokens that an owner allowed to a spender.
365
* approve should be called when allowed[_spender] == 0. To decrement
366
* allowed value is better to use this function to avoid 2 calls (and wait until
367
* the first transaction is mined)
368
* From MonolithDAO Token.sol
369
* @param _spender The address which will spend the funds.
370
* @param _subtractedValue The amount of tokens to decrease the allowance by.
371
*/
372
function decreaseApproval(
373
address _spender,
374
uint256 _subtractedValue
375
)
376
public
377
returns (bool)
378
{
379
uint256 oldValue = allowed[msg.sender][_spender];
380
if (_subtractedValue >= oldValue) {
381
allowed[msg.sender][_spender] = 0;
382
} else {
383
allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue);
384
}
385
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
386
return true;
387
}
388
389
}
390
391
/**
392
* @title Pausable token
393
*
394
* @dev StandardToken modified with pausable transfers.
395
**/
396
397
contract PausableToken is StandardToken, Pausable {
398
399
function transfer(address _to, uint256 _value) public whenNotPaused returns (bool) {
400
return super.transfer(_to, _value);
401
}
402
403
function transferFrom(address _from, address _to, uint256 _value) public whenNotPaused returns (bool) {
404
return super.transferFrom(_from, _to, _value);
405
}
406
407
function approve(address _spender, uint256 _value) public whenNotPaused returns (bool) {
408
return super.approve(_spender, _value);
409
}
410
411
function increaseApproval(address _spender, uint _addedValue) public whenNotPaused returns (bool success) {
412
return super.increaseApproval(_spender, _addedValue);
413
}
414
415
function decreaseApproval(address _spender, uint _subtractedValue) public whenNotPaused returns (bool success) {
416
return super.decreaseApproval(_spender, _subtractedValue);
417
}
418
}
419
420
contract LKBT is PausableToken {
421
string public name = "LKBT Token";
422
string public symbol = "LKBT";
423
uint8 public decimals = 18;
424
uint256 public INITIAL_SUPPLY = 10000000000;
425
426
constructor () public {
427
totalSupply_ = INITIAL_SUPPLY;
428
IterableMapping.insert(balances, msg.sender, INITIAL_SUPPLY);
429
}
430
431
function balancesStart() public view returns(uint256) {
432
return IterableMapping.iterate_start(balances);
433
}
434
435
function balancesGetBool(uint256 num) public view returns(bool){
436
return IterableMapping.iterate_valid(balances, num);
437
}
438
439
function balancesGetNext(uint256 num) public view returns(uint256) {
440
return IterableMapping.iterate_next(balances, num);
441
}
442
function balancesGetValue(uint256 num) public view returns(address, uint256) {
443
address key;
444
uint256 value;
445
(key, value) = IterableMapping.iterate_get(balances, num);
446
return (key, value);
447
}
448
}
Copied!

编辑和编译合约

使用remix在线编辑器 编辑以及编译上述合约。注意选择相应的编译器版本与合约一致。

【注意:使用Seele部署合约,建议使用的solidity版本为0.4.24-0.4.26。】

    获得IterableMapping的字节码
    点击remix右侧的run,选择合约IterableMapping,点击Deploy,
    可以看到日志窗口的部署详情,复制input内容,即为IterableMapping的字节码。
1
0x610646610030600b82828239805160001a6073146000811461002057610022565bfe5b5030600052607381538281f300730000000000000000000000000000000000000000301460806040526004361061008f576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680634c5e1cae1461009457806375a3e8e8146100e857806388d0443714610159578063a21ab71614610197578063ab517b4f146101cb578063c8fccc691461023a575b600080fd5b6100d260048036038101908080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061027c565b6040518082815260200191505060405180910390f35b61011060048036038101908080359060200190929190803590602001909291905050506102cb565b604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390f35b610181600480360381019080803590602001909291908035906020019092919050505061035d565b6040518082815260200191505060405180910390f35b6101b5600480360381019080803590602001909291905050506103c6565b6040518082815260200191505060405180910390f35b8180156101d757600080fd5b5061022060048036038101908080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506103f9565b604051808215151515815260200191505060405180910390f35b6102626004803603810190808035906020019092919080359060200190929190505050610580565b604051808215151515815260200191505060405180910390f35b60008260000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010154905092915050565b60008083600101838154811015156102df57fe5b9060005260206000200160000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1691508360000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001015490509250929050565b60008082905080806001019150505b8360010180549050811080156103aa5750836001018181548110151561038e57fe5b9060005260206000200160000160149054906101000a900460ff165b156103bc57808060010191505061036c565b8091505092915050565b60006103f2827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff61035d565b9050919050565b6000808460000160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001549050828560000160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010181905550600081111561049e5760019150610578565b8460010180548091906001016104b49190610594565b9050600181018560000160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000018190555083856001018281548110151561051457fe5b9060005260206000200160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508460020160008154809291906001019190505550600091505b509392505050565b600082600101805490508210905092915050565b8154818355818111156105bb578183600052602060002091820191016105ba91906105c0565b5b505050565b61061791905b8082111561061357600080820160006101000a81549073ffffffffffffffffffffffffffffffffffffffff02191690556000820160146101000a81549060ff0219169055506001016105c6565b5090565b905600a165627a7a72305820b794fd1c17a9ff0d50981b40ff2dd307a38ab6776bc963e8a4bff7df0b11f5170029
Copied!
同时日志中还显示了部署后该合约地址0x5e72914535f202659083db3a02c984188fa26e9f
    获得LKBT合约字节码
    在remix右侧回到compile窗口,选择LKBT合约,点击bytecode将复制该合约编译后信息,将该内容粘贴在一个文本编辑器内。
    这是一个JSON格式的数据,其中object字段值即为合约的字节码。
【图:LKBT byteCode.png】
1
60806040526000600560146101000a81548160ff0219169083151502179055506040805190810160405280600a81526020017f4c4b425420546f6b656e00000000000000000000000000000000000000000000815250600690805190602001906200006c92919062000227565b506040805190810160405280600481526020017f4c4b42540000000000000000000000000000000000000000000000000000000081525060079080519060200190620000ba92919062000227565b506012600860006101000a81548160ff021916908360ff1602179055506402540be400600955348015620000ed57600080fd5b5033600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060095460038190555073__browser/LKBTCoin.sol:IterableMapping__63ab517b4f6000336009546040518463ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808481526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001828152602001935050505060206040518083038186803b158015620001e357600080fd5b505af4158015620001f8573d6000803e3d6000fd5b505050506040513d60208110156200020f57600080fd5b810190808051906020019092919050505050620002d6565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106200026a57805160ff19168380011785556200029b565b828001600101855582156200029b579182015b828111156200029a5782518255916020019190600101906200027d565b5b509050620002aa9190620002ae565b5090565b620002d391905b80821115620002cf576000816000905550600101620002b5565b5090565b90565b612b7f80620002e66000396000f30060806040526004361061011d576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde0314610122578063095ea7b3146101b257806318160ddd1461021757806323b872dd146102425780632ff2e9dc146102c7578063313ce567146102f25780633f4ba83a146103235780635c975abb1461033a578063661884631461036957806370a08231146103ce5780637e0c5747146104255780638456cb59146104995780638da5cb5b146104b057806395d89b4114610507578063a9059cbb14610597578063b8ba5c20146105fc578063cf2adac814610627578063d1505c5d14610668578063d73dd623146106ad578063dd62ed3e14610712578063f2fde38b14610789575b600080fd5b34801561012e57600080fd5b506101376107cc565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561017757808201518184015260208101905061015c565b50505050905090810190601f1680156101a45780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101be57600080fd5b506101fd600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061086a565b604051808215151515815260200191505060405180910390f35b34801561022357600080fd5b5061022c610929565b6040518082815260200191505060405180910390f35b34801561024e57600080fd5b506102ad600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610933565b604051808215151515815260200191505060405180910390f35b3480156102d357600080fd5b506102dc6109f4565b6040518082815260200191505060405180910390f35b3480156102fe57600080fd5b506103076109fa565b604051808260ff1660ff16815260200191505060405180910390f35b34801561032f57600080fd5b50610338610a0d565b005b34801561034657600080fd5b5061034f610beb565b604051808215151515815260200191505060405180910390f35b34801561037557600080fd5b506103b4600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610bfe565b604051808215151515815260200191505060405180910390f35b3480156103da57600080fd5b5061040f600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610cbd565b6040518082815260200191505060405180910390f35b34801561043157600080fd5b5061045060048036038101908080359060200190929190505050610da1565b604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390f35b3480156104a557600080fd5b506104ae610e74565b005b3480156104bc57600080fd5b506104c5611053565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561051357600080fd5b5061051c611079565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561055c578082015181840152602081019050610541565b50505050905090810190601f1680156105895780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156105a357600080fd5b506105e2600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611117565b604051808215151515815260200191505060405180910390f35b34801561060857600080fd5b506106116111d6565b6040518082815260200191505060405180910390f35b34801561063357600080fd5b5061065260048036038101908080359060200190929190505050611284565b6040518082815260200191505060405180910390f35b34801561067457600080fd5b506106936004803603810190808035906020019092919050505061133c565b604051808215151515815260200191505060405180910390f35b3480156106b957600080fd5b506106f8600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506113f4565b604051808215151515815260200191505060405180910390f35b34801561071e57600080fd5b50610773600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506114b3565b6040518082815260200191505060405180910390f35b34801561079557600080fd5b506107ca600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061153a565b005b60068054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108625780601f1061083757610100808354040283529160200191610862565b820191906000526020600020905b81548152906001019060200180831161084557829003601f168201915b505050505081565b6000600560149054906101000a900460ff16151515610917576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260288152602001807f63616c6c61626c65207768656e2074686520636f6e7472616374206973206e6f81526020017f742070617573656400000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b610921838361178a565b905092915050565b6000600354905090565b6000600560149054906101000a900460ff161515156109e0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260288152602001807f63616c6c61626c65207768656e2074686520636f6e7472616374206973206e6f81526020017f742070617573656400000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b6109eb84848461187c565b90509392505050565b60095481565b600860009054906101000a900460ff1681565b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610af8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602a8152602001807f63616c6c656420627920616e79206163636f756e74206f74686572207468616e81526020017f20746865206f776e65720000000000000000000000000000000000000000000081525060400191505060405180910390fd5b600560149054906101000a900460ff161515610ba2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260248152602001807f63616c6c61626c65207768656e2074686520636f6e747261637420697320706181526020017f757365640000000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b6000600560146101000a81548160ff0219169083151502179055507f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3360405160405180910390a1565b600560149054906101000a900460ff1681565b6000600560149054906101000a900460ff16151515610cab576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260288152602001807f63616c6c61626c65207768656e2074686520636f6e7472616374206973206e6f81526020017f742070617573656400000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b610cb58383612088565b905092915050565b600073__browser/LKBTCoin.sol:IterableMapping__634c5e1cae6000846040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808381526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019250505060206040518083038186803b158015610d5f57600080fd5b505af4158015610d73573d6000803e3d6000fd5b505050506040513d6020811015610d8957600080fd5b81019080805190602001909291905050509050919050565b60008060008073__browser/LKBTCoin.sol:IterableMapping__6375a3e8e86000876040518363ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018083815260200182815260200192505050604080518083038186803b158015610e1a57600080fd5b505af4158015610e2e573d6000803e3d6000fd5b505050506040513d6040811015610e4457600080fd5b81019080805190602001909291908051906020019092919050505080925081935050508181935093505050915091565b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610f5f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602a8152602001807f63616c6c656420627920616e79206163636f756e74206f74686572207468616e81526020017f20746865206f776e65720000000000000000000000000000000000000000000081525060400191505060405180910390fd5b600560149054906101000a900460ff1615151561100a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260288152602001807f63616c6c61626c65207768656e2074686520636f6e7472616374206973206e6f81526020017f742070617573656400000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b6001600560146101000a81548160ff0219169083151502179055507f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62560405160405180910390a1565b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60078054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561110f5780601f106110e45761010080835404028352916020019161110f565b820191906000526020600020905b8154815290600101906020018083116110f257829003601f168201915b505050505081565b6000600560149054906101000a900460ff161515156111c4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260288152602001807f63616c6c61626c65207768656e2074686520636f6e7472616374206973206e6f81526020017f742070617573656400000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b6111ce838361231a565b905092915050565b600073__browser/LKBTCoin.sol:IterableMapping__63a21ab71660006040518263ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018082815260200191505060206040518083038186803b15801561124457600080fd5b505af4158015611258573d6000803e3d6000fd5b505050506040513d602081101561126e57600080fd5b8101908080519060200190929190505050905090565b600073__browser/LKBTCoin.sol:IterableMapping__6388d044376000846040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808381526020018281526020019250505060206040518083038186803b1580156112fa57600080fd5b505af415801561130e573d6000803e3d6000fd5b505050506040513d602081101561132457600080fd5b81019080805190602001909291905050509050919050565b600073__browser/LKBTCoin.sol:IterableMapping__63c8fccc696000846040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808381526020018281526020019250505060206040518083038186803b1580156113b257600080fd5b505af41580156113c6573d6000803e3d6000fd5b505050506040513d60208110156113dc57600080fd5b81019080805190602001909291905050509050919050565b6000600560149054906101000a900460ff161515156114a1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260288152602001807f63616c6c61626c65207768656e2074686520636f6e7472616374206973206e6f81526020017f742070617573656400000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b6114ab8383612922565b905092915050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611625576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602a8152602001807f63616c6c656420627920616e79206163636f756e74206f74686572207468616e81526020017f20746865206f776e65720000000000000000000000000000000000000000000081525060400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141515156116ca576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f6f776e657220616464726573732073686f756c64206e6f74203000000000000081525060200191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff16600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600081600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b600073__browser/LKBTCoin.sol:IterableMapping__634c5e1cae6000866040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808381526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019250505060206040518083038186803b15801561191e57600080fd5b505af4158015611932573d6000803e3d6000fd5b505050506040513d602081101561194857600080fd5b810190808051906020019092919050505082111515156119d0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260128152602001807f62616c616e6365206e6f7420656e6f756768000000000000000000000000000081525060200191505060405180910390fd5b600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515611ac4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260128152602001807f62616c616e6365206e6f7420656e6f756768000000000000000000000000000081525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515611b69576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f302061646472657373206e6f7420616c6c6f770000000000000000000000000081525060200191505060405180910390fd5b73__browser/LKBTCoin.sol:IterableMapping__63ab517b4f600086611c738673__browser/LKBTCoin.sol:IterableMapping__634c5e1cae60008c6040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808381526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019250505060206040518083038186803b158015611c2a57600080fd5b505af4158015611c3e573d6000803e3d6000fd5b505050506040513d6020811015611c5457600080fd5b8101908080519060200190929190505050612b1e90919063ffffffff16565b6040518463ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808481526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001828152602001935050505060206040518083038186803b158015611cfd57600080fd5b505af4158015611d11573d6000803e3d6000fd5b505050506040513d6020811015611d2757600080fd5b81019080805190602001909291905050505073__browser/LKBTCoin.sol:IterableMapping__63ab517b4f600085611e438673__browser/LKBTCoin.sol:IterableMapping__634c5e1cae60008b6040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808381526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019250505060206040518083038186803b158015611dfa57600080fd5b505af4158015611e0e573d6000803e3d6000fd5b505050506040513d6020811015611e2457600080fd5b8101908080519060200190929190505050612b3790919063ffffffff16565b6040518463ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808481526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001828152602001935050505060206040518083038186803b158015611ecd57600080fd5b505af4158015611ee1573d6000803e3d6000fd5b505050506040513d6020811015611ef757600080fd5b810190808051906020019092919050505050611f9882600460008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612b1e90919063ffffffff16565b600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b600080600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050808310151561219a576000600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061222e565b6121ad8382612b1e90919063ffffffff16565b600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b600073__browser/LKBTCoin.sol:IterableMapping__634c5e1cae6000336040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808381526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019250505060206040518083038186803b1580156123bc57600080fd5b505af41580156123d0573d6000803e3d6000fd5b505050506040513d60208110156123e657600080fd5b8101908080519060200190929190505050821115151561246e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f6e6f7420656e6f7567682062616c616e6365730000000000000000000000000081525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515612513576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f302061646472657373206e6f7420616c6c6f770000000000000000000000000081525060200191505060405180910390fd5b73__browser/LKBTCoin.sol:IterableMapping__63ab517b4f60003361261d8673__browser/LKBTCoin.sol:IterableMapping__634c5e1cae6000336040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808381526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019250505060206040518083038186803b1580156125d457600080fd5b505af41580156125e8573d6000803e3d6000fd5b505050506040513d60208110156125fe57600080fd5b8101908080519060200190929190505050612b1e90919063ffffffff16565b6040518463ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808481526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001828152602001935050505060206040518083038186803b1580156126a757600080fd5b505af41580156126bb573d6000803e3d6000fd5b505050506040513d60208110156126d157600080fd5b81019080805190602001909291905050505073__browser/LKBTCoin.sol:IterableMapping__63ab517b4f6000856127ed8673__browser/LKBTCoin.sol:IterableMapping__634c5e1cae60008b6040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808381526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019250505060206040518083038186803b1580156127a457600080fd5b505af41580156127b8573d6000803e3d6000fd5b505050506040513d60208110156127ce57600080fd5b8101908080519060200190929190505050612b3790919063ffffffff16565b6040518463ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808481526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001828152602001935050505060206040518083038186803b15801561287757600080fd5b505af415801561288b573d6000803e3d6000fd5b505050506040513d60208110156128a157600080fd5b8101908080519060200190929190505050508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b60006129b382600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612b3790919063ffffffff16565b600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000828211151515612b2c57fe5b818303905092915050565b60008183019050828110151515612b4a57fe5b809050929150505600a165627a7a7230582092e657485de4860937d530e1dd266cbb89b3c5b7f6be05431dee37e7120331cc0029
Copied!
这里字节码内容中,包含了一部分特殊内容_browser/LKBTCoin.sol:IterableMapping_\,这是因为该合约引用了IterableMapping。 将该部分内容替换为IterableMapping合约的地址,即是该合约最终部署的字节码内容。

部署合约

部署合约前提须知

    1.
    在部署合约之前,请先确保你正确的运行了Seele node全节点,并同步到当前最新区块高度。
    2.
    请确认你希望将合约部署到哪个分片(分片1 - 分片4)
    3.
    请确认你在该分片拥有一个账户,并且该账户内有足够的余额用于合约部署
本示例将使用一个分片4的账户,将合约部署到分片4。

示例合约部署步骤

    1.
    部署IterableMapping合约
    1
    ./client sendtx --amount 0 --from 0x2491daa1d3df8a0b84027eb75db328f1300557f1-shard4.json --gas 20000000 --payload 0x610646610030600b82828239805160001a6073146000811461002057610022565bfe5b5030600052607381538281f300730000000000000000000000000000000000000000301460806040526004361061008f576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680634c5e1cae1461009457806375a3e8e8146100e857806388d0443714610159578063a21ab71614610197578063ab517b4f146101cb578063c8fccc691461023a575b600080fd5b6100d260048036038101908080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061027c565b6040518082815260200191505060405180910390f35b61011060048036038101908080359060200190929190803590602001909291905050506102cb565b604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390f35b610181600480360381019080803590602001909291908035906020019092919050505061035d565b6040518082815260200191505060405180910390f35b6101b5600480360381019080803590602001909291905050506103c6565b6040518082815260200191505060405180910390f35b8180156101d757600080fd5b5061022060048036038101908080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506103f9565b604051808215151515815260200191505060405180910390f35b6102626004803603810190808035906020019092919080359060200190929190505050610580565b604051808215151515815260200191505060405180910390f35b60008260000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010154905092915050565b60008083600101838154811015156102df57fe5b9060005260206000200160000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1691508360000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001015490509250929050565b60008082905080806001019150505b8360010180549050811080156103aa5750836001018181548110151561038e57fe5b9060005260206000200160000160149054906101000a900460ff165b156103bc57808060010191505061036c565b8091505092915050565b60006103f2827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff61035d565b9050919050565b6000808460000160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001549050828560000160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010181905550600081111561049e5760019150610578565b8460010180548091906001016104b49190610594565b9050600181018560000160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000018190555083856001018281548110151561051457fe5b9060005260206000200160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508460020160008154809291906001019190505550600091505b509392505050565b600082600101805490508210905092915050565b8154818355818111156105bb578183600052602060002091820191016105ba91906105c0565b5b505050565b61061791905b8082111561061357600080820160006101000a81549073ffffffffffffffffffffffffffffffffffffffff02191690556000820160146101000a81549060ff0219169055506001016105c6565b5090565b905600a165627a7a72305820b794fd1c17a9ff0d50981b40ff2dd307a38ab6776bc963e8a4bff7df0b11f5170029 -a 127.0.0.1:8026
    Copied!
    执行结果:
    1
    account: 0x2491daa1d3df8a0b84027eb75db328f1300557f1, transaction nonce: 3
    2
    transaction sent successfully
    3
    {
    4
    "Hash": "0x66419b4dcb8312c2c1f7a89036987d6bbcadb1113653e43db3f0f76ee62a9587",
    5
    "Data": {
    6
    "Type": 0,
    7
    "From": "0x2491daa1d3df8a0b84027eb75db328f1300557f1",
    8
    "To": "0x0000000000000000000000000000000000000000",
    9
    "Amount": 0,
    10
    "AccountNonce": 3,
    11
    "GasPrice": 10,
    12
    "GasLimit": 20000000,
    13
    "Timestamp": 0,
    14
    "Payload": "0x610646610030600b82828239805160001a6073146000811461002057610022565bfe5b5030600052607381538281f300730000000000000000000000000000000000000000301460806040526004361061008f576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680634c5e1cae1461009457806375a3e8e8146100e857806388d0443714610159578063a21ab71614610197578063ab517b4f146101cb578063c8fccc691461023a575b600080fd5b6100d260048036038101908080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061027c565b6040518082815260200191505060405180910390f35b61011060048036038101908080359060200190929190803590602001909291905050506102cb565b604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390f35b610181600480360381019080803590602001909291908035906020019092919050505061035d565b6040518082815260200191505060405180910390f35b6101b5600480360381019080803590602001909291905050506103c6565b6040518082815260200191505060405180910390f35b8180156101d757600080fd5b5061022060048036038101908080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506103f9565b604051808215151515815260200191505060405180910390f35b6102626004803603810190808035906020019092919080359060200190929190505050610580565b604051808215151515815260200191505060405180910390f35b60008260000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010154905092915050565b60008083600101838154811015156102df57fe5b9060005260206000200160000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1691508360000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001015490509250929050565b60008082905080806001019150505b8360010180549050811080156103aa5750836001018181548110151561038e57fe5b9060005260206000200160000160149054906101000a900460ff165b156103bc57808060010191505061036c565b8091505092915050565b60006103f2827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff61035d565b9050919050565b6000808460000160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001549050828560000160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010181905550600081111561049e5760019150610578565b8460010180548091906001016104b49190610594565b9050600181018560000160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000018190555083856001018281548110151561051457fe5b9060005260206000200160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508460020160008154809291906001019190505550600091505b509392505050565b600082600101805490508210905092915050565b8154818355818111156105bb578183600052602060002091820191016105ba91906105c0565b5b505050565b61061791905b8082111561061357600080820160006101000a81549073ffffffffffffffffffffffffffffffffffffffff02191690556000820160146101000a81549060ff0219169055506001016105c6565b5090565b905600a165627a7a72305820b794fd1c17a9ff0d50981b40ff2dd307a38ab6776bc963e8a4bff7df0b11f5170029"
    15
    },
    16
    "Signature": {
    17
    "Sig": "Yl1HZUwfjkwQk/8CjwP4PKuAdek+d91PDA0h2XLAc5d7fBJSabf2zhqRGHam223psQaMNbmbFaZfeSy3iMGH/wA="
    18
    }
    19
    }
    Copied!
1
./client getreceipt --hash 0x66419b4dcb8312c2c1f7a89036987d6bbcadb1113653e43db3f0f76ee62a9587 -a localhost:8026
Copied!
查询receipt结果:
1
{
2
"contract": "0xbab79f5f0d136db78e5df967a48006f1d5360032",
3
"failed": false,
4
"poststate": "0x179fcde02a3d218e83e78572e38a35d22ccc80d4664873da5414ad247627b622",
5
"result": "0x73bab79f5f0d136db78e5df967a48006f1d5360032301460806040526004361061008f576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680634c5e1cae1461009457806375a3e8e8146100e857806388d0443714610159578063a21ab71614610197578063ab517b4f146101cb578063c8fccc691461023a575b600080fd5b6100d260048036038101908080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061027c565b6040518082815260200191505060405180910390f35b61011060048036038101908080359060200190929190803590602001909291905050506102cb565b604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390f35b610181600480360381019080803590602001909291908035906020019092919050505061035d565b6040518082815260200191505060405180910390f35b6101b5600480360381019080803590602001909291905050506103c6565b6040518082815260200191505060405180910390f35b8180156101d757600080fd5b5061022060048036038101908080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506103f9565b604051808215151515815260200191505060405180910390f35b6102626004803603810190808035906020019092919080359060200190929190505050610580565b604051808215151515815260200191505060405180910390f35b60008260000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010154905092915050565b60008083600101838154811015156102df57fe5b9060005260206000200160000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1691508360000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001015490509250929050565b60008082905080806001019150505b8360010180549050811080156103aa5750836001018181548110151561038e57fe5b9060005260206000200160000160149054906101000a900460ff165b156103bc57808060010191505061036c565b8091505092915050565b60006103f2827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff61035d565b9050919050565b6000808460000160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001549050828560000160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010181905550600081111561049e5760019150610578565b8460010180548091906001016104b49190610594565b9050600181018560000160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000018190555083856001018281548110151561051457fe5b9060005260206000200160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508460020160008154809291906001019190505550600091505b509392505050565b600082600101805490508210905092915050565b8154818355818111156105bb578183600052602060002091820191016105ba91906105c0565b5b505050565b61061791905b8082111561061357600080820160006101000a81549073ffffffffffffffffffffffffffffffffffffffff02191690556000820160146101000a81549060ff0219169055506001016105c6565b5090565b905600a165627a7a72305820b794fd1c17a9ff0d50981b40ff2dd307a38ab6776bc963e8a4bff7df0b11f5170029",
6
"totalFee": 4479770,
7
"txhash": "0x66419b4dcb8312c2c1f7a89036987d6bbcadb1113653e43db3f0f76ee62a9587",
8
"usedGas": 447977
9
}
Copied!
failed为false,说明合约部署成功,合约地址0xbab79f5f0d136db78e5df967a48006f1d5360032。 可在Seele Scan查询到该合约
    1.
    部署LKBT合约
    将编译步骤中得到的LKBT合约的字节码中_browser/LKBTCoin.sol:IterableMapping_\,替换为上一步骤中的合约地址bab79f5f0d136db78e5df967a48006f1d5360032。
    1
    ./client sendtx --amount 0 --from 0x2491daa1d3df8a0b84027eb75db328f1300557f1-shard4.json --gas 200000000 --payload 0x60806040526000600560146101000a81548160ff0219169083151502179055506040805190810160405280600a81526020017f4c4b425420546f6b656e00000000000000000000000000000000000000000000815250600690805190602001906200006c92919062000227565b506040805190810160405280600481526020017f4c4b42540000000000000000000000000000000000000000000000000000000081525060079080519060200190620000ba92919062000227565b506012600860006101000a81548160ff021916908360ff1602179055506402540be400600955348015620000ed57600080fd5b5033600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060095460038190555073bab79f5f0d136db78e5df967a48006f1d536003263ab517b4f6000336009546040518463ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808481526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001828152602001935050505060206040518083038186803b158015620001e357600080fd5b505af4158015620001f8573d6000803e3d6000fd5b505050506040513d60208110156200020f57600080fd5b810190808051906020019092919050505050620002d6565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106200026a57805160ff19168380011785556200029b565b828001600101855582156200029b579182015b828111156200029a5782518255916020019190600101906200027d565b5b509050620002aa9190620002ae565b5090565b620002d391905b80821115620002cf576000816000905550600101620002b5565b5090565b90565b612b7f80620002e66000396000f30060806040526004361061011d576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde0314610122578063095ea7b3146101b257806318160ddd1461021757806323b872dd146102425780632ff2e9dc146102c7578063313ce567146102f25780633f4ba83a146103235780635c975abb1461033a578063661884631461036957806370a08231146103ce5780637e0c5747146104255780638456cb59146104995780638da5cb5b146104b057806395d89b4114610507578063a9059cbb14610597578063b8ba5c20146105fc578063cf2adac814610627578063d1505c5d14610668578063d73dd623146106ad578063dd62ed3e14610712578063f2fde38b14610789575b600080fd5b34801561012e57600080fd5b506101376107cc565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561017757808201518184015260208101905061015c565b50505050905090810190601f1680156101a45780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101be57600080fd5b506101fd600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061086a565b604051808215151515815260200191505060405180910390f35b34801561022357600080fd5b5061022c610929565b6040518082815260200191505060405180910390f35b34801561024e57600080fd5b506102ad600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610933565b604051808215151515815260200191505060405180910390f35b3480156102d357600080fd5b506102dc6109f4565b6040518082815260200191505060405180910390f35b3480156102fe57600080fd5b506103076109fa565b604051808260ff1660ff16815260200191505060405180910390f35b34801561032f57600080fd5b50610338610a0d565b005b34801561034657600080fd5b5061034f610beb565b604051808215151515815260200191505060405180910390f35b34801561037557600080fd5b506103b4600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610bfe565b604051808215151515815260200191505060405180910390f35b3480156103da57600080fd5b5061040f600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610cbd565b6040518082815260200191505060405180910390f35b34801561043157600080fd5b5061045060048036038101908080359060200190929190505050610da1565b604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390f35b3480156104a557600080fd5b506104ae610e74565b005b3480156104bc57600080fd5b506104c5611053565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561051357600080fd5b5061051c611079565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561055c578082015181840152602081019050610541565b50505050905090810190601f1680156105895780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156105a357600080fd5b506105e2600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611117565b604051808215151515815260200191505060405180910390f35b34801561060857600080fd5b506106116111d6565b6040518082815260200191505060405180910390f35b34801561063357600080fd5b5061065260048036038101908080359060200190929190505050611284565b6040518082815260200191505060405180910390f35b34801561067457600080fd5b506106936004803603810190808035906020019092919050505061133c565b604051808215151515815260200191505060405180910390f35b3480156106b957600080fd5b506106f8600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506113f4565b604051808215151515815260200191505060405180910390f35b34801561071e57600080fd5b50610773600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506114b3565b6040518082815260200191505060405180910390f35b34801561079557600080fd5b506107ca600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061153a565b005b60068054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108625780601f1061083757610100808354040283529160200191610862565b820191906000526020600020905b81548152906001019060200180831161084557829003601f168201915b505050505081565b6000600560149054906101000a900460ff16151515610917576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260288152602001807f63616c6c61626c65207768656e2074686520636f6e7472616374206973206e6f81526020017f742070617573656400000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b610921838361178a565b905092915050565b6000600354905090565b6000600560149054906101000a900460ff161515156109e0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260288152602001807f63616c6c61626c65207768656e2074686520636f6e7472616374206973206e6f81526020017f742070617573656400000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b6109eb84848461187c565b90509392505050565b60095481565b600860009054906101000a900460ff1681565b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610af8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602a8152602001807f63616c6c656420627920616e79206163636f756e74206f74686572207468616e81526020017f20746865206f776e65720000000000000000000000000000000000000000000081525060400191505060405180910390fd5b600560149054906101000a900460ff161515610ba2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260248152602001807f63616c6c61626c65207768656e2074686520636f6e747261637420697320706181526020017f757365640000000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b6000600560146101000a81548160ff0219169083151502179055507f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3360405160405180910390a1565b600560149054906101000a900460ff1681565b6000600560149054906101000a900460ff16151515610cab576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260288152602001807f63616c6c61626c65207768656e2074686520636f6e7472616374206973206e6f81526020017f742070617573656400000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b610cb58383612088565b905092915050565b600073bab79f5f0d136db78e5df967a48006f1d5360032634c5e1cae6000846040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808381526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019250505060206040518083038186803b158015610d5f57600080fd5b505af4158015610d73573d6000803e3d6000fd5b505050506040513d6020811015610d8957600080fd5b81019080805190602001909291905050509050919050565b60008060008073bab79f5f0d136db78e5df967a48006f1d53600326375a3e8e86000876040518363ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018083815260200182815260200192505050604080518083038186803b158015610e1a57600080fd5b505af4158015610e2e573d6000803e3d6000fd5b505050506040513d6040811015610e4457600080fd5b81019080805190602001909291908051906020019092919050505080925081935050508181935093505050915091565b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610f5f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602a8152602001807f63616c6c656420627920616e79206163636f756e74206f74686572207468616e81526020017f20746865206f776e65720000000000000000000000000000000000000000000081525060400191505060405180910390fd5b600560149054906101000a900460ff1615151561100a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260288152602001807f63616c6c61626c65207768656e2074686520636f6e7472616374206973206e6f81526020017f742070617573656400000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b6001600560146101000a81548160ff0219169083151502179055507f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62560405160405180910390a1565b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60078054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561110f5780601f106110e45761010080835404028352916020019161110f565b820191906000526020600020905b8154815290600101906020018083116110f257829003601f168201915b505050505081565b6000600560149054906101000a900460ff161515156111c4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260288152602001807f63616c6c61626c65207768656e2074686520636f6e7472616374206973206e6f81526020017f742070617573656400000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b6111ce838361231a565b905092915050565b600073bab79f5f0d136db78e5df967a48006f1d536003263a21ab71660006040518263ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018082815260200191505060206040518083038186803b15801561124457600080fd5b505af4158015611258573d6000803e3d6000fd5b505050506040513d602081101561126e57600080fd5b8101908080519060200190929190505050905090565b600073bab79f5f0d136db78e5df967a48006f1d53600326388d044376000846040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808381526020018281526020019250505060206040518083038186803b1580156112fa57600080fd5b505af415801561130e573d6000803e3d6000fd5b505050506040513d602081101561132457600080fd5b81019080805190602001909291905050509050919050565b600073bab79f5f0d136db78e5df967a48006f1d536003263c8fccc696000846040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808381526020018281526020019250505060206040518083038186803b1580156113b257600080fd5b505af41580156113c6573d6000803e3d6000fd5b505050506040513d60208110156113dc57600080fd5b81019080805190602001909291905050509050919050565b6000600560149054906101000a900460ff161515156114a1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260288152602001807f63616c6c61626c65207768656e2074686520636f6e7472616374206973206e6f81526020017f742070617573656400000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b6114ab8383612922565b905092915050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611625576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602a8152602001807f63616c6c656420627920616e79206163636f756e74206f74686572207468616e81526020017f20746865206f776e65720000000000000000000000000000000000000000000081525060400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141515156116ca576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f6f776e657220616464726573732073686f756c64206e6f74203000000000000081525060200191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff16600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600081600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b600073bab79f5f0d136db78e5df967a48006f1d5360032634c5e1cae6000866040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808381526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019250505060206040518083038186803b15801561191e57600080fd5b505af4158015611932573d6000803e3d6000fd5b505050506040513d602081101561194857600080fd5b810190808051906020019092919050505082111515156119d0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260128152602001807f62616c616e6365206e6f7420656e6f756768000000000000000000000000000081525060200191505060405180910390fd5b600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515611ac4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260128152602001807f62616c616e6365206e6f7420656e6f756768000000000000000000000000000081525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515611b69576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f302061646472657373206e6f7420616c6c6f770000000000000000000000000081525060200191505060405180910390fd5b73bab79f5f0d136db78e5df967a48006f1d536003263ab517b4f600086611c738673bab79f5f0d136db78e5df967a48006f1d5360032634c5e1cae60008c6040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808381526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019250505060206040518083038186803b158015611c2a57600080fd5b505af4158015611c3e573d6000803e3d6000fd5b505050506040513d6020811015611c5457600080fd5b8101908080519060200190929190505050612b1e90919063ffffffff16565b6040518463ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808481526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001828152602001935050505060206040518083038186803b158015611cfd57600080fd5b505af4158015611d11573d6000803e3d6000fd5b505050506040513d6020811015611d2757600080fd5b81019080805190602001909291905050505073bab79f5f0d136db78e5df967a48006f1d536003263ab517b4f600085611e438673bab79f5f0d136db78e5df967a48006f1d5360032634c5e1cae60008b6040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808381526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019250505060206040518083038186803b158015611dfa57600080fd5b505af4158015611e0e573d6000803e3d6000fd5b505050506040513d6020811015611e2457600080fd5b8101908080519060200190929190505050612b3790919063ffffffff16565b6040518463ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808481526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001828152602001935050505060206040518083038186803b158015611ecd57600080fd5b505af4158015611ee1573d6000803e3d6000fd5b505050506040513d6020811015611ef757600080fd5b810190808051906020019092919050505050611f9882600460008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612b1e90919063ffffffff16565b600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b600080600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050808310151561219a576000600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061222e565b6121ad8382612b1e90919063ffffffff16565b600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b600073bab79f5f0d136db78e5df967a48006f1d5360032634c5e1cae6000336040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808381526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019250505060206040518083038186803b1580156123bc57600080fd5b505af41580156123d0573d6000803e3d6000fd5b505050506040513d60208110156123e657600080fd5b8101908080519060200190929190505050821115151561246e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f6e6f7420656e6f7567682062616c616e6365730000000000000000000000000081525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515612513576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f302061646472657373206e6f7420616c6c6f770000000000000000000000000081525060200191505060405180910390fd5b73bab79f5f0d136db78e5df967a48006f1d536003263ab517b4f60003361261d8673bab79f5f0d136db78e5df967a48006f1d5360032634c5e1cae6000336040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808381526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019250505060206040518083038186803b1580156125d457600080fd5b505af41580156125e8573d6000803e3d6000fd5b505050506040513d60208110156125fe57600080fd5b8101908080519060200190929190505050612b1e90919063ffffffff16565b6040518463ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808481526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001828152602001935050505060206040518083038186803b1580156126a757600080fd5b505af41580156126bb573d6000803e3d6000fd5b505050506040513d60208110156126d157600080fd5b81019080805190602001909291905050505073bab79f5f0d136db78e5df967a48006f1d536003263ab517b4f6000856127ed8673bab79f5f0d136db78e5df967a48006f1d5360032634c5e1cae60008b6040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808381526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019250505060206040518083038186803b1580156127a457600080fd5b505af41580156127b8573d6000803e3d6000fd5b505050506040513d60208110156127ce57600080fd5b8101908080519060200190929190505050612b3790919063ffffffff16565b6040518463ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808481526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001828152602001935050505060206040518083038186803b15801561287757600080fd5b505af415801561288b573d6000803e3d6000fd5b505050506040513d60208110156128a157600080fd5b8101908080519060200190929190505050508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b60006129b382600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612b3790919063ffffffff16565b600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000828211151515612b2c57fe5b818303905092915050565b60008183019050828110151515612b4a57fe5b809050929150505600a165627a7a7230582092e657485de4860937d530e1dd266cbb89b3c5b7f6be05431dee37e7120331cc0029 -a localhost:8026
    Copied!
执行结果如下:
1
account: 0x2491daa1d3df8a0b84027eb75db328f1300557f1, transaction nonce: 4
2
transaction sent successfully
3
{
4
"Hash": "0x2102f7fc21038c875bde5a98b32084e232c7249093f33e4a21c49bb7017f4e75",
5
"Data": {
6
"Type": 0,
7
"From": "0x2491daa1d3df8a0b84027eb75db328f1300557f1",
8
"To": "0x0000000000000000000000000000000000000000",
9
"Amount": 0,
10
"AccountNonce": 4,
11
"GasPrice": 10,
12
"GasLimit": 200000000,
13
"Timestamp": 0,
14
"Payload": "0x6080604052600060056
15
...
16
e4860937d530e1dd266cbb89b3c5b7f6be05431dee37e7120331cc0029"
17
},
18
"Signature": {
19
"Sig": "GYWXGK03gZEy32mA4MfiOlnfWoAAGpH2fLbYx84hoeIFsQ9l27Bt9Jb4nUiN7dmfN3Kwq1qm7fTaGRQb4S+BKQE="
20
}
Copied!
查询receipt:
1
./client getreceipt --hash 0x2102f7fc21038c875bde5a98b32084e232c7249093f33e4a21c49bb7017f4e75 -a localhost:8026
Copied!
查询结果:
1
{
2
"contract": "0x8e7e21c581652b6522bd855b9e9471e237370012",
3
"failed": false,
4
"poststate": "0x3525f59a4df7eb0aa992b3e843fdc0a6cad228738c114316df513b1c1679d445",
5
"result": "0x60806040526004361061011d576000357c
6
...
7
0e1dd266cbb89b3c5b7f6be05431dee37e7120331cc0029",
8
"totalFee": 31897240,
9
"txhash": "0x2102f7fc21038c875bde5a98b32084e232c7249093f33e4a21c49bb7017f4e75",
10
"usedGas": 3189724
11
}
Copied!
可以看到查询结果failed为false,表明合约部署成功,合约地址0x8e7e21c581652b6522bd855b9e9471e237370012。
Last modified 1yr ago