The ConvertFacet::convert
allows the conversion of user deposits between different types of tokens within the ecosystem. This functionality is crucial for users looking to optimize their holdings based on market conditions and personal strategies. As indicated in the documentation (ref. docs https://docs.bean.money/almanac/peg-maintenance/convert) "Any token on the Deposit Whitelist can be Converted to the same token in order to allow Stalkholders to update the BDV of their LP tokens when their BDV increases due to impermanent loss." The conversion logic is encapsulated within the LibConvert::convert
function.
The LibConvert::convert
functionality is implemented through a set of predefined conversion types, each supported by specific logic within the LibConvert
library. However, the system lacks a dynamic mechanism to add support for new tokens once they are whitelisted, leading to a scenario where users cannot convert newly whitelisted tokens despite their valid status within the ecosystem.
The vulnerability arises from the static implementation of conversion logic within the LibConvert
library, which the ConvertFacet smart contract relies on. When a new token is whitelisted, the system does not automatically update to include conversion support for this token. The conversion process relies on a hardcoded set of conversion types, managed through the LibConvert library, which does not account for or adapt to the inclusion of new tokens without manual updates to the smart contract code.
The users expecting to convert newly whitelisted tokens will encounter failed transactions, leading to confusion and waste gas (aka money) on failed transactions.
The ecosystem's dynamism and scalability are hindered as new tokens, despite being officially whitelisted and recognized by the system, cannot participate in conversion processes.
Manual review
To mitigate this issue is suggested to implement mechanisms to notify users when the new tokens become supported for conversion and update the LibConvert
library and the ConvertFacet
contract to provide informative and specific error messages for unsupported conversion attempts.
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.