Skip to content

Commit dfe5c97

Browse files
authored
docs: Update docs and diagrams (#250)
2 parents 5512018 + 6d98829 commit dfe5c97

27 files changed

+7194
-5870
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,6 @@ build/*.json
2020
contracts/hardhat-dependency-compiler/
2121
deployments/*hardhat*
2222
deployments/dev-*
23+
24+
# Flattened Solidity file used to generate diagrams.
25+
flatten.sol

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Changelog
22

33
## vNEXT
4+
- Update docs and diagrams (#250)
45
- Support Arbitrum One (#248)
56
- Save IexecLibOrders_v5 in config file (#242)
67
- Migrate proxy to Diamond pattern (ERC-2535):

README.md

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -20,21 +20,24 @@ This repository contains the smart contract implementation of iExec's PoCo proto
2020

2121
- [Contracts and Actors Architecture](./docs/README.md#contracts-and-actors-architecture)
2222
- [State diagrams](./docs/Statuses.md)
23-
- [Storage diagram (Boost)](./docs/uml/storage-IexecPocoBoostDelegate.svg)
2423
- [Nominal workflow sequence](./docs/README.md#nominal)
2524
- [Nominal workflow sequence w/ TEE](./docs/README.md#nominaltee)
2625
- [Boost workflow sequence](./docs/README.md#boost)
26+
- Storage diagrams
27+
- [Diamond storage](./docs/uml/storage-diagram-diamond.svg)
28+
- [PoCo storage](./docs/uml/storage-diagram-poco.svg)
2729
- UML classes related to:
28-
- [IexecPocoDelegates](./docs/uml/class-uml-IexecPocoDelegates.svg)
29-
- [IexecPocoBoostDelegate](./docs/uml/class-uml-IexecPocoBoostDelegate.svg)
30+
- [IexecPoco1Facet & IexecPoco2Facet](./docs/uml/class-uml-IexecPocoFacets.svg)
31+
- [IexecPocoBoostFacet](./docs/uml/class-uml-IexecPocoBoostFacet.svg)
3032
- [IexecEscrows](./docs/uml/class-uml-IexecEscrows.svg)
3133
- [iExec PoCo registries](./docs/uml/class-uml-dir-registries.svg)
3234
- [iExec PoCo libraries](./docs/uml/class-uml-dir-libs.svg)
33-
- [iExec PoCo modules](./docs/uml/class-uml-dir-modules.svg)
35+
- [iExec PoCo modules (facets)](./docs/uml/class-uml-dir-facets.svg)
3436

3537
## Documentation
3638

3739
- [Solidity API documentation](./docs/solidity/index.md)
40+
<!-- TODO update with new documentation URL -->
3841
- [Full PoCo documentation](https://protocol.docs.iex.ec/key-concepts/proof-of-contribution)
3942

4043
## Audits
@@ -45,7 +48,7 @@ All contract audit files can be found in [audit/](./audit/) folder.
4548

4649
## Configure a deployment
4750

48-
Starting from version 5, the PoCo uses a modular design based on [ERC1538](https://github.com/ethereum/EIPs/issues/1538). The migration scripts and tests will use different modules and deployment process depending on the required configuration. In particular, the configuration can use a [create2 factory](https://github.com/iExecBlockchainComputing/iexec-solidity/blob/master/contracts/Factory/GenericFactory.sol) for the deployment, and enable native token or ERC20 token based escrow depending on the targeted blockchain. This means that the codebase is the same on public blockchains (ERC20 based RLC) and dedicated sidechains (Native token based RLC).
51+
Starting from version 5, the PoCo uses a modular design based on [ERC-2535](https://eips.ethereum.org/EIPS/eip-2535). The migration scripts and tests will use different modules (facets) and deployment process depending on the required configuration. In particular, the configuration can use a [create2 factory](https://github.com/iExecBlockchainComputing/iexec-solidity/blob/master/contracts/Factory/GenericFactory.sol) for the deployment, and enable native token or ERC20 token based escrow depending on the targeted blockchain. This means that the codebase is the same on public blockchains (ERC20 based RLC) and dedicated sidechains (Native token based RLC).
4952

5053
The configuration file is located in `./config/config.json`.
5154

@@ -69,15 +72,15 @@ If you want to deploy the iExec PoCo V5 smart contracts on a new blockchain, the
6972
## Additional configuration & environment variables
7073

7174
Environment variable can be used to alter the configuration of a deployment:
72-
- **SALT**: if set, the `SALT` envvar will overwrite the salt parameter from the config. This can be useful to distinguish different deployments without modifying the config.
75+
- **SALT**: if set, the `SALT` env var will overwrite the salt parameter from the config. This can be useful to distinguish different deployments without modifying the config.
7376

7477
Additionally, the migration process will look for some smart contracts before deploying new instances. This is true of the application, dataset and workerpool registries. Thus, if different marketplaces are deployed to the same network, they will share these registries.
7578

7679
# Development
7780

7881
## Build
7982

80-
The PoCo smart contracts are in the `./contracts` folder. Json artifacts, containing the contracts bytecode and ABI can be found in the `./build` folder. In case you need to regenerate them, you can use the following command:
83+
The PoCo smart contracts are in the `contracts/` folder. Json artifacts, containing the contracts bytecode and ABI can be found in the `artifacts/` folder. In case you need to regenerate them, you can use the following command:
8184
```
8285
npm install
8386
npm run build
@@ -114,7 +117,7 @@ The automatic testing command uses the Hardhat network by default to run the tes
114117
If your blockchain listen to a port that is not 8545, or if the blockchain is on a different node, update the `hardhat.config.ts` configuration (network ports, accounts with mnemonic, ..) accordingly to the [Hardhat Configuration](https://hardhat.org/hardhat-runner/docs/config) documentation.
115118
3. Run tests
116119
```
117-
npm run test
120+
npm run test -- --network <networkUrl>
118121
```
119122
120123
## Deploy
@@ -123,7 +126,7 @@ The iExec PoCo contracts support automated deployment through both command-line
123126
124127
### Command Line Deployment
125128
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.
129+
You can deploy the smart contracts according to the [deploy/0_deploy.ts](./deploy/0_deploy.ts) content. This will automatically save addresses of the deployed artifacts to `deployments/` folder.
127130
128131
To deploy using the CLI:
129132
@@ -132,7 +135,7 @@ To deploy using the CLI:
132135
3. Run the deployment using:
133136
134137
```
135-
npx hardhat deploy --network <your network name>
138+
npm run deploy -- --network <your network name>
136139
```
137140
138141
Example with custom salt:
@@ -142,12 +145,12 @@ SALT=0x0000000000000000000000000000000000000000000000000000000000000001 npx hard
142145
```
143146
144147
145-
### Manual Verification
148+
### Verification
146149
147-
To manually verify contracts:
150+
To verify contracts:
148151
149152
```
150-
npx hardhat run ./scripts/verify.ts --network <your network name>
153+
npm run verify:all -- --network <your network name> # e.g. arbitrum
151154
```
152155
153156
This script automatically reads all deployed contract addresses and their constructor arguments from the deployment artifacts and verifies them on the relevant block explorer.
@@ -167,19 +170,19 @@ To render all UML diagrams:
167170
npm run uml
168171
```
169172
170-
### Render only class diagrams
173+
To render only class diagrams:
171174
172175
```
173176
npm run sol-to-uml
174177
```
175178
176-
### Render only .puml files
179+
To render only .puml files:
177180
178181
```
179182
npm run puml-to-links
180183
```
181184
182-
### Render only storage diagrams
185+
To render only storage diagrams:
183186
184187
```
185188
npm run storage-to-diagrams

contracts/facets/FacetBase.sol

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ pragma solidity ^0.6.0;
66
import "../libs/PocoStorageLib.sol";
77
import "../interfaces/IOwnable.sol";
88

9-
// Functions that were declared in ERC1538Store are re-declared here.
109
// TODO use LibDiamond.contractOwner() when migrating all contracts to v8.
1110

1211
/**

contracts/facets/FacetBase.v8.sol

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ pragma solidity ^0.8.0;
66
import {IERC5313} from "@openzeppelin/contracts-v5/interfaces/IERC5313.sol";
77
import {PocoStorageLib} from "../libs/PocoStorageLib.v8.sol";
88

9-
// Functions that were declared in ERC1538Store are re-declared here.
109
// TODO use LibDiamond.contractOwner() when migrating all contracts to v8.
1110

1211
/**
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// SPDX-FileCopyrightText: 2025 IEXEC BLOCKCHAIN TECH <[email protected]>
2+
// SPDX-License-Identifier: Apache-2.0
3+
4+
pragma solidity ^0.8.0;
5+
6+
import {LibDiamond} from "@mudgen/diamond-1/contracts/libraries/LibDiamond.sol";
7+
import {PocoStorageLib} from "../../libs/PocoStorageLib.v8.sol";
8+
9+
// /!\ These contracts are only used to generate storage diagrams, they are not meant
10+
// to be deployed or used in any way.
11+
// PocoStorageLib and LibDiamond use namespaced storage which makes sol2uml unable to
12+
// generate diagrams directly, so these contracts provide their structs to sol2uml.
13+
14+
contract DiamondStorageDiagram {
15+
LibDiamond.DiamondStorage diamondStorage;
16+
}
17+
18+
contract PocoStorageDiagram {
19+
PocoStorageLib.PocoStorage pocoStorage;
20+
}

contracts/tools/testing/IexecPocoBoostCompositeDelegate.sol

Lines changed: 0 additions & 17 deletions
This file was deleted.

docs/Statuses.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
## Task statuses
1+
## Task statuses
22

33
Flows:
44
- Nominal
5-
- "Contribute and finalize"
5+
- ContributeAndFinalize
66
- Boost
77

88
```mermaid
@@ -22,7 +22,7 @@ flowchart TB
2222
```
2323
## Contributions statuses
2424

25-
- Nominal and "contribute and finalize" flows
25+
- Nominal and ContributeAndFinalize flows
2626

2727
```mermaid
2828
flowchart TB

0 commit comments

Comments
 (0)