Open code423n4 opened 2 years ago
collectEarnings
is designed to be called by strategist in this version or by automated strategy in future versions.
As collectEarnings
is intended to be called continuously in future versions, I will not rate this issue as high
severity. However, the current version may be impacted if the strategist does not routinely call collectEarnings
. There is no loss of funds or impact on the protocol, but the current design can be misleading to depositors. Marking as low
severity.
Handle
gzeon
Vulnerability details
Impact
UniV3Vault
does not distribute fee earning to depositor. Fee from Uniswap V3 LP is collected by permissionedcollectEarnings
function that allow owner to send fee to arbitrary address. Since LP fees are the only reason for anyone to LP (the expected return of pure LP without fee is -ve verus hodl), there are no reason for the fee collected to be considered separately from the tvl. And sinceUniV3Vault
does not consider fee earning when calculating tvl, this will lead to depositors miss out the fee entirely anyway.Proof of Concept
https://github.com/code-423n4/2021-12-mellow/blob/6679e2dd118b33481ee81ad013ece4ea723327b5/mellow-vaults/contracts/UniV3Vault.sol#L100
collectEarnings
allow owner to send fee to arbitary address https://github.com/code-423n4/2021-12-mellow/blob/6679e2dd118b33481ee81ad013ece4ea723327b5/mellow-vaults/contracts/UniV3Vault.sol#L84and not called anywhere https://github.com/code-423n4/2021-12-mellow/blob/6679e2dd118b33481ee81ad013ece4ea723327b5/mellow-vaults/contracts/UniV3Vault.sol#L80
Recommended Mitigation Steps
Make
collectEarnings
permissionless, incentivize it or otherwise make sure it is called regularly. Make surecollectEarnings
send the reward back to the vault but not anywhere else. Consider fee earning when calculating tvl.