sherlock-audit / 2022-10-illuminate-judging

3 stars 0 forks source link

minhtrng - Deprecation of `base` function #230

Closed sherlock-admin closed 1 year ago

sherlock-admin commented 1 year ago

minhtrng

unlabeled

Deprecation of base function

Summary

Use of deprecated function will cause incompatibility and indefinite reverts of essential marketplace functions for future pools.

Vulnerability Detail

According to Yieldspace code documentation the function base to retrieve the base token of a pool has already been deprecated and is prone to be removed at anytime.

It is still used in the following market place functions: buyPrincipalToken, sellUnderlying, mint and mintWithUnderlying

Impact

All the functions outlined in #Vulnerability Detail will stop working if used in conjunction with a pool whose base function has been removed.

Code Snippet

None

Tool used

Manual Review

Recommendation

Use the function baseToken instead which returns an IERC20Like that also conforms to IERC20, so there will be no compatibility issues.