Cyfrin / 2023-07-foundry-defi-stablecoin

37 stars 32 forks source link

Lack of Functionality to Add New Collateral Tokens #1111

Closed codehawks-bot closed 1 year ago

codehawks-bot commented 1 year ago

Lack of Functionality to Add New Collateral Tokens

Severity

Medium Risk

Summary

The DSCEngine contract lacks a crucial functionality to add new collateral tokens. This vulnerability is in contradiction with one of the business rules requirements, which states that the system should allow users to easily replace existing collateral tokens with a new basket of assets while maintaining the contract's functionality. The absence of a function to add new collateral tokens hampers the contract's flexibility and adaptability to evolving market conditions. It is recommended to address this vulnerability by implementing a mechanism to add new collateral tokens in alignment with the specified business rule.

Vulnerability Details

The vulnerability arises from the DSCEngine contract's design limitation, where there is no provision for adding new collateral tokens after the contract deployment. The contract was intended to allow users to swap out default collateral tokens (such as WETH and WBTC) for alternative assets while maintaining the core functionalities. However, the contract's current implementation lacks a dedicated function to facilitate this process, restricting the system's ability to evolve with changing user preferences and market dynamics.

Impact

Tools Used

Manual Review

Recommendations

PatrickAlphaC commented 1 year ago

This is expected