diff --git a/contracts/tasks/TaskManager.sol b/contracts/tasks/TaskManager.sol index 27a9ae7b..80858191 100644 --- a/contracts/tasks/TaskManager.sol +++ b/contracts/tasks/TaskManager.sol @@ -295,6 +295,16 @@ contract TaskManager is ITaskManager, Initializable, PeriodUtils, AccessUtils { return memberActivities[who][periodId].pointsGiven; } + /// @inheritdoc ITaskManager + function isMemberGivenContributionId(address who, bytes32 contributionId) external view returns (bool) { + return memberContributions[who].contains(contributionId); + } + + /// @inheritdoc ITaskManager + function getMemberContributionIds(address who) external view returns (bytes32[] memory) { + return memberContributions[who].values(); + } + /// @inheritdoc ITaskManager function getMemberContributionIds(address who, uint32 periodId) external view returns (bytes32[] memory) { return memberActivities[who][periodId].contributionIds; diff --git a/contracts/tasks/interfaces/ITaskManager.sol b/contracts/tasks/interfaces/ITaskManager.sol index 9d756f71..22fd89c7 100644 --- a/contracts/tasks/interfaces/ITaskManager.sol +++ b/contracts/tasks/interfaces/ITaskManager.sol @@ -140,6 +140,13 @@ interface ITaskManager { /// @notice return the amount of points a member has been given for a provided periodId function getMemberPointsGiven(address who, uint32 periodId) external view returns (uint128); + /// @notice return true if a member has been given a specific contributionId + /// @dev each member can only receive a unique contributionId once + function isMemberGivenContributionId(address who, bytes32 contributionId) external view returns (bool); + + /// @notice return the contributionId's given to a member across all periods + function getMemberContributionIds(address who) external view returns (bytes32[] memory); + /// @notice return the contributionId's given to a member for a provided periodId function getMemberContributionIds(address who, uint32 periodId) external view returns (bytes32[] memory);