You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/bridging/bridging-fa-how.md
+12-7Lines changed: 12 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -32,7 +32,7 @@ The process of bridging FA-compatible tokens from layer 1 to Etherlink (also kno
32
32
For information about token access control, see [Token standards](https://docs.tezos.com/architecture/tokens#token-standards) on docs.tezos.com.
33
33
34
34
1. The user calls the helper contract's `deposit` entrypoint.
35
-
The request includes the amount of tokens to bridge, the address of the Etherlink Smart Rollup, and the user's Etherlink wallet address, but not the tokens themselves.
35
+
The request includes the address of the Etherlink Smart Rollup, the user's Etherlink account address, and the amount of tokens to bridge, but not the tokens themselves.
36
36
37
37
1. The token bridge helper contract stores the address of the Etherlink Smart Rollup and the user's Etherlink address temporarily.
38
38
@@ -55,6 +55,12 @@ The request includes the amount of tokens to bridge, the address of the Etherlin
55
55
1. Any user can call the FA bridging precompiled contract's `claim` function, which causes the contract to call the ERC-20 proxy contract.
56
56
For tokens supported by the bridge, an automated program calls the `claim` function for you.
57
57
58
+
You can call the `claim` function yourself with this ABI, using the `depositId` field from the event:
59
+
60
+
```
61
+
claim(uint256 depositId)
62
+
```
63
+
58
64
1. The ERC-20 proxy contract mints the equivalent tokens and sends them to the user's Etherlink account.
59
65
60
66
This diagram is an overview of the process of bridging tokens from layer 1 to Etherlink:
@@ -104,11 +110,11 @@ When a deposit is ready to be claimed, the FA bridging precompiled contract (`0x
104
110
105
111
Field | Type | Description
106
112
--- | --- | ---
107
-
`ticket_owner` | address | ???
108
-
`receiver` | address | The Etherlink account that will receive the claimed tokens
113
+
`depositId` | uint265 | The ID of the bridging transaction that users need to claim the pending deposit
114
+
`recipient` | address | The Etherlink account that will receive the claimed tokens
109
115
`amount` | uint256 | The amount of tokens
110
-
`inbox_level` | unit256 | ???
111
-
`inbox_msg_id` | unit256 | The ID of the bridging transaction that users need to claim the pending deposit
116
+
`timelock` | uint256 | ???
117
+
`depositCount` | uint256 | ???
112
118
113
119
### `Deposit` event
114
120
@@ -128,7 +134,6 @@ TODO ^ This info from `etherlink/kernel_latest/evm_execution/src/fa_bridge/depos
128
134
129
135
When an account initiates a withdrawal, the FA bridging precompiled contract (`0xff0...0002`) emits a `Withdrawal` event that includes the following information:
130
136
131
-
132
137
Field | Type | Description
133
138
--- | --- | ---
134
139
`amount` | unit256 | The amount of tokens
@@ -138,7 +143,7 @@ Field | Type | Description
138
143
139
144
### TODO other events
140
145
141
-
TODO other withdrawal events from `etherlink/kernel_latest/evm_execution/src/fa_bridge/withdrawal.rs`:
146
+
TODO other withdrawal events from `etherlink/kernel_latest/evm_execution/src/fa_bridge/withdrawal.rs` but I'm not sure if these fields translate directly to the fields in the event because they seemed to be different for the deposit events:
The token bridge helper contract sends the tokens to the ticketer contract, which issues a ticket that represents the tokens.
56
62
The token bridge helper contract sends that ticket to Etherlink.
57
63
64
+
When Etherlink receives that deposit, the FA bridging precompiled contract (`0xff0...0002`) emits a `QueuedDeposit` event that includes the `depositId` for the deposit, which is needed to claim the deposit; see [Event reference](/bridging/bridging-fa-how#event-reference).
65
+
58
66
1. When the deposit is in an Etherlink block, call the FA bridging precompiled contract contract's `claim`functionto cause the ERC-20 proxy contract to mint the tokens.
59
67
60
-
The address of the precompiled contract is `0xff00000000000000000000000000000000000002` and to call the functionyou can use the ABI `claim(uint256 depositId)`, where `depositId` matches the `depositId` that was emitted in a previous eventfor this transfer by the precompile (`QueuedDeposit(uint256 depositId, address recipient, uint256 amount, uint256 timelock, uint256 depositCount)`).
68
+
The address of the precompiled contract is `0xff00000000000000000000000000000000000002` and to call the functionyou can use the ABI `claim(uint256 depositId)`, where `depositId` matches the `depositId` that was emitted in a previous event.
61
69
62
70
As a reference, here is an [example of the sequencer injecting a deposit](https://explorer.etherlink.com/tx/0x5a06fe64e880d6d1f53c243477cd5656204712f1543b607340996ad246158669) and here is an [example of the corresponding claim transaction](https://explorer.etherlink.com/tx/0xe017665cd7bfdef375a863114ac9f7ed2538da4d8584b0f1e0aa71ce96342aee).
63
71
@@ -69,6 +77,8 @@ Follow these steps to deposit FA-compliant tokens from layer 1 to Etherlink:
69
77
70
78
:::
71
79
80
+
When the deposit has been claimed, the FA bridging precompiled contract (`0xff0...0002`) emits a `Deposit` event; see [Event reference](/bridging/bridging-fa-how#event-reference).
81
+
72
82
To see the tokens in your Etherlink wallet, look up the ERC-20 proxy contract in a block explorer or use its address to manually add the tokens to your wallet.
73
83
Because the Etherlink tokens are compatible with the ERC-20 standard, EVM-compatible wallets should be able to display them.
0 commit comments