Skip to content

Commit

Permalink
Add receivers to sync state actions (0xPolygon#1358)
Browse files Browse the repository at this point in the history
  • Loading branch information
Stefan-Ethernal authored Apr 6, 2023
1 parent 99166f0 commit 0592e11
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions docs/bridge/sequences.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
## Deposit

Bridge tokens from rootchain to childchain via deposit.
Bridge ERC 20 tokens from rootchain to childchain via deposit.

```mermaid
sequenceDiagram
User->>Edge: deposit
Edge->>RootERC20.sol: approve(RootERC20Predicate)
Edge->>RootERC20Predicate.sol: deposit()
RootERC20Predicate.sol->>RootERC20Predicate.sol: mapToken()
RootERC20Predicate.sol->>StateSender.sol: syncState(MAP_TOKEN_SIG)
RootERC20Predicate.sol->>StateSender.sol: syncState(MAP_TOKEN_SIG), recv=ChildERC20Predicate
RootERC20Predicate.sol-->>Edge: TokenMapped Event
StateSender.sol-->>Edge: StateSynced Event to map tokens on child predicate
RootERC20Predicate.sol->>StateSender.sol: syncState(DEPOSIT_SIG)
RootERC20Predicate.sol->>StateSender.sol: syncState(DEPOSIT_SIG), recv=ChildERC20Predicate
StateSender.sol-->>Edge: StateSynced Event to deposit on child chain
Edge->>User: ok
Edge->>StateReceiver.sol:commit()
Expand All @@ -24,14 +24,14 @@ sequenceDiagram

## Withdraw

Move tokens from childchain to rootchain via withdrawal.
Bridge ERC 20 tokens from childchain to rootchain via withdrawal.

```mermaid
sequenceDiagram
User->>Edge: withdraw
Edge->>ChildERC20Predicate.sol: withdrawTo()
ChildERC20Predicate.sol->>ChildERC20: burn()
ChildERC20Predicate.sol->>L2StateSender.sol: syncState(rootToken, WITHDRAW_SIG), recv=RootERC20Predicate
ChildERC20Predicate.sol->>L2StateSender.sol: syncState(WITHDRAW_SIG), recv=RootERC20Predicate
Edge->>User: tx hash
User->>Edge: get tx receipt
Edge->>User: exit event id
Expand All @@ -42,7 +42,7 @@ sequenceDiagram
```
## Exit

Finalize withdrawal of tokens from childchain to rootchain.
Finalize withdrawal of ERC 20 tokens from childchain to rootchain.

```mermaid
sequenceDiagram
Expand Down

0 comments on commit 0592e11

Please sign in to comment.