Skip to content

Commit af69b64

Browse files
last chunk of formatting
1 parent 5e0d0b4 commit af69b64

15 files changed

+252
-574
lines changed

docs/zkEVM/architecture/high-level/smart-contracts/api/lib/DepositContractBase.md

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,36 @@
1-
This contract will be used as a helper for all the sparse merkle tree related functions
2-
Based on the implementation of the deposit eth2.0 contract https://github.com/ethereum/consensus-specs/blob/dev/solidity_deposit_contract/deposit_contract.sol
3-
1+
This contract is a helper for all the sparse Merkle tree related functions and is based on the implementation of the deposit eth2.0 contract https://github.com/ethereum/consensus-specs/blob/dev/solidity_deposit_contract/deposit_contract.sol.
42

53
## Functions
6-
### getRoot
4+
5+
### `getRoot`
6+
7+
Computes and returns the Merkle root.
8+
79
```solidity
810
function getRoot(
911
) public returns (bytes32)
1012
```
11-
Computes and returns the merkle root
1213

14+
### `_addLeaf`
1315

16+
Adds a new leaf to the merkle tree.
1417

15-
### _addLeaf
1618
```solidity
1719
function _addLeaf(
1820
bytes32 leaf
1921
) internal
2022
```
21-
Add a new leaf to the merkle tree
2223

24+
##### Parameters
2325

24-
##### Parameters:
2526
| Name | Type | Description |
2627
| :--- | :--- | :------------------------------------------------------------------- |
2728
|`leaf` | bytes32 | Leaf
2829

29-
### verifyMerkleProof
30+
### `verifyMerkleProof`
31+
32+
Verify Merkle proof.
33+
3034
```solidity
3135
function verifyMerkleProof(
3236
bytes32 leafHash,
@@ -35,29 +39,30 @@ Add a new leaf to the merkle tree
3539
bytes32 root
3640
) public returns (bool)
3741
```
38-
Verify merkle proof
3942

43+
##### Parameters
4044

41-
##### Parameters:
4245
| Name | Type | Description |
4346
| :--- | :--- | :------------------------------------------------------------------- |
4447
|`leafHash` | bytes32 | Leaf hash
4548
|`smtProof` | bytes32[32] | Smt proof
4649
|`index` | uint32 | Index of the leaf
4750
|`root` | bytes32 | Merkle root
4851

49-
### calculateRoot
52+
### `calculateRoot`
53+
54+
Calculate root from Merkle proof.
55+
5056
```solidity
5157
function calculateRoot(
5258
bytes32 leafHash,
5359
bytes32[32] smtProof,
5460
uint32 index
5561
) public returns (bytes32)
5662
```
57-
Calculate root from merkle proof
5863

64+
##### Parameters
5965

60-
##### Parameters:
6166
| Name | Type | Description |
6267
| :--- | :--- | :------------------------------------------------------------------- |
6368
|`leafHash` | bytes32 | Leaf hash

docs/zkEVM/architecture/high-level/smart-contracts/api/lib/DepositContractLib.md

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,36 @@
1-
This contract will be used as a helper for all the sparse merkle tree related functions
2-
Based on the implementation of the deposit eth2.0 contract https://github.com/ethereum/consensus-specs/blob/dev/solidity_deposit_contract/deposit_contract.sol
3-
1+
This contract is a helper for all the sparse Merkle tree related functions and is based on the implementation of the deposit eth2.0 contract https://github.com/ethereum/consensus-specs/blob/dev/solidity_deposit_contract/deposit_contract.sol.
42

53
## Functions
6-
### getRoot
4+
5+
### `getRoot`
6+
7+
Computes and returns the Merkle root.
8+
79
```solidity
810
function getRoot(
911
) public returns (bytes32)
1012
```
11-
Computes and returns the merkle root
1213

14+
### `_addLeaf`
1315

16+
Adds a new leaf to the merkle tree
1417

15-
### _addLeaf
1618
```solidity
1719
function _addLeaf(
1820
bytes32 leaf
1921
) internal
2022
```
21-
Add a new leaf to the merkle tree
2223

24+
##### Parameters
2325

24-
##### Parameters:
2526
| Name | Type | Description |
2627
| :--- | :--- | :------------------------------------------------------------------- |
2728
|`leaf` | bytes32 | Leaf
2829

29-
### verifyMerkleProof
30+
### `verifyMerkleProof`
31+
32+
Verify Merkle proof.
33+
3034
```solidity
3135
function verifyMerkleProof(
3236
bytes32 leaf,
@@ -35,10 +39,9 @@ Add a new leaf to the merkle tree
3539
bytes32 root
3640
) public returns (bool)
3741
```
38-
Verify merkle proof
3942

43+
##### Parameters
4044

41-
##### Parameters:
4245
| Name | Type | Description |
4346
| :--- | :--- | :------------------------------------------------------------------- |
4447
|`leaf` | bytes32 | Leaf

docs/zkEVM/architecture/high-level/smart-contracts/api/lib/DepositContractV2.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1-
This contract will be used in the PolygonZkEVMBridge contract, it inherits the DepositContractBase and adds the logic
2-
to calculate the leaf of the tree
3-
1+
This contract is used by the `PolygonZkEVMBridge` contract. It inherits the `DepositContractBase` and adds the logic to calculate the leaf of the exit tree.
42

53
## Functions
6-
### getLeafValue
4+
5+
### `getLeafValue`
6+
7+
Given the leaf data returns the leaf value.
8+
79
```solidity
810
function getLeafValue(
911
uint8 leafType,
@@ -15,10 +17,9 @@ to calculate the leaf of the tree
1517
bytes32 metadataHash
1618
) public returns (bytes32)
1719
```
18-
Given the leaf data returns the leaf value
1920

21+
##### Parameters
2022

21-
##### Parameters:
2223
| Name | Type | Description |
2324
| :--- | :--- | :------------------------------------------------------------------- |
2425
|`leafType` | uint8 | Leaf type --> [0] transfer Ether / ERC20 tokens, [1] message
Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
Since the current contract of PolygonZkEVM will be upgraded to a PolygonRollupManager there's defined
2-
all the legacy public variables in order to not use previous used storage slots
3-
The variables will be used by the RollupManager only for initialize the zkEVM inside the initializer function
1+
Legacy contract used after upgrade to PolygonRollupManager to preserve previous used storage slots. The variables will be used by the RollupManager only for initialize the zkEVM inside the initializer function.
42

53

0 commit comments

Comments
 (0)