Files
no_five/contracts/interfaces/IPolicyModule.sol
2025-11-20 15:35:25 -08:00

50 lines
1.3 KiB
Solidity

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.24;
/**
* @title IPolicyModule
* @notice Interface for policy modules
* @dev Policy modules enforce governance rules and risk limits
*/
interface IPolicyModule {
/**
* @notice Policy decision result
* @param allowed Whether the action is allowed
* @param reason Reason for denial (if not allowed)
*/
struct PolicyDecision {
bool allowed;
string reason;
}
/**
* @notice Evaluate policy for a proposed action
* @param actionType Type of action (encoded as bytes32)
* @param actionData Action-specific data
* @return decision Policy decision
*/
function evaluate(
bytes32 actionType,
bytes memory actionData
) external view returns (PolicyDecision memory decision);
/**
* @notice Get policy module name
* @return name Module name
*/
function name() external pure returns (string memory name);
/**
* @notice Check if module is enabled
* @return enabled True if enabled
*/
function isEnabled() external view returns (bool enabled);
/**
* @notice Enable or disable the module
* @param enabled New enabled status
*/
function setEnabled(bool enabled) external;
}