You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Now we have set the configuration for our contracts, lets deploy!
59
+
## Deploy and verify contracts
60
60
61
-
The first step is deploying and verifying the `CDKValidiumDeployer`, this will be the factory for deterministic contracts, the address of the contracts will depend on the salt and the `initialCDKValidiumDeployerOwner` inside `deploy_parameters.json`.
61
+
### `CDKValidiumDeployer`
62
62
63
-
```bash
64
-
~/cdk-validium/cdk-validium-contracts-0.0.2/deployment % npm run deploy:deployer:CDKValidium:sepolia
65
-
```
63
+
This contract is a factory that deploys the deterministic contracts required by the system and must be deployed first.
66
64
67
-
On successful deployment of `CDKValidiumDeployer`, you should see something similar to this:
65
+
The address of the contracts it creates depends on the salt and the `initialCDKValidiumDeployerOwner` inside `deploy_parameters.json`.
68
66
69
-
```bash
70
-
cdkValidiumDeployer deployed on: 0x87572242776ccb6c98F4Cf1ff20f7e5a4e4142fF
71
-
```
67
+
1. Run the deploy script.
72
68
73
-
Now we can move forward and deploy the rest of the contract suite:
69
+
```bash
70
+
npm run deploy:deployer:CDKValidium:sepolia
71
+
```
74
72
75
-
```bash
76
-
~/cdk-validium/cdk-validium-contracts-0.0.2/deployment % npm run deploy:testnet:CDKValidium:sepolia
77
-
```
73
+
You should see something similar to this:
78
74
79
-
Please note this can take several minutes depending on network conditions.
75
+
```bash
76
+
cdkValidiumDeployer deployed on: 0x87572242776ccb6c98F4Cf1ff20f7e5a4e4142fF
77
+
```
80
78
81
-
On successful deployment, a new directory named `deployments` should have been created. Inside that directory, another was created with information about your deployment.
79
+
2. Now we can deploy the rest of the contract suite.
In addition to `deploy_output.json`, a `genesis.json` should have been generated in`~/cdk-validium/cdk-validium-contracts-0.0.2/deployment/`
111
-
We will take the outputs of `genesis.json` and `deploy_output.json` and use them to configure our node in the next steps of setup and deployment of `cdk-validium-node`.
85
+
!!! info
86
+
This may take several minutes depending on network conditions.
112
87
88
+
3. On successful deployment, you should see a new directory named `deployments` containing a directory storing the information about your deployment. For example:
113
89
114
-
Congrats! You’ve deployed the CDK Validium contracts!
4. In addition to the `deploy_output.json` file, you should see a `genesis.json` file in`~/cdk-validium/cdk-validium-contracts-0.0.2/deployment/`.
117
118
118
-
If deploying to Sepolia, the contracts should be automatically verified based on other live deployments on the network with similar bytecode. If you see that the contracts have not been verified on Etherscan. Run the following commands:
119
+
We will take the outputs of `genesis.json` and `deploy_output.json` and use them to configure the `cdk-validium-node` node.
119
120
120
-
To verify the contract factory:
121
+
!!! warning "Deployment failure"
122
+
- Since there are deterministic addresses, you cannot deploy twice on the same network using the same `salt` and `initialCDKValidiumDeployerOwner` inside `deploy_parameters.json`. Changing one of them is enough to make a new deployment.
123
+
- It's mandatory to delete the `~/cdk-validium/cdk-validium-contracts-0.0.2/.openzeppelin` upgradability information in order to make a new deployment.
121
124
122
-
```bash
123
-
~/cdk-validium/cdk-validium-contracts-0.0.2/deployment % npm run verify:deployer:CDKValidium:sepolia
124
-
```
125
+
## Verifying contracts
125
126
126
-
To verify the rest of the contract suite:
127
+
When deploying to Sepolia, the contracts should automatically verify based on other live deployments on the network with similar bytecode. If the contracts have not been verified on Etherscan, run the following commands from the `/cdk-validium/cdk-validium-contracts-0.0.2/deployment` directory.
127
128
128
-
```bash
129
-
~/cdk-validium/cdk-validium-contracts-0.0.2/deployment % npm run verify:CDKValidium:sepolia
130
-
```
129
+
1. To verify the contract factory:
130
+
131
+
```bash
132
+
npm run verify:deployer:CDKValidium:sepolia
133
+
```
134
+
135
+
2. To verify the rest of the contract suite:
131
136
132
-
### Using a different node provider
137
+
```bash
138
+
npm run verify:CDKValidium:sepolia
139
+
```
133
140
134
-
If you prefer to use a different node provider than Infura, the contents of `~/cdk-validium/cdk-validium-contracts-0.0.2/hardhat.config.js` and `.env` can be modified to fit your provider.
141
+
## Using a different node provider
135
142
136
-
For example using Alchemy:
143
+
Modify the contents of `~/cdk-validium/cdk-validium-contracts-0.0.2/hardhat.config.js` and `cdk-validium-contracts-0.0.2/.env` if you prefer to use a different node provider than Infura.
url: `https://eth-sepolia.g.alchemy.com/v2/${process.env.ALCHEMY_PROJECT_ID}`, # rpc value changed here
150
157
accounts: {
@@ -154,10 +161,4 @@ sepolia: {
154
161
count: 20,
155
162
},
156
163
},
157
-
```
158
-
159
-
### Deployment failure
160
-
161
-
- Since there are deterministic address you cannot deploy twice on the same network using the same `salt` and `initialCDKValidiumDeployerOwner` inside `deploy_parameters.json`. Changing one of them is enough to make a new deployment.
162
-
163
-
- It's mandatory to delete the `~/cdk-validium/cdk-validium-contracts-0.0.2/.openzeppelin` upgradability information in order to make a new deployment
1. Create a new directory to store the `cdk-validium-contracts` and the `cdk-validium-node`and cd into it.
3
+
1. Create a new directory and cd into it.
4
4
5
5
```bash
6
6
mkdir cdk-validium
@@ -10,43 +10,40 @@
10
10
2. Download the `0.0.2` release from the [cdk-validium-contracts github repo](https://github.com/0xPolygon/cdk-validium-contracts/releases/tag/v0.0.2-RC1).
11
11
12
12
!!! note
13
-
It is available in both `.tar.gz` and `.zip` formats
13
+
The download is available in both `.tar.gz` and `.zip` formats.
0 commit comments