Skip to content

Commit

Permalink
feat: isMemberGivenContributionId (#130)
Browse files Browse the repository at this point in the history
  • Loading branch information
pegahcarter authored Oct 22, 2024
1 parent 51f68c9 commit 5051b47
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
10 changes: 10 additions & 0 deletions contracts/tasks/TaskManager.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
7 changes: 7 additions & 0 deletions contracts/tasks/interfaces/ITaskManager.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 5051b47

Please sign in to comment.