Skip to content

Commit 7e99c51

Browse files
zimphaicemelonThegaramcolinlyguo
authored
feat(contracts): new bridge contracts (#288)
Co-authored-by: Haichen Shen <[email protected]> Co-authored-by: Thegaram <[email protected]> Co-authored-by: colin <[email protected]>
1 parent 65e0b67 commit 7e99c51

File tree

117 files changed

+11653
-6634
lines changed

Some content is hidden

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

117 files changed

+11653
-6634
lines changed

contracts/docs/apis/L1ERC1155Gateway.md

Lines changed: 8 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ The `L1ERC1155Gateway` is used to deposit ERC1155 compatible NFT in layer 1 and
1313
### batchDepositERC1155
1414

1515
```solidity
16-
function batchDepositERC1155(address _token, uint256[] _tokenIds, uint256[] _amounts, uint256 _gasLimit) external nonpayable
16+
function batchDepositERC1155(address _token, uint256[] _tokenIds, uint256[] _amounts, uint256 _gasLimit) external payable
1717
```
1818

1919
Deposit a list of some ERC1155 NFT to caller&#39;s account on layer 2.
@@ -32,7 +32,7 @@ Deposit a list of some ERC1155 NFT to caller&#39;s account on layer 2.
3232
### batchDepositERC1155
3333

3434
```solidity
35-
function batchDepositERC1155(address _token, address _to, uint256[] _tokenIds, uint256[] _amounts, uint256 _gasLimit) external nonpayable
35+
function batchDepositERC1155(address _token, address _to, uint256[] _tokenIds, uint256[] _amounts, uint256 _gasLimit) external payable
3636
```
3737

3838
Deposit a list of some ERC1155 NFT to a recipient&#39;s account on layer 2.
@@ -69,7 +69,7 @@ The address of corresponding L1/L2 Gateway contract.
6969
### depositERC1155
7070

7171
```solidity
72-
function depositERC1155(address _token, address _to, uint256 _tokenId, uint256 _amount, uint256 _gasLimit) external nonpayable
72+
function depositERC1155(address _token, address _to, uint256 _tokenId, uint256 _amount, uint256 _gasLimit) external payable
7373
```
7474

7575
Deposit some ERC1155 NFT to a recipient&#39;s account on layer 2.
@@ -89,7 +89,7 @@ Deposit some ERC1155 NFT to a recipient&#39;s account on layer 2.
8989
### depositERC1155
9090

9191
```solidity
92-
function depositERC1155(address _token, uint256 _tokenId, uint256 _amount, uint256 _gasLimit) external nonpayable
92+
function depositERC1155(address _token, uint256 _tokenId, uint256 _amount, uint256 _gasLimit) external payable
9393
```
9494

9595
Deposit some ERC1155 NFT to caller&#39;s account on layer 2.
@@ -126,17 +126,6 @@ Complete ERC1155 batch withdraw from layer 2 to layer 1 and send fund to recipie
126126
| _tokenIds | uint256[] | The list of token ids to withdraw. |
127127
| _amounts | uint256[] | The list of corresponding number of token to withdraw. |
128128

129-
### finalizeDropMessage
130-
131-
```solidity
132-
function finalizeDropMessage() external payable
133-
```
134-
135-
136-
137-
138-
139-
140129
### finalizeWithdrawERC1155
141130

142131
```solidity
@@ -164,24 +153,24 @@ Complete ERC1155 withdraw from layer 2 to layer 1 and send fund to recipient&#39
164153
function initialize(address _counterpart, address _messenger) external nonpayable
165154
```
166155

167-
156+
Initialize the storage of L1ERC1155Gateway.
168157

169158

170159

171160
#### Parameters
172161

173162
| Name | Type | Description |
174163
|---|---|---|
175-
| _counterpart | address | undefined |
176-
| _messenger | address | undefined |
164+
| _counterpart | address | The address of L2ERC1155Gateway in L2. |
165+
| _messenger | address | The address of L1ScrollMessenger. |
177166

178167
### messenger
179168

180169
```solidity
181170
function messenger() external view returns (address)
182171
```
183172

184-
The address of L1ScrollMessenger/L2ScrollMessenger contract.
173+
The address of corresponding L1ScrollMessenger/L2ScrollMessenger contract.
185174

186175

187176

contracts/docs/apis/L1ERC721Gateway.md

Lines changed: 8 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ The `L1ERC721Gateway` is used to deposit ERC721 compatible NFT in layer 1 and fi
1313
### batchDepositERC721
1414

1515
```solidity
16-
function batchDepositERC721(address _token, address _to, uint256[] _tokenIds, uint256 _gasLimit) external nonpayable
16+
function batchDepositERC721(address _token, address _to, uint256[] _tokenIds, uint256 _gasLimit) external payable
1717
```
1818

1919
Deposit a list of some ERC721 NFT to a recipient&#39;s account on layer 2.
@@ -32,7 +32,7 @@ Deposit a list of some ERC721 NFT to a recipient&#39;s account on layer 2.
3232
### batchDepositERC721
3333

3434
```solidity
35-
function batchDepositERC721(address _token, uint256[] _tokenIds, uint256 _gasLimit) external nonpayable
35+
function batchDepositERC721(address _token, uint256[] _tokenIds, uint256 _gasLimit) external payable
3636
```
3737

3838
Deposit a list of some ERC721 NFT to caller&#39;s account on layer 2.
@@ -67,7 +67,7 @@ The address of corresponding L1/L2 Gateway contract.
6767
### depositERC721
6868

6969
```solidity
70-
function depositERC721(address _token, address _to, uint256 _tokenId, uint256 _gasLimit) external nonpayable
70+
function depositERC721(address _token, address _to, uint256 _tokenId, uint256 _gasLimit) external payable
7171
```
7272

7373
Deposit some ERC721 NFT to a recipient&#39;s account on layer 2.
@@ -86,7 +86,7 @@ Deposit some ERC721 NFT to a recipient&#39;s account on layer 2.
8686
### depositERC721
8787

8888
```solidity
89-
function depositERC721(address _token, uint256 _tokenId, uint256 _gasLimit) external nonpayable
89+
function depositERC721(address _token, uint256 _tokenId, uint256 _gasLimit) external payable
9090
```
9191

9292
Deposit some ERC721 NFT to caller&#39;s account on layer 2.
@@ -121,17 +121,6 @@ Complete ERC721 batch withdraw from layer 2 to layer 1 and send NFT to recipient
121121
| _to | address | The address of recipient in layer 1 to receive the token. |
122122
| _tokenIds | uint256[] | The list of token ids to withdraw. |
123123

124-
### finalizeDropMessage
125-
126-
```solidity
127-
function finalizeDropMessage() external payable
128-
```
129-
130-
131-
132-
133-
134-
135124
### finalizeWithdrawERC721
136125

137126
```solidity
@@ -158,24 +147,24 @@ Complete ERC721 withdraw from layer 2 to layer 1 and send NFT to recipient&#39;s
158147
function initialize(address _counterpart, address _messenger) external nonpayable
159148
```
160149

161-
150+
Initialize the storage of L1ERC721Gateway.
162151

163152

164153

165154
#### Parameters
166155

167156
| Name | Type | Description |
168157
|---|---|---|
169-
| _counterpart | address | undefined |
170-
| _messenger | address | undefined |
158+
| _counterpart | address | The address of L2ERC721Gateway in L2. |
159+
| _messenger | address | The address of L1ScrollMessenger. |
171160

172161
### messenger
173162

174163
```solidity
175164
function messenger() external view returns (address)
176165
```
177166

178-
The address of L1ScrollMessenger/L2ScrollMessenger contract.
167+
The address of corresponding L1ScrollMessenger/L2ScrollMessenger contract.
179168

180169

181170

0 commit comments

Comments
 (0)