The updateOptimalPercentDepositedBdvForToken()
is used to update optimalPercentDepositedBdv
token. According to Dev comments:
However, this function does not update the LibWhitelistedTokens
to include the new token when called.
https://github.com/Cyfrin/2024-04-beanstalk-2/blob/27ff8c87c9164c1fbff054be5f22e56f86cdf127/protocol/contracts/libraries/Silo/LibWhitelist.sol#L146C14-L152
This calls the updateGaugeForToken()
internally which also requires that LibWhitelistedTokens
must be updated to include the new token:
https://github.com/Cyfrin/2024-04-beanstalk-2/blob/27ff8c87c9164c1fbff054be5f22e56f86cdf127/protocol/contracts/libraries/Silo/LibWhitelist.sol#L156-L179
LibWhitelistedTokens
is used to determine which tokens are whitelisted within the system. Not updating it could lead to inconsistencies as users might expect the new token to be whitelisted, but it won't be included until LibWhitelistedTokens
is manually updated.
Manual Review
It's essential to ensure that all relevant components are updated and synchronized when making changes to token-related functionality.
Since the updateOptimalPercentDepositedBdvForToken()
calls the updateGaugeForToken()
internally which also requires that LibWhitelistedTokens
must be updated to include the new token, the update therefore should be done in the updateGaugeForToken()
.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.