Skip to content

Commit b64f88a

Browse files
authored
feat(contracts): bridge costs optimization (#1011)
1 parent 78cd0ae commit b64f88a

File tree

93 files changed

+3515
-980
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

93 files changed

+3515
-980
lines changed

docs/apis/L1ERC1155Gateway.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -550,3 +550,50 @@ Emitted when token mapping for ERC1155 token is updated.
550550

551551

552552

553+
## Errors
554+
555+
### ErrorCallerIsNotCounterpartGateway
556+
557+
```solidity
558+
error ErrorCallerIsNotCounterpartGateway()
559+
```
560+
561+
562+
563+
*Thrown when the cross chain sender is not the counterpart gateway contract.*
564+
565+
566+
### ErrorCallerIsNotMessenger
567+
568+
```solidity
569+
error ErrorCallerIsNotMessenger()
570+
```
571+
572+
573+
574+
*Thrown when the caller is not corresponding `L1ScrollMessenger` or `L2ScrollMessenger`.*
575+
576+
577+
### ErrorNotInDropMessageContext
578+
579+
```solidity
580+
error ErrorNotInDropMessageContext()
581+
```
582+
583+
584+
585+
*Thrown when ScrollMessenger is not dropping message.*
586+
587+
588+
### ErrorZeroAddress
589+
590+
```solidity
591+
error ErrorZeroAddress()
592+
```
593+
594+
595+
596+
*Thrown when the given address is `address(0)`.*
597+
598+
599+

docs/apis/L1ERC721Gateway.md

Lines changed: 48 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ function initialize(address _counterpart, address _messenger) external nonpayabl
149149

150150
Initialize the storage of L1ERC721Gateway.
151151

152-
152+
*The parameters `_counterpart` and `_messenger` are no longer used.*
153153

154154
#### Parameters
155155

@@ -489,3 +489,50 @@ Emitted when token mapping for ERC721 token is updated.
489489

490490

491491

492+
## Errors
493+
494+
### ErrorCallerIsNotCounterpartGateway
495+
496+
```solidity
497+
error ErrorCallerIsNotCounterpartGateway()
498+
```
499+
500+
501+
502+
*Thrown when the cross chain sender is not the counterpart gateway contract.*
503+
504+
505+
### ErrorCallerIsNotMessenger
506+
507+
```solidity
508+
error ErrorCallerIsNotMessenger()
509+
```
510+
511+
512+
513+
*Thrown when the caller is not corresponding `L1ScrollMessenger` or `L2ScrollMessenger`.*
514+
515+
516+
### ErrorNotInDropMessageContext
517+
518+
```solidity
519+
error ErrorNotInDropMessageContext()
520+
```
521+
522+
523+
524+
*Thrown when ScrollMessenger is not dropping message.*
525+
526+
527+
### ErrorZeroAddress
528+
529+
```solidity
530+
error ErrorZeroAddress()
531+
```
532+
533+
534+
535+
*Thrown when the given address is `address(0)`.*
536+
537+
538+

docs/apis/L1GatewayRouter.md

Lines changed: 33 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ function ethGateway() external view returns (address)
168168

169169
The address of L1ETHGateway.
170170

171-
171+
*This variable is no longer used.*
172172

173173

174174
#### Returns
@@ -286,7 +286,7 @@ function initialize(address _ethGateway, address _defaultERC20Gateway) external
286286

287287
Initialize the storage of L1GatewayRouter.
288288

289-
289+
*The parameters `_ethGateway` is no longer used.*
290290

291291
#### Parameters
292292

@@ -295,6 +295,23 @@ Initialize the storage of L1GatewayRouter.
295295
| _ethGateway | address | The address of L1ETHGateway contract. |
296296
| _defaultERC20Gateway | address | The address of default ERC20 Gateway contract. |
297297

298+
### messenger
299+
300+
```solidity
301+
function messenger() external view returns (address)
302+
```
303+
304+
The address of `L1ScrollMessenger`.
305+
306+
307+
308+
309+
#### Returns
310+
311+
| Name | Type | Description |
312+
|---|---|---|
313+
| _0 | address | undefined |
314+
298315
### owner
299316

300317
```solidity
@@ -618,3 +635,17 @@ Emitted when the address of ETH Gateway is updated.
618635

619636

620637

638+
## Errors
639+
640+
### ErrorZeroAddress
641+
642+
```solidity
643+
error ErrorZeroAddress()
644+
```
645+
646+
647+
648+
*Thrown when the given address is `address(0)`.*
649+
650+
651+

docs/apis/L1ScrollMessenger.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ function initialize(address _counterpart, address _feeVault, address _rollup, ad
7272

7373
Initialize the storage of L1ScrollMessenger.
7474

75-
75+
*The parameters `_counterpart`, `_rollup` and `_messageQueue` are no longer used.*
7676

7777
#### Parameters
7878

@@ -611,3 +611,17 @@ Emitted when the maximum number of times each message can be replayed is updated
611611

612612

613613

614+
## Errors
615+
616+
### ErrorZeroAddress
617+
618+
```solidity
619+
error ErrorZeroAddress()
620+
```
621+
622+
623+
624+
*Thrown when the given address is `address(0)`.*
625+
626+
627+

docs/apis/L1StandardERC20Gateway.md

Lines changed: 48 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ function initialize(address _counterpart, address _router, address _messenger, a
135135

136136
Initialize the storage of L1StandardERC20Gateway.
137137

138-
138+
*The parameters `_counterpart`, `_router`, `_messenger`, `_l2TokenImplementation` and `_l2TokenFactory` are no longer used.*
139139

140140
#### Parameters
141141

@@ -374,3 +374,50 @@ Emitted when some ERC20 token is refunded.
374374

375375

376376

377+
## Errors
378+
379+
### ErrorCallerIsNotCounterpartGateway
380+
381+
```solidity
382+
error ErrorCallerIsNotCounterpartGateway()
383+
```
384+
385+
386+
387+
*Thrown when the cross chain sender is not the counterpart gateway contract.*
388+
389+
390+
### ErrorCallerIsNotMessenger
391+
392+
```solidity
393+
error ErrorCallerIsNotMessenger()
394+
```
395+
396+
397+
398+
*Thrown when the caller is not corresponding `L1ScrollMessenger` or `L2ScrollMessenger`.*
399+
400+
401+
### ErrorNotInDropMessageContext
402+
403+
```solidity
404+
error ErrorNotInDropMessageContext()
405+
```
406+
407+
408+
409+
*Thrown when ScrollMessenger is not dropping message.*
410+
411+
412+
### ErrorZeroAddress
413+
414+
```solidity
415+
error ErrorZeroAddress()
416+
```
417+
418+
419+
420+
*Thrown when the given address is `address(0)`.*
421+
422+
423+

docs/apis/L1WETHGateway.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -372,3 +372,50 @@ Emitted when some ERC20 token is refunded.
372372

373373

374374

375+
## Errors
376+
377+
### ErrorCallerIsNotCounterpartGateway
378+
379+
```solidity
380+
error ErrorCallerIsNotCounterpartGateway()
381+
```
382+
383+
384+
385+
*Thrown when the cross chain sender is not the counterpart gateway contract.*
386+
387+
388+
### ErrorCallerIsNotMessenger
389+
390+
```solidity
391+
error ErrorCallerIsNotMessenger()
392+
```
393+
394+
395+
396+
*Thrown when the caller is not corresponding `L1ScrollMessenger` or `L2ScrollMessenger`.*
397+
398+
399+
### ErrorNotInDropMessageContext
400+
401+
```solidity
402+
error ErrorNotInDropMessageContext()
403+
```
404+
405+
406+
407+
*Thrown when ScrollMessenger is not dropping message.*
408+
409+
410+
### ErrorZeroAddress
411+
412+
```solidity
413+
error ErrorZeroAddress()
414+
```
415+
416+
417+
418+
*Thrown when the given address is `address(0)`.*
419+
420+
421+

docs/apis/L2ERC1155Gateway.md

Lines changed: 51 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -114,16 +114,16 @@ Complete ERC1155 deposit from layer 1 to layer 2 and send NFT to recipient's
114114
function initialize(address _counterpart, address _messenger) external nonpayable
115115
```
116116

117+
Initialize the storage of `L2ERC1155Gateway`.
117118

118-
119-
119+
*The parameters `_counterpart` and `_messenger` are no longer used.*
120120

121121
#### Parameters
122122

123123
| Name | Type | Description |
124124
|---|---|---|
125-
| _counterpart | address | undefined |
126-
| _messenger | address | undefined |
125+
| _counterpart | address | The address of `L1ERC1155Gateway` contract in L1. |
126+
| _messenger | address | The address of `L2ScrollMessenger` contract in L2. |
127127

128128
### messenger
129129

@@ -496,3 +496,50 @@ Emitted when the ERC1155 NFT is transfered to gateway on layer 2.
496496

497497

498498

499+
## Errors
500+
501+
### ErrorCallerIsNotCounterpartGateway
502+
503+
```solidity
504+
error ErrorCallerIsNotCounterpartGateway()
505+
```
506+
507+
508+
509+
*Thrown when the cross chain sender is not the counterpart gateway contract.*
510+
511+
512+
### ErrorCallerIsNotMessenger
513+
514+
```solidity
515+
error ErrorCallerIsNotMessenger()
516+
```
517+
518+
519+
520+
*Thrown when the caller is not corresponding `L1ScrollMessenger` or `L2ScrollMessenger`.*
521+
522+
523+
### ErrorNotInDropMessageContext
524+
525+
```solidity
526+
error ErrorNotInDropMessageContext()
527+
```
528+
529+
530+
531+
*Thrown when ScrollMessenger is not dropping message.*
532+
533+
534+
### ErrorZeroAddress
535+
536+
```solidity
537+
error ErrorZeroAddress()
538+
```
539+
540+
541+
542+
*Thrown when the given address is `address(0)`.*
543+
544+
545+

0 commit comments

Comments
 (0)