Skip to content

Commit 8a1c7a1

Browse files
Merge pull request 0xPolygon#529 from 0xPolygon/zkevm/sc-class-diagram
zkEVM: class diagrams of Solidity files
2 parents 9824ec5 + 293ecd9 commit 8a1c7a1

File tree

6 files changed

+15
-3
lines changed

6 files changed

+15
-3
lines changed
686 KB
Loading
652 KB
Loading
-750 KB
Loading

docs/zkEVM/architecture/high-level/smart-contracts/bridging.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
![Polygon Solidity smart contract bridging architecture](../../../../img/cdk/high-level-architecture/bridging-class-diagram.png)
2+
13
The unified bridge transfers assets and messages between networks (L1, L2) by calling bridge and claim functions on the [PolygonZkEVMBridgeV2.sol](https://github.com/0xPolygonHermez/zkevm-contracts/blob/main/contracts/v2/PolygonZkEVMBridgeV2.sol) contract whose deployment address is an [upgradeable proxy](https://etherscan.io/address/0x2a3DD3EB832aF982ec71669E178424b10Dca2EDe#code). Interaction with the actual contract happens via the proxy.
24

35
This contract is deployed on L1 and there is also one deployed on every L2 network. It communicates closely with an exit root manager contract specific to L1 or L2.

docs/zkEVM/architecture/high-level/smart-contracts/exit-roots.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
The class diagram below describes how the exit root contracts communicate with the bridge and the rollup manager.
2+
3+
![Polygon Solidity smart contract bridging architecture](../../../../img/cdk/high-level-architecture/exit-root-class-diagram.png)
4+
15
An exit tree is a binary, append-only, sparse Merkle tree (SMT) whose leaf nodes store bridging data. The exit trees have a depth of 32.
26

37
The Merkle root of an exit tree is known as the exit tree root, and it is the fingerprint of all the information recorded in the exit tree's leaf nodes.

docs/zkEVM/architecture/high-level/smart-contracts/overview.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,11 @@
22
comments: true
33
---
44

5-
<!-- https://excalidraw.com/#json=JKZp9QEihifF_B7Z41Dfv,FVNhqQKi9PA1jM0kzUoCsQ" -->
6-
75
## Polygon smart contract architecture
86

97
Chain stacks at the node level direct transaction data to the L2 and L1 networks via smart contract calls. The system stores state in binary tree structures containing verifiable local and global exit roots.
108

11-
The diagram below details the Polygon Solidity smart contract architecture.
9+
The diagram below details the Polygon Solidity smart contract architecture minus the bridging contracts.
1210

1311
![Polygon Solidity smart contract architecture](../../../../img/cdk/high-level-architecture/smart-contracts-full-view.png)
1412

@@ -39,6 +37,10 @@ The [PolygonRollupManager.sol](https://github.com/0xPolygonHermez/zkevm-contract
3937

4038
## Bridge
4139

40+
The class diagram below describes the unified bridge interactions.
41+
42+
![Polygon Solidity smart contract bridging architecture](../../../../img/cdk/high-level-architecture/bridging-class-diagram.png)
43+
4244
The unified bridge contract [PolygonZkEVMBridgeV2.sol](https://github.com/0xPolygonHermez/zkevm-contracts/blob/main/contracts/v2/PolygonZkEVMBridgeV2.sol) is responsible for bridging and claiming activity across L1 and L2 chains.
4345

4446
<center>
@@ -49,6 +51,10 @@ In the L1 network, the bridge also manages the complex exit root mechanism gover
4951

5052
## Global exit roots
5153

54+
The class diagram below describes the exit root interactions.
55+
56+
![Polygon Solidity smart contract bridging architecture](../../../../img/cdk/high-level-architecture/exit-root-class-diagram.png)
57+
5258
System state as a whole is stored on binary trees with data and/or exit roots written into their leaves.
5359

5460
Local updates at the leaf-level trigger exit root updates at the top of the trees which are then available to the global exit root trees and the consensus contracts via the L1 bridge contract.

0 commit comments

Comments
 (0)