Skip to content

Commit

Permalink
added func to return all claimed amounts for an account
Browse files Browse the repository at this point in the history
  • Loading branch information
BkChoy committed Apr 1, 2024
1 parent cf3df02 commit dab2b76
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions contracts/MerkleDistributor.sol
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,22 @@ contract MerkleDistributor is Ownable {
return claimed[_token][_account];
}

/**
* @notice Returns the total amount that a user has claimed across all distributions
* @param _account address of account
* @return claimed account's claimed amount for each distribution
*/
function getAllClaimed(address _account) external view returns (uint256[] memory) {
uint256 tokenCount = tokens.length;
uint256[] memory retClaimed = new uint256[](tokenCount);

for (uint256 i = 0; i < tokenCount; ++i) {
retClaimed[i] = getClaimed(tokens[i], _account);
}

return retClaimed;
}

/**
* @notice adds a token distribution
* @param _token token address
Expand Down

0 comments on commit dab2b76

Please sign in to comment.