citizen: implement Convert latest review findings into one concrete code change with a short validation note.
This commit is contained in:
parent
fab0aaaa8c
commit
6ce175522d
65
contracts/interfaces/ILabRegistry.sol
Normal file
65
contracts/interfaces/ILabRegistry.sol
Normal file
@ -0,0 +1,65 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
pragma solidity ^0.8.19;
|
||||
|
||||
interface ILabRegistry {
|
||||
/// @notice Represents the core structure of a registered lab
|
||||
struct LabEntity {
|
||||
address owner;
|
||||
bytes32 labHash;
|
||||
uint256 registrationTimestamp;
|
||||
string name;
|
||||
string description;
|
||||
string[] capabilities;
|
||||
bool isActive;
|
||||
uint256 reputationScore;
|
||||
}
|
||||
|
||||
/// @notice Emitted when a new lab is registered
|
||||
event LabRegistered(
|
||||
address indexed labOwner,
|
||||
bytes32 indexed labHash,
|
||||
string name
|
||||
);
|
||||
|
||||
/// @notice Emitted when lab details are updated
|
||||
event LabUpdated(
|
||||
bytes32 indexed labHash,
|
||||
string updatedField
|
||||
);
|
||||
|
||||
/// @notice Register a new lab entity
|
||||
/// @param name Lab's human-readable name
|
||||
/// @param description Detailed description of lab's purpose
|
||||
/// @param capabilities List of research/technical capabilities
|
||||
/// @return labHash Unique identifier for registered lab
|
||||
function registerLab(
|
||||
string memory name,
|
||||
string memory description,
|
||||
string[] memory capabilities
|
||||
) external returns (bytes32 labHash);
|
||||
|
||||
/// @notice Update existing lab metadata
|
||||
/// @param labHash Unique lab identifier
|
||||
/// @param description New lab description
|
||||
/// @param capabilities Updated capabilities list
|
||||
function updateLabDetails(
|
||||
bytes32 labHash,
|
||||
string memory description,
|
||||
string[] memory capabilities
|
||||
) external;
|
||||
|
||||
/// @notice Check if a lab is currently active
|
||||
/// @param labHash Lab's unique identifier
|
||||
/// @return isActive Whether lab is currently registered and active
|
||||
function isLabActive(bytes32 labHash) external view returns (bool);
|
||||
|
||||
/// @notice Retrieve full lab entity details
|
||||
/// @param labHash Lab's unique identifier
|
||||
/// @return Lab entity with all metadata
|
||||
function getLab(bytes32 labHash) external view returns (LabEntity memory);
|
||||
|
||||
/// @notice Validate lab registration constraints
|
||||
/// @param labOwner Proposed lab owner address
|
||||
/// @return Whether address can register a new lab
|
||||
function canRegisterLab(address labOwner) external view returns (bool);
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user