The claimRewards() function of TokeAutoEth.sol used the MYT(VaultV2) as the receiver of the Toke reward tokens. This permently locks the reward tokens on the VaultV2.
Vulnerability Details
The Toke reward token from calling claimRewards() is sent to the MYT which is the Morpho VaultV2 because MYT is passed as the receiver of the reward tokens. Since the VaultV2 does not have function to manage or pull the Toke reward token, the Toke reward token will permanently locked on the VaultV2.
File: TokeAutoEth.solfunction_claimRewards()internaloverridereturns(uint256rewardsClaimed){ rewardsClaimed = rewarder.earned(address(this)); rewarder.getReward(address(this),address(MYT),false);//@audit MYT is the receiver of Toke reward tokens}
The external claimRewards function is on the parent MYTStrategy.sol contract.
Looking at the rewarder contract's getReward(...) function it can be seen that the receiver parameter is what is passed as the MYT
Impact Details
All earned Toke reward tokens will be permanently locked on the VaultV2 contract when anyone calls the claimRewards() function of TokeAutoEth.sol
Recommendation
Consider managing the Token Reward tokens instead of the passing MYT as the receiver.
Proof of Concept
Proof of Concept
Create a file named POC.t.so in this directory: src/test/strategies/POC.t.sol
Run forge test --match-test test_LockRewards_on_MYT -vvv
This test shows that claimRewards() function sends claimed Toke reward tokens to the MYT contract which does not have any function to handle to tokens causing the tokens to be locked on the contract.