Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Puffer token wrapper #90

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open

feat: Puffer token wrapper #90

wants to merge 5 commits into from

Conversation

sogipec
Copy link
Contributor

@sogipec sogipec commented Dec 2, 2024

No description provided.

Comment on lines 81 to 97
function claim(address user) external {
VestingData storage userVestingData = vestingData[user];
VestingID[] storage userAllVestings = userVestingData.allVestings;
uint256 i = userVestingData.nextClaimIndex;
uint256 claimable;
while (true) {
VestingID storage userCurrentVesting = userAllVestings[i];
if (userCurrentVesting.unlockTimestamp > block.timestamp) {
claimable += userCurrentVesting.amount;
++i;
} else {
userVestingData.nextClaimIndex = i;
break;
}
}
IERC20(token()).safeTransfer(user, claimable);
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gas issue can lead to revert.
Would advise either capping the number of iteration or creating a new function to be able to claim a specific set of indexes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants