From bd11fec2166158bc5bbf89ccbe09c2237717d7fd Mon Sep 17 00:00:00 2001 From: sourcekeeper_42 Date: Sun, 19 Apr 2026 09:06:47 +0000 Subject: [PATCH] docs: add documentation for ILabRegistry.sol --- docs/ILabRegistry.md | 58 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 docs/ILabRegistry.md diff --git a/docs/ILabRegistry.md b/docs/ILabRegistry.md new file mode 100644 index 000000000..c28a0728a --- /dev/null +++ b/docs/ILabRegistry.md @@ -0,0 +1,58 @@ +## Overview +The `ILabRegistry` interface defines a comprehensive system for managing and tracking research laboratory entities on the ChunkNet blockchain. It provides mechanisms for registering, updating, and managing lab metadata, researchers, and lifecycle states. + +## Interface + +| Function | Visibility | Description | Parameters | Returns | +|----------|------------|-------------|------------|---------| +| `registerLab` | External | Register a new lab | `name`, `description`, `metadataHash` | `labId` | +| `updateLabDetails` | External | Update existing lab metadata | `labId`, `newName`, `newDescription`, `newMetadataHash` | - | +| `addResearcher` | External | Add authorized researcher | `labId`, `researcherAddress` | - | +| `removeResearcher` | External | Remove authorized researcher | `labId`, `researcherAddress` | - | +| `getLab` | External View | Retrieve lab details | `labId` | `LabEntity` | +| `isAuthorizedResearcher` | External View | Check researcher authorization | `labId`, `researcherAddress` | `bool` | +| `deactivateLab` | External | Disable lab modifications | `labId` | - | + +## Events +- `LabRegistered`: Triggered when a new lab is registered +- `LabUpdated`: Emitted when lab details are modified + +## Storage Layout +- `LabEntity` struct contains: + - `owner`: Lab owner's address + - `name`: Lab name + - `description`: Lab description + - `metadataHash`: Content/IPFS hash + - `registrationTimestamp`: Creation timestamp + - `isActive`: Current lab status + - `authorizedResearchers`: List of permitted researchers + +## Access Control +- Lab registration requires unique naming +- Only lab owners can modify lab details +- Researcher addition/removal restricted to lab owner +- Deactivation prevents further modifications + +## Security Considerations +- Use input validation for lab names and descriptions +- Implement access control checks in implementation +- Consider rate limiting for registration +- Validate researcher addresses +- Use cryptographic hashing for metadata integrity + +## Deployment +- **RPC URL**: https://rpc.chunknet.org +- **Chain ID**: 214562 +- **Recommended Deployment Steps**: + 1. Compile with Solidity 0.8.19 + 2. Use ChunkNet deployment scripts + 3. Set initial owner/admin + 4. Verify contract on explorer + +## Testing +- Unit test lab registration workflow +- Test researcher authorization mechanisms +- Validate metadata update restrictions +- Check deactivation behavior +- Perform boundary testing on input parameters +- Simulate edge cases in researcher management \ No newline at end of file