Platform: Code4rena
Start Date: 13/05/2022
Pot Size: $30,000 USDC
Total HM: 8
Participants: 65
Period: 3 days
Judge: hickuphh3
Total Solo HM: 1
Id: 125
League: ETH
Rank: 10/65
Findings: 2
Award: $1,376.01
π Selected for report: 0
π Solo Findings: 0
The ConvexCurveLPVault.sol
contract allows users to earn a yield on curve token deposits. Rewards are paid out in native CRV
and CVX
tokens but the reward manager of the base pool may opt to add extra rewards. Because the reward manager has the ability to extend the list of extra rewards, they can extend it such that the processYield()
function is unable to execute within a single block. As a result, the protocol effectively loses out on all yield accrued by user's deposits. This yield is forever locked in the contract as the yield is never transferred out from the vault contract.
Consider restricting the number of extra rewards by only iterating through the first X
number of tokens in processYield()
.
#0 - sforman2000
2022-05-18T02:33:42Z
367.5749 USDC - $367.57
https://github.com/code-423n4/2022-05-sturdy/blob/main/smart-contracts/YieldManager.sol#L118-L137
processYield()
restricts who can call this function to just the vault admin. Upon being processed, the treasury receives its fair share of the yield and the rest is transferred to the YieldManager.sol
contract. To distribute yield, the manager calls distributeYield()
to swap all reward tokens to the exchange token before depositing the yield into the lending pool.
A user can front-run this distribute action by depositing their funds into the pool, and then subsequently withdrawing their funds from the protocol after distribution. The user is rewarded for taking no risk in the protocol and they have effectively diluted the yield allocation to honest depositors of the protocol.
Ensure that distributions are weighted according to deposit duration. It may be useful to utilise some streaming contract which is funded by yield distributions but actually spreads this yield over a number of blocks.
#0 - sforman2000
2022-05-18T02:44:11Z
Duplicate of https://github.com/code-423n4/2022-05-sturdy-findings/issues/61 (high risk)