Fujicracy / fuji-v2

Cross-chain money market aggregator
https://fuji-v2-frontend.vercel.app
15 stars 10 forks source link

Rewards token of vaults from providers are wasted #329

Closed trungore closed 1 year ago

trungore commented 1 year ago

Title

Rewards token of vaults from providers are wasted

Affected smart contract

https://github.com/Fujicracy/fuji-v2/blob/1b939ec84af137db430fc2aa1b4c6f15e5254003/packages/protocol/src/providers/mainnet/CompoundV2.sol https://github.com/Fujicracy/fuji-v2/blob/1b939ec84af137db430fc2aa1b4c6f15e5254003/packages/protocol/src/providers/mainnet/CompoundV3.sol https://github.com/Fujicracy/fuji-v2/blob/1b939ec84af137db430fc2aa1b4c6f15e5254003/packages/protocol/src/providers/mainnet/AaveV2.sol https://github.com/Fujicracy/fuji-v2/blob/1b939ec84af137db430fc2aa1b4c6f15e5254003/packages/protocol/src/providers/arbitrum/AaveV3Arbitrum.sol

Description

Some providers distribute rewards for users supplying or borrowing from them. But Fuji vaults doesn't have any function to recover these reward tokens. So the rewards claimed to the vaults will be wasted.

PR: https://github.com/Fujicracy/fuji-v2/pull/335

Recommendation

Add a function like sweepToken into vault contracts, or create a mechanism to claim rewards from providers.

0xdcota commented 1 year ago

This feature will be implemented at a later stage. The team is aware of harvesting rewards, and a pending issue was opened in September 2022. Refer to #66