Skip to content

Commit

Permalink
chore: add utility function to base kpi token contract
Browse files Browse the repository at this point in the history
  • Loading branch information
luzzifoss committed Jan 2, 2024
1 parent 94a76a6 commit 717ec25
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions contracts/presets/kpi-tokens/BaseKPIToken.sol
Original file line number Diff line number Diff line change
Expand Up @@ -97,4 +97,14 @@ abstract contract BaseKPIToken is IKPIToken, Initializable {
function template() external view override returns (Template memory) {
return IBaseTemplatesManager(kpiTokensManager).template(templateId, templateVersion);
}

/// @dev Queries the KPI tokens template manager's feature registry to know if a custom feature
/// of this KPI token is enabled for a target account or not.
/// @param _featureId The identifier of the queried custom feature.
/// @param _account The target account.
/// @return Whether the feature with the given identifier is enabled for the given account
/// or not.
function isFeatureEnabledFor(uint256 _featureId, address _account) internal view returns (bool) {
return IBaseTemplatesManager(kpiTokensManager).isTemplateFeatureEnabledFor(templateId, _featureId, _account);
}
}

0 comments on commit 717ec25

Please sign in to comment.