Skip to content

Commit face5bb

Browse files
updating to tag
1 parent 29b44e2 commit face5bb

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

docs/cdk/how-to/integrate-da.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -11,26 +11,26 @@ This section shows you how to create a custom CDK validium DAC contract.
1111

1212
1. Clone [zkevm-contracts](https://github.com/0xPolygonHermez/zkevm-contracts).
1313

14-
2. Create a branch off `develop` in the [zkevm-contracts](https://github.com/0xPolygonHermez/zkevm-contracts) repo and `cd` into it.
14+
2. `cd` into `zkevm-contracts` and checkout tag `v6.0.0-rc.1-fork.9`.
1515

1616
3. Run `npm i` from the root.
1717

18-
4. Go to the [`contracts/v2/consensus/validium`](https://github.com/0xPolygonHermez/zkevm-contracts/tree/develop/contracts/v2/consensus/validium) directory.
18+
4. `cd` to the `contracts/v2/consensus/validium` directory.
1919

2020
!!! tip
2121
- Until further notice, these contracts run on the [etrog release](https://polygon.technology/blog/polygon-zkevm-the-etrog-upgrade-is-live-on-mainnet).
2222

23-
5. Create your custom contract in the same directory, and make sure it implements the [IDataAvailabilityProtocol](https://github.com/0xPolygonHermez/zkevm-contracts/blob/develop/contracts/v2/interfaces/IDataAvailabilityProtocol.sol) interface.
23+
5. Create your custom contract in the same directory, and make sure it implements the [IDataAvailabilityProtocol](https://github.com/0xPolygonHermez/zkevm-contracts/blob/v6.0.0-rc.1-fork.9/contracts/v2/interfaces/IDataAvailabilityProtocol.sol) interface.
2424

2525
!!! tip
26-
- Use the Polygon DAC implementation contract: [PolygonDataCommittee.sol](https://github.com/0xPolygonHermez/zkevm-contracts/blob/develop/contracts/v2/consensus/validium/PolygonDataCommittee.sol) as a guide.
26+
- Use the Polygon DAC implementation contract: [PolygonDataCommittee.sol](https://github.com/0xPolygonHermez/zkevm-contracts/blob/v6.0.0-rc.1-fork.9/contracts/v2/consensus/validium/PolygonDataCommittee.sol) as a guide.
2727
- The contract supports custom smart contract implementation and, through this, DACs can add their custom on-chain verification logic.
2828

29-
6. You can leave the `verifyMessage` function empty but make sure the `getProcotolName` function returns a unique name (such as Avail, Celestia, etc). The following example code comes from the [PolygonDataCommitee.sol](https://github.com/0xPolygonHermez/zkevm-contracts/blob/develop/contracts/v2/consensus/validium/PolygonDataCommittee.sol) implementation.
29+
6. You can leave the `verifyMessage` function empty but make sure the `getProcotolName` function returns a unique name (such as Avail, Celestia, etc). The following example code comes from the [PolygonDataCommitee.sol](https://github.com/0xPolygonHermez/zkevm-contracts/blob/v6.0.0-rc.1-fork.9/contracts/v2/consensus/validium/PolygonDataCommittee.sol) implementation.
3030

3131
```solidity
3232
// Name of the data availability protocol
33-
string internal constant _PROTOCOL_NAME = "DataAvailabilityCommittee";
33+
string internal constant _PROTOCOL_NAME = "<MY_PROTOCOL_NAME>";
3434
3535
...
3636
@@ -42,7 +42,7 @@ This section shows you how to create a custom CDK validium DAC contract.
4242
}
4343
```
4444
45-
7. Update the [/deployment/v2/4_createRollup.ts](https://github.com/0xPolygonHermez/zkevm-contracts/blob/54f58c8b64806429bc4d5c52248f29cf80ba401c/deployment/v2/4_createRollup.ts#L77) script to add your protocol name.
45+
7. Update the [/deployment/v2/4_createRollup.ts](https://github.com/0xPolygonHermez/zkevm-contracts/blob/54f58c8b64806429bc4d5c52248f29cf80ba401c/deployment/v2/4_createRollup.ts#L77) script to add your contract name.
4646
4747
```ts
4848
const supporteDataAvailabilityProtocols = ["<CONTRACT_NAME>"];
@@ -52,9 +52,9 @@ This section shows you how to create a custom CDK validium DAC contract.
5252
5353
!!! info "`PolygonValidiumEtrog.sol` solution"
5454
55-
The [Etrog DAC integration contract](https://github.com/0xPolygonHermez/zkevm-contracts/blob/feature/etrog/contracts/v2/consensus/validium/PolygonValidiumEtrog.sol) is still work-in-progress at the time of writing but there are some interesting things to note.
55+
The [Etrog DAC integration contract](https://github.com/0xPolygonHermez/zkevm-contracts/blob/v6.0.0-rc.1-fork.9/contracts/v2/consensus/validium/PolygonValidiumEtrog.sol) is still work-in-progress at the time of writing but there are some interesting things to note.
5656
57-
1. It implements the function `verifyMessage` function. Check [lines 215-220](https://github.com/0xPolygonHermez/zkevm-contracts/blob/b2a62e6af5738366e7494e8312184b1d6fdf287c/contracts/v2/consensus/validium/PolygonValidiumEtrog.sol#L215C1-L220C15):
57+
1. It implements the function [`verifyMessage` function](https://github.com/0xPolygonHermez/zkevm-contracts/blob/54f58c8b64806429bc4d5c52248f29cf80ba401c/contracts/v2/consensus/validium/PolygonValidiumEtrog.sol#L231):
5858
5959
```solidity
6060
// Validate that the data availability protocol accepts the dataAvailabilityMessage
@@ -67,7 +67,7 @@ This section shows you how to create a custom CDK validium DAC contract.
6767
6868
where `accumulatedNonForcedTransactionsHash` is used for verification against the protocol and `dataAvailabilityMessage` is a byte array containing the signature and addresses of the committee in ascending order.
6969
70-
2. It also implements a function to set the data availability protocol. Check [lines 250-260](https://github.com/0xPolygonHermez/zkevm-contracts/blob/b2a62e6af5738366e7494e8312184b1d6fdf287c/contracts/v2/consensus/validium/PolygonValidiumEtrog.sol#L250C1-L260C6) to see how they do this.
70+
2. It also implements a function to set the data availability protocol at [line 287](https://github.com/0xPolygonHermez/zkevm-contracts/blob/54f58c8b64806429bc4d5c52248f29cf80ba401c/contracts/v2/consensus/validium/PolygonValidiumEtrog.sol#L287) to see how they do this.
7171
7272
```solidity
7373
/**
@@ -87,13 +87,13 @@ This section shows you how to create a custom CDK validium DAC contract.
8787
8888
This section shows you how to deploy the Docker image containing your custom DAC contract.
8989
90-
1. Edit the following parameters in the [`docker/scripts/v2/deploy_parameters_docker.json`](https://github.com/0xPolygonHermez/zkevm-contracts/blob/develop/docker/scripts/v2/create_rollup_parameters_docker.json) file:
90+
1. Edit the following parameters in the [`docker/scripts/v2/deploy_parameters_docker.json`](https://github.com/0xPolygonHermez/zkevm-contracts/blob/v6.0.0-rc.1-fork.9/docker/scripts/v2/deploy_parameters_docker.json) file:
9191
9292
```json
9393
"minDelayTimelock": 3600, BECOMES "minDelayTimelock": 1,
9494
```
9595
96-
2. Edit the following parameters in the [`/docker/scripts/v2/create_rollup_parameters_docker.json`](https://github.com/0xPolygonHermez/zkevm-contracts/blob/develop/docker/scripts/v2/create_rollup_parameters_docker.json) file:
96+
2. Edit the following parameters in the [`/docker/scripts/v2/create_rollup_parameters_docker.json`](https://github.com/0xPolygonHermez/zkevm-contracts/blob/v6.0.0-rc.1-fork.9/docker/scripts/v2/create_rollup_parameters_docker.json) file:
9797
9898
```json
9999
"consensusContract": "PolygonValidiumEtrog", # CHANGE THIS TO YOUR CONTRACT NAME
@@ -106,13 +106,13 @@ This section shows you how to deploy the Docker image containing your custom DAC
106106
cp docker/scripts/v2/hardhat.example.paris hardhat.config.ts
107107
```
108108
109-
4. Edit [docker/scripts/v2/deploy-docker.sh](https://github.com/0xPolygonHermez/zkevm-contracts/blob/develop/docker/scripts/v2/deploy-docker.sh) to add the following line:
109+
4. Edit [docker/scripts/v2/deploy-docker.sh](https://github.com/0xPolygonHermez/zkevm-contracts/blob/v6.0.0-rc.1-fork.9/docker/scripts/v2/deploy-docker.sh) to add the following line:
110110
111111
```sh
112112
sudo chmod -R go+rxw docker/gethData before docker build -t hermeznetwork/geth-zkevm-contracts -f docker/Dockerfile .
113113
```
114114
115-
5. In the [deployment/v2/4_createRollup.ts](https://github.com/0xPolygonHermez/zkevm-contracts/blob/develop/deployment/v2/4_createRollup.ts) file, uncomment the following lines, and add a `console.log` output that grabs the address of the DAC:
115+
5. In the [deployment/v2/4_createRollup.ts](https://github.com/0xPolygonHermez/zkevm-contracts/blob/54f58c8b64806429bc4d5c52248f29cf80ba401c/deployment/v2/4_createRollup.ts#L290) file, uncomment the 290-291, and add a `console.log` output that grabs the address of the DAC:
116116
117117
```ts
118118
// Setup data committee to 0

0 commit comments

Comments
 (0)