|
| 1 | +## `PolygonRollupManager.sol` |
| 2 | + |
| 3 | +The [PolygonRollupManager.sol](https://github.com/0xPolygonHermez/zkevm-contracts/blob/main/contracts/v2/PolygonRollupManager.sol) contract is responsible for managing rollups and verifying batches. It creates and updates rollup stacks by storing hash-sequenced data as newly sequenced batches arrive. |
| 4 | + |
| 5 | +It is responsible for the verification workflow by supplying updated exit root data to the [[PolygonZkEVMGlobalExitRootV2.sol](https://github.com/0xPolygonHermez/zkevm-contracts/blob/main/contracts/v2/PolygonZkEVMGlobalExitRootV2.sol)](#polygonzkevmglobalexitrootv2sol) contract. |
| 6 | + |
| 7 | +### Key functionality |
| 8 | + |
| 9 | +- Defining and adding rollup types which contains consensus implementation details and compatibility checks. |
| 10 | +- Defining the [`RollupData`](https://github.com/0xPolygonHermez/zkevm-contracts/blob/main/contracts/v2/PolygonRollupManager.sol#L70s) struct. |
| 11 | +- Initializes the trusted aggregator process for verifying multiple batches. |
| 12 | +- Gets exit root data by computing all local exit roots of all rollups. |
| 13 | +- Calculates batch rewards. |
| 14 | + |
| 15 | +## `PolygonZkEVMBridgeV2.sol` |
| 16 | + |
| 17 | +The [PolygonZkEVMBridgeV2.sol](https://github.com/0xPolygonHermez/zkevm-contracts/blob/main/contracts/v2/PolygonZkEVMBridgeV2.sol) is the main communication mechanism between the L1 and L2 realms. It manages bridging and claiming of assets and messages across environments. |
| 18 | + |
| 19 | +### Key functionality |
| 20 | + |
| 21 | +- Bridging assets with the `bridgeAsset(...)` function. |
| 22 | +- Bridging messages with a choice of `bridgeMessage(...)` functions for various scenarios. |
| 23 | +- Claiming assets with the `claimAsset(..)` function. |
| 24 | +- Claiming messages with the `claimMessage(...)` function. |
| 25 | +- Verifying state and updating the global exit root with state changes. |
| 26 | +- Providing access to the global exit root manager via the `IBasePolygonZkEVMGlobalExitRoot`. |
| 27 | +- Interacting with the `PolygonZkEVMGlobalExitRootL2.sol` contract which exists in the L2 space as part of the bridge functionality. |
| 28 | + |
| 29 | +## `PolygonZkEVMGlobalExitRootV2.sol` |
| 30 | + |
| 31 | +The [PolygonZkEVMGlobalExitRootV2.sol](https://github.com/0xPolygonHermez/zkevm-contracts/blob/main/contracts/v2/PolygonZkEVMGlobalExitRootV2.sol) contract manages the L1 info tree that represents the current state of the system by updating global exit roots on state changes. It does this task across multiple networks and layers. |
| 32 | + |
| 33 | +### Key functionality |
| 34 | + |
| 35 | +- Updating the L1 info tree by emitting the `UpdateL1InfoTree(...)` event. |
| 36 | +- Updating exit roots. |
| 37 | +- Retrieving latest exit roots and leaf values. |
0 commit comments