Skip to content

Commit adf39e5

Browse files
committed
docs: enhance deployment instructions and add GitHub Actions workflow details
1 parent 7fef22f commit adf39e5

File tree

1 file changed

+53
-5
lines changed

1 file changed

+53
-5
lines changed

README.md

Lines changed: 53 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# iExec PoCo Smart Contracts
2+
13
[![codecov](https://codecov.io/github/iExecBlockchainComputing/PoCo/graph/badge.svg)](https://codecov.io/github/iExecBlockchainComputing/PoCo)
24

35
# Introduction
@@ -117,23 +119,69 @@ npm run test
117119
118120
## Deploy
119121
120-
You can deploy the smart contracts according to the [deploy/0_deploy.ts](./deploy/0_deploy.ts) content. This will automatically save some addresses of the deployed artifacts to the `./build` folder.
122+
The iExec PoCo contracts support automated deployment through both command-line interface and GitHub Actions workflows.
123+
124+
### Command Line Deployment
125+
126+
You can deploy the smart contracts according to the [deploy/0_deploy.ts](./deploy/0_deploy.ts) content. This will automatically save some addresses of the deployed artifacts to the `./deployments` folder.
121127
122-
To do so:
128+
To deploy using the CLI:
123129
124-
1. Make sure you followed the "Configure a deployment" section;
125-
2. Enter your targeted blockchain parameters in `hardhat.config.ts` configuration file;
130+
1. Make sure you followed the "Configure a deployment" section above
131+
2. Enter your targeted blockchain parameters in `hardhat.config.ts`
126132
3. Run the deployment using:
133+
127134
```
128135
npx hardhat deploy --network <your network name>
129136
```
130137
131-
Example of "complex" deployment:
138+
Example with custom salt:
132139
133140
```
134141
SALT=0x0000000000000000000000000000000000000000000000000000000000000001 npx hardhat deploy --network hardhat
135142
```
136143
144+
### GitHub Actions Deployment
145+
146+
For production deployments, we use GitHub Actions to automate the process with enhanced security. The workflow allows deploying to different networks with different environment configurations (development or production).
147+
148+
To deploy using GitHub Actions:
149+
150+
1. Navigate to the Actions tab in your GitHub repository
151+
2. Select the "Deploy PoCo Contracts" workflow
152+
3. Click "Run workflow"
153+
4. Choose the target network from the dropdown
154+
5. Select the deployment environment (develop or production)
155+
6. Start the workflow
156+
157+
The workflow will:
158+
1. Run tests for the target network (only in development environment)
159+
2. Deploy the contracts using the appropriate environment keys
160+
3. Update the `config.json` file with the deployed contract addresses
161+
4. Commit the deployment artifacts and updated configuration back to the repository
162+
5. Wait for the contracts to be indexed by the block explorer
163+
6. Verify the contracts on the blockchain explorer
164+
165+
## Contract Verification
166+
167+
After deploying contracts, you can verify them on block explorers to make their source code publicly available.
168+
169+
### Manual Verification
170+
171+
To manually verify contracts:
172+
173+
```
174+
npx hardhat run ./scripts/verify.ts --network <your network name>
175+
```
176+
177+
This script automatically reads all deployed contract addresses and their constructor arguments from the deployment artifacts and verifies them on the relevant block explorer.
178+
179+
### Automated Verification via GitHub Actions
180+
181+
The GitHub Actions workflow automatically handles contract verification after deployment. It waits 60 seconds for the contracts to be indexed by the block explorer before attempting verification.
182+
183+
The verification process uses the same script (`./scripts/verify.ts`) that reads deployment artifacts to verify each contract with its correct constructor arguments.
184+
137185
## Formatting
138186
139187
Format a specific file or files in a directory:

0 commit comments

Comments
 (0)