Skip to content

Commit

Permalink
Add getLockupsCount method (#411)
Browse files Browse the repository at this point in the history
  • Loading branch information
shahthepro authored Apr 24, 2024
1 parent c02d6b5 commit 820fccf
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions contracts/ExponentialStaking.sol
Original file line number Diff line number Diff line change
Expand Up @@ -267,4 +267,12 @@ contract ExponentialStaking is ERC20Votes {
(uint256 currentPoints,) = previewPoints(1e36, 0); // 1e36 saves a later multiplication
return amount * ((currentPoints / fullPoints)) / 1e18;
}

/// @notice Returns the total number of lockups the user has
/// created so far (including expired & unstaked ones)
/// @param user Address
/// @return asset Number of lockups the user has had
function getLockupsCount(address user) external view returns (uint256) {
return lockups[user].length;
}
}

0 comments on commit 820fccf

Please sign in to comment.