Closed roxdanila closed 3 months ago
There is an edge case where the user might be prevented from withdrawing available rewards. If user has expired stake / claimable rewards for a tranche but has locked NXM for governance.
withdrawNXM
is hardcoded to always withdraw both stake and rewards, I guess, waiting for gov lock to expire is not a big deal. but wanted to flag this scenario in any case
@shark0der @roxdanila @MilGard91
marking as draft so it won't be accidentally merged while on audit
Context
Closes https://github.com/NexusMutual/smart-contracts/issues/1173
Add
TokenController.withdrawNXM
to withdraw all NXM from the platform. The caller must do the checks if the NXM is withdrawable and modify params accordingly to skip / include specific NXM withdrawals.Changes proposed in this pull request
unstakeForAll
withdrawRewardsTo
withdrawNXM
_withdrawClaimAssessmentTokensForUser
internal functionwithdrawPendingRewards
in favour ofwithdrawNXM
Test plan
Checklist
Review
When reviewing a PR, please indicate intention in comments using the following emojis: