Skip to content

Commit 2b2bec3

Browse files
Corrected info about FA bridge events
1 parent 3480309 commit 2b2bec3

1 file changed

Lines changed: 35 additions & 75 deletions

File tree

docs/bridging/bridging-fa-how.md

Lines changed: 35 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -110,93 +110,53 @@ When a deposit is ready to be claimed, the FA bridging precompiled contract (`0x
110110

111111
Field | Type | Description
112112
--- | --- | ---
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
115-
`amount` | uint256 | The amount of tokens
116-
`timelock` | uint256 | ???
117-
`depositCount` | uint256 | ???
113+
`ticketHash` | uint256 | The hash of the ticket that represents the transferred tokens, computed as `keccak256(L1 ticketer + content)`
114+
`proxy` | address | The proxy address through which the deposit is routed
115+
`nonce` | uint256 | The global counter for the transaction
116+
`receiver` | address | The Etherlink address that receives the tokens
117+
`amount` | uint256 | The amount of tokens in the transaction
118+
`inboxLevel` | uint256 | The layer 1 block in which the deposit was submitted
119+
`inboxMsgId` | uint256 | An identifier for the Smart Rollup inbox message
118120

119121
### `Deposit` event
120122

121123
When a deposit has been claimed, the FA bridging precompiled contract (`0xff0...0002`) emits a `Deposit` event that includes the following information:
122124

123125
Field | Type | Description
124126
--- | --- | ---
125-
`nonce` | unit256 | The nonce for the bridging transaction
126-
`receiver` | address | The Etherlink account that received the claimed tokens
127+
`ticketHash` | uint256 | The hash of the ticket that represents the transferred tokens, computed as `keccak256(L1 ticketer + content)`
128+
`ticketOwner` | address | The ERC-20 proxy contract that manages the tokens
129+
`receiver` | address | The ERC-20 proxy contract that manages the tokens (a duplicate of the `ticketOwner` field)
127130
`amount` | uint256 | The amount of tokens
128-
`inbox_level` | unit256 | ???
129-
`inbox_msg_id` | unit256 | The ID of the bridging transaction
130-
131-
TODO ^ This info from `etherlink/kernel_latest/evm_execution/src/fa_bridge/deposit.rs` does not match with the blog post, which says that the signature should be `Deposit(uint256,address,address,uint256,uint256,uint256)`
131+
`inboxLevel` | uint256 | The layer 1 block in which the deposit was submitted
132+
`inboxMsgId` | uint256 | An identifier for the Smart Rollup inbox message, which you can use to find the corresponding `QueuedDeposit` event and the Etherlink address that receives the tokens
132133

133134
### `Withdrawal` event
134135

135136
When an account initiates a withdrawal, the FA bridging precompiled contract (`0xff0...0002`) emits a `Withdrawal` event that includes the following information:
136137

137138
Field | Type | Description
138139
--- | --- | ---
139-
`amount` | unit256 | The amount of tokens
140-
`sender` | address | The address of the Etherlink account sending the tokens
141-
`receiver` | bytes22 | A bytecode representation of the Tezos address of the account receiving the tokens
142-
`withdrawalId` | unit256 | The ID of the bridging transaction
143-
144-
### TODO other events
145-
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:
147-
148-
```rust
149-
alloy_sol_types::sol! {
150-
event SolStandardWithdrawalInput (
151-
address ticket_owner,
152-
bytes routing_info,
153-
uint256 amount,
154-
bytes22 ticketer,
155-
bytes content,
156-
);
157-
}
158-
159-
alloy_sol_types::sol! {
160-
event SolFastWithdrawalInput (
161-
address ticket_owner,
162-
bytes routing_info,
163-
uint256 amount,
164-
bytes22 ticketer,
165-
bytes content,
166-
string fast_withdrawal_contract_address,
167-
bytes payload,
168-
);
169-
}
170-
171-
alloy_sol_types::sol! {
172-
event SolStandardWithdrawalProxyCallData (
173-
address sender,
174-
uint256 amount,
175-
uint256 ticket_hash,
176-
);
177-
}
178-
179-
alloy_sol_types::sol! {
180-
event SolStandardWithdrawalEvent (
181-
address sender,
182-
address ticket_owner,
183-
bytes22 receiver,
184-
bytes22 proxy,
185-
uint256 amount,
186-
uint256 withdrawal_id,
187-
);
188-
}
189-
190-
alloy_sol_types::sol! {
191-
event SolFastFAWithdrawalEvent (
192-
address sender,
193-
address ticket_owner,
194-
bytes22 receiver,
195-
bytes22 proxy,
196-
uint256 amount,
197-
uint256 withdrawal_id,
198-
uint256 timestamp,
199-
bytes payload,
200-
);
201-
}
202-
```
140+
`ticketHash` | uint256 | The hash of the ticket that represents the transferred tokens, computed as `keccak256(L1 ticketer + content)`
141+
`sender` | address | The Etherlink address that is withdrawing the tokens
142+
`ticketOwner` | address | The ERC-20 proxy contract that manages the tokens
143+
`receiver` | bytes22 | The layer 1 address that receives the tokens
144+
`proxy` | bytes22 | The proxy address through which the deposit is routed
145+
`amount` | uint256 | The amount of tokens
146+
`withdrawalId` | uint256 | An internal ID for the withdrawal
147+
148+
### `FastFaWithdrawal` event
149+
150+
When an account initiates a fast withdrawal, the FA bridging precompiled contract (`0xff0...0002`) emits a `FastFaWithdrawal` event that includes the following information:
151+
152+
Field | Type | Description
153+
--- | --- | ---
154+
`ticketHash` | uint256 | The hash of the ticket that represents the transferred tokens, computed as `keccak256(L1 ticketer + content)`
155+
`sender` | address | The Etherlink address that is withdrawing the tokens
156+
`ticketOwner` | address | The ERC-20 proxy contract that manages the tokens
157+
`receiver` | bytes22 | The layer 1 address that receives the tokens
158+
`proxy` | bytes22 | The proxy address through which the deposit is routed
159+
`amount` | uint256 | The amount of tokens
160+
`withdrawalId` | uint256 | An internal ID for the withdrawal
161+
`timestamp` | uint256 | The timestamp of the block that includes the fast withdrawal request
162+
`payload` | bytes | Information about the fast withdrawal to forward to the fast withdrawal contact

0 commit comments

Comments
 (0)