@@ -126,46 +126,73 @@ Deposit some token to a recipient's account on L2 and call.
126
126
### depositETH
127
127
128
128
``` solidity
129
- function depositETH(address _to , uint256 _gasLimit) external payable
129
+ function depositETH(uint256 _amount , uint256 _gasLimit) external payable
130
130
```
131
131
132
- Deposit ETH to recipient ' ; s account in L2.
132
+ Deposit ETH to caller ' ; s account in L2.
133
133
134
134
135
135
136
136
#### Parameters
137
137
138
138
| Name | Type | Description |
139
139
| ---| ---| ---|
140
- | _ to | address | The address of recipient &# 39 ; s account on L2. |
141
- | _ gasLimit | uint256 | Gas limit required to complete the deposit on L2. |
140
+ | _ amount | uint256 | undefined |
141
+ | _ gasLimit | uint256 | undefined |
142
142
143
143
### depositETH
144
144
145
145
``` solidity
146
- function depositETH(uint256 _gasLimit) external payable
146
+ function depositETH(address _to, uint256 _amount, uint256 _gasLimit) external payable
147
147
```
148
148
149
- Deposit ETH to call ' ; s account in L2.
149
+ Deposit ETH to some recipient ' ; s account in L2.
150
150
151
151
152
152
153
153
#### Parameters
154
154
155
155
| Name | Type | Description |
156
156
| ---| ---| ---|
157
- | _ gasLimit | uint256 | Gas limit required to complete the deposit on L2. |
157
+ | _ to | address | undefined |
158
+ | _ amount | uint256 | undefined |
159
+ | _ gasLimit | uint256 | undefined |
160
+
161
+ ### depositETHAndCall
162
+
163
+ ``` solidity
164
+ function depositETHAndCall(address _to, uint256 _amount, bytes _data, uint256 _gasLimit) external payable
165
+ ```
166
+
167
+ Deposit ETH to some recipient' ; s account in L2 and call the target contract.
168
+
169
+
170
+
171
+ #### Parameters
172
+
173
+ | Name | Type | Description |
174
+ | ---| ---| ---|
175
+ | _ to | address | undefined |
176
+ | _ amount | uint256 | undefined |
177
+ | _ data | bytes | undefined |
178
+ | _ gasLimit | uint256 | undefined |
158
179
159
- ### finalizeDropMessage
180
+ ### ethGateway
160
181
161
182
``` solidity
162
- function finalizeDropMessage () external payable
183
+ function ethGateway () external view returns (address)
163
184
```
164
185
186
+ The address of L1ETHGateway.
165
187
166
188
167
189
168
190
191
+ #### Returns
192
+
193
+ | Name | Type | Description |
194
+ | ---| ---| ---|
195
+ | _ 0 | address | undefined |
169
196
170
197
### finalizeWithdrawERC20
171
198
@@ -191,21 +218,21 @@ Complete ERC20 withdraw from L2 to L1 and send fund to recipient's account i
191
218
### finalizeWithdrawETH
192
219
193
220
``` solidity
194
- function finalizeWithdrawETH(address _from , address _to , uint256 _amount , bytes _data ) external payable
221
+ function finalizeWithdrawETH(address, address, uint256, bytes) external payable
195
222
```
196
223
197
224
Complete ETH withdraw from L2 to L1 and send fund to recipient' ; s account in L1.
198
225
199
- * This function should only be called by L1ScrollMessenger. This function should also only be called by L2GatewayRouter in L2.*
226
+ * This function should only be called by L1ScrollMessenger. This function should also only be called by L1ETHGateway in L2.*
200
227
201
228
#### Parameters
202
229
203
230
| Name | Type | Description |
204
231
| ---| ---| ---|
205
- | _ from | address | The address of account who withdraw ETH in L2. |
206
- | _ to | address | The address of recipient in L1 to receive ETH. |
207
- | _ amount | uint256 | The amount of ETH to withdraw. |
208
- | _ data | bytes | Optional data to forward to recipient &# 39 ; s account. |
232
+ | _ 0 | address | undefined |
233
+ | _ 1 | address | undefined |
234
+ | _ 2 | uint256 | undefined |
235
+ | _ 3 | bytes | undefined |
209
236
210
237
### getERC20Gateway
211
238
@@ -254,28 +281,29 @@ Return the corresponding l2 token address given l1 token address.
254
281
### initialize
255
282
256
283
``` solidity
257
- function initialize(address _defaultERC20Gateway, address _counterpart, address _messenger) external nonpayable
284
+ function initialize(address _ethGateway, address _defaultERC20Gateway, address _counterpart, address _messenger) external nonpayable
258
285
```
259
286
260
-
287
+ Initialize the storage of L1GatewayRouter.
261
288
262
289
263
290
264
291
#### Parameters
265
292
266
293
| Name | Type | Description |
267
294
| ---| ---| ---|
268
- | _ defaultERC20Gateway | address | undefined |
269
- | _ counterpart | address | undefined |
270
- | _ messenger | address | undefined |
295
+ | _ ethGateway | address | The address of L1ETHGateway contract. |
296
+ | _ defaultERC20Gateway | address | The address of default ERC20 Gateway contract. |
297
+ | _ counterpart | address | The address of L2GatewayRouter in L2. |
298
+ | _ messenger | address | The address of L1ScrollMessenger. |
271
299
272
300
### messenger
273
301
274
302
``` solidity
275
303
function messenger() external view returns (address)
276
304
```
277
305
278
- The address of L1ScrollMessenger/L2ScrollMessenger contract.
306
+ The address of corresponding L1ScrollMessenger/L2ScrollMessenger contract.
279
307
280
308
281
309
@@ -364,6 +392,22 @@ Update the mapping from token address to gateway address.
364
392
| _ tokens | address[ ] | The list of addresses of tokens to update. |
365
393
| _ gateways | address[ ] | The list of addresses of gateways to update. |
366
394
395
+ ### setETHGateway
396
+
397
+ ``` solidity
398
+ function setETHGateway(address _ethGateway) external nonpayable
399
+ ```
400
+
401
+ Update the address of ETH gateway contract.
402
+
403
+ * This function should only be called by contract owner.*
404
+
405
+ #### Parameters
406
+
407
+ | Name | Type | Description |
408
+ | ---| ---| ---|
409
+ | _ ethGateway | address | The address to update. |
410
+
367
411
### transferOwnership
368
412
369
413
``` solidity
@@ -408,21 +452,21 @@ event DepositERC20(address indexed _l1Token, address indexed _l2Token, address i
408
452
### DepositETH
409
453
410
454
``` solidity
411
- event DepositETH(address indexed _from , address indexed _to , uint256 _amount , bytes _data )
455
+ event DepositETH(address indexed from , address indexed to , uint256 amount , bytes data )
412
456
```
413
457
414
-
458
+ Emitted when someone deposit ETH from L1 to L2.
415
459
416
460
417
461
418
462
#### Parameters
419
463
420
464
| Name | Type | Description |
421
465
| ---| ---| ---|
422
- | _ from ` indexed ` | address | undefined |
423
- | _ to ` indexed ` | address | undefined |
424
- | _ amount | uint256 | undefined |
425
- | _ data | bytes | undefined |
466
+ | from ` indexed ` | address | undefined |
467
+ | to ` indexed ` | address | undefined |
468
+ | amount | uint256 | undefined |
469
+ | data | bytes | undefined |
426
470
427
471
### FinalizeWithdrawERC20
428
472
@@ -448,21 +492,21 @@ event FinalizeWithdrawERC20(address indexed _l1Token, address indexed _l2Token,
448
492
### FinalizeWithdrawETH
449
493
450
494
``` solidity
451
- event FinalizeWithdrawETH(address indexed _from , address indexed _to , uint256 _amount , bytes _data )
495
+ event FinalizeWithdrawETH(address indexed from , address indexed to , uint256 amount , bytes data )
452
496
```
453
497
454
-
498
+ Emitted when ETH is withdrawn from L2 to L1 and transfer to recipient.
455
499
456
500
457
501
458
502
#### Parameters
459
503
460
504
| Name | Type | Description |
461
505
| ---| ---| ---|
462
- | _ from ` indexed ` | address | undefined |
463
- | _ to ` indexed ` | address | undefined |
464
- | _ amount | uint256 | undefined |
465
- | _ data | bytes | undefined |
506
+ | from ` indexed ` | address | undefined |
507
+ | to ` indexed ` | address | undefined |
508
+ | amount | uint256 | undefined |
509
+ | data | bytes | undefined |
466
510
467
511
### OwnershipTransferred
468
512
@@ -484,35 +528,51 @@ event OwnershipTransferred(address indexed previousOwner, address indexed newOwn
484
528
### SetDefaultERC20Gateway
485
529
486
530
``` solidity
487
- event SetDefaultERC20Gateway(address indexed _defaultERC20Gateway )
531
+ event SetDefaultERC20Gateway(address indexed defaultERC20Gateway )
488
532
```
489
533
490
-
534
+ Emitted when the address of default ERC20 Gateway is updated.
491
535
492
536
493
537
494
538
#### Parameters
495
539
496
540
| Name | Type | Description |
497
541
| ---| ---| ---|
498
- | _ defaultERC20Gateway ` indexed ` | address | undefined |
542
+ | defaultERC20Gateway ` indexed ` | address | The address of new default ERC20 Gateway. |
499
543
500
544
### SetERC20Gateway
501
545
502
546
``` solidity
503
- event SetERC20Gateway(address indexed _token , address indexed _gateway )
547
+ event SetERC20Gateway(address indexed token , address indexed gateway )
504
548
```
505
549
550
+ Emitted when the ` gateway ` for ` token ` is updated.
551
+
552
+
553
+
554
+ #### Parameters
555
+
556
+ | Name | Type | Description |
557
+ | ---| ---| ---|
558
+ | token ` indexed ` | address | The address of token updated. |
559
+ | gateway ` indexed ` | address | The corresponding address of gateway updated. |
560
+
561
+ ### SetETHGateway
562
+
563
+ ``` solidity
564
+ event SetETHGateway(address indexed ethGateway)
565
+ ```
506
566
567
+ Emitted when the address of ETH Gateway is updated.
507
568
508
569
509
570
510
571
#### Parameters
511
572
512
573
| Name | Type | Description |
513
574
| ---| ---| ---|
514
- | _ token ` indexed ` | address | undefined |
515
- | _ gateway ` indexed ` | address | undefined |
575
+ | ethGateway ` indexed ` | address | The address of new ETH Gateway. |
516
576
517
577
518
578
0 commit comments