forked from sourcekeeper_42/sourcekeeper_42-contract-lab
65 lines
2.2 KiB
Solidity
65 lines
2.2 KiB
Solidity
// 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);
|
|
} |