Closed sherlock-admin2 closed 11 months ago
Invalid, check working as intended based on comments here.
Agree, invalid. The reward tokens are dynamic an therefore we simply want to exclude any tokens that are not required to the functioning of the system.
Bauer
high
reinvestReward()
will not function as intendedSummary
The protocol initializes by retrieving tokens only from
BALANCER_VAULT.getPoolTokens()
, without specifying a reward token during initialization. However, in thereinvestReward()
function, the protocol attempts to exchange the reward token for pool tokens, and there is a check that the reward token must be one of the tokens specified during initialization. Since the reward token is not specified during initialization, this check fails, preventing the execution of reinvestReward.Vulnerability Detail
The
reinvestReward()
function is responsible for reinvesting rewards into the protocol.The issue lies in the
_isInvalidRewardToken()
check within the_executeRewardTrades()
function. This check ensures that therewardToken
used in the reward trading process is a valid reward token, i.e., one of the tokens specified during the protocol initialization.However, the rewardToken obtained during the reinvestReward function execution is not part of the initially specified reward tokens, the
_isInvalidRewardToken()
check will fail.As a result, the protocol won't be able to execute the
reinvestReward()
function successfully because the reward token obtained from the trades is not considered validImpact
The protocol won't be able to execute the
reinvestReward()
function successfullyCode Snippet
https://github.com/sherlock-audit/2023-10-notional/blob/main/leveraged-vaults/contracts/vaults/balancer/mixins/AuraStakingMixin.sol#L38-L49 https://github.com/sherlock-audit/2023-10-notional/blob/main/leveraged-vaults/contracts/vaults/balancer/mixins/BalancerPoolMixin.sol#L84-L102
Tool used
Manual Review
Recommendation
The recommended fix is to specify the reward token during initialization.