as we know the streams after certen amount of time of being created the stream funds start being withdrawable.
the `stakeVested()` function allow users to stake their streams even if the withdrawable amount is positive, and they cant withdraw after stking the stream.
paste the folowing test contract inside the following directory:
2024-08-FJORD/test/unit/TestStakeVested.t.sol
and run forge test --mt testNftsWithPositiveWithdrawableAmountCanBeSTaked -vvv
as we can se alice balance didnt change and the NFT get staked with all the funds.
inside the `SablierV2Lockup.sol` there is a public withdraw function that can be called by any authorizedSablierSenders and it will not revert when the to parameter is the stream recipient.
here a link to the withdraw function: https://github.com/johnpaulcas/v2-core/blob/d1157b49ed4bceeff0c4e437c9f723e88c134d3a/src/abstracts/SablierV2Lockup.sol#L220C4-L257C6
the authorizedSablierSenders can withdraw the funds to address(FjordStaking)with no chance to the user to get his funds back.
authorizedSablierSenders can cause a lose of funds to the user who prefer to stake their streams without withdrawing the `SablierV2Lockup.withdrawableAmountOf()` these streams.
here is a test as a proof, copy paste the following test inside the file we opened early:
2024-08-FJORD/test/unit/TestStakeVested.t.sol
manual review, foundry test
i sugest modifying the function to withdraw the stream funds to the user before staking
then stake the vFJO and the withdrawn FJO at the same time.
or revert when the `SablierV2Lockup.withdrawableAmountOf()` of the stream is positive and tell the users to withdraw then stake.
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.