Conversation
cygnusv
left a comment
There was a problem hiding this comment.
Looks good in general! just some comments
| ApplicationInfo storage applicationStruct = applicationInfo[msg.sender]; | ||
| require( | ||
| applicationStruct.status == ApplicationStatus.APPROVED, | ||
| "Application is not approved" | ||
| ); |
There was a problem hiding this comment.
Can we remove this check? Given that TACoApp is trusted in this context, it seems a bit redundant.
There was a problem hiding this comment.
I was trying to get same logic as in another methods, and that part is already tested
There was a problem hiding this comment.
I see. My concern was cost for a migration of dozens of stakers, but apparently since we do this in a batch TX, only the first access to applicationStruct.status would get the full SLOAD cost, and the rest will only be 100 gas.
| // Unstake | ||
| stakingProviderStruct.tStake -= authorization.deauthorizing; | ||
| decreaseStakeCheckpoint(stakingProvider, authorization.deauthorizing); | ||
| emit Unstaked(stakingProvider, authorization.deauthorizing); | ||
| token.safeTransfer(stakingProviderStruct.owner, authorization.deauthorizing); | ||
|
|
||
| authorization.deauthorizing = 0; |
There was a problem hiding this comment.
What's the goal of these lines?
There was a problem hiding this comment.
unstake the rest, everything over minimum
No description provided.