msg.sender is used instead of streamOwner while unstaking from pointsContract in _unstakeVested()
fjordStaking:_unstakeVested() is an internal function, which is used for unstaking vested tokens. It takes streamOwner/ streamID/ amount as input parameters. But while unstaking from pointsContract, it passes msg.sender instead of streamOwner(which is taken as input)
Now this a problem because, when user stakeVested then points.onStake() is called with msg.seder, who is owner of streamID ie streamOwner
Now, _unstakeVested() is also called inside fjordStaking:onStreamCanceled(), which can only be called by sablier due to onlySablier modifier.
In onStreamCanceled(), msg.sender of _unstakeVested() will be sablier & points.onUnstaked() will be called with msg.sender(sablier) & in above code we saw points.onStaked() is called with msg.sender(who is owner of that streamID).
As result, points.onUnstaked() will always revert in _unstakeVested() when called from onSteamCanceled() because there is no stake in pointsContract with sablier address, but with the owner of streamID on whome onSteamCanceled() is called.
Natspecs of onStreamCanceled() says, this function may revert but it will always revert
/// @dev Notes: This function may revert, but the Sablier contract will ignore the revert.
Even after passsing correct inputs in _unstakeVested() but due to using msg.sender instead of streamOwner while unstaking from pointsContract will always revert the trx.
onStreamCanceled() will always revert
Manual Review
Use steamOwer instead of msg.sener in _unstakeVested() while unstaking from pointsContract
Indeed the `points.onUnstaked` should use the streamOwner instead of msg.sender as an input parameter. Impact: high - The vested stakers who got their streams canceled will keep on receiving rewards (points included) for the previously staked stream. Likelihood: low - whenever a Sablier stream sender decides to `cancel()` a recipient's stream
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.