This repository has been archived by the owner on Sep 15, 2024. It is now read-only.
0xadrii - DoS in BBLeverage and SGLLeverage due to using wrong leverage executor interface #115
Labels
Has Duplicates
A valid issue with 1+ other issues describing the same vulnerability
Medium
A valid Medium severity issue
Reward
A payout will be made for this issue
Sponsor Confirmed
The sponsor acknowledged this issue is valid
Will Fix
The sponsor confirmed this issue will be fixed
0xadrii
high
DoS in BBLeverage and SGLLeverage due to using wrong leverage executor interface
Summary
A DoS takes place due to utilizing a wrong interface in the leverage modules.
Vulnerability Detail
BBLeverage.sol
andSGLLeverage.sol
use a wrong interface to interact with theleverageExecutor
contract. This will make thesellCollateral()
andbuyCollateral()
functions always fail and render theBBLeverage.sol
andSGLLeverage.sol
unusable.As we can see in the following snippets, when these contracts interact with the
leverageExecutor
to call itsgetAsset()
andgetCollateral()
functions, they do it passing 6 parameters in each of the functions:However, the leverage executor’s
getAsset()
andgetCollateral()
functions have just 4 parameters, as seen in theBaseLeverageExecutor.sol
base contract used to build all leverage executors:Impact
High. Calls to the leverage modules will always fail, rendering these features unusable.
Code Snippet
https://github.com/sherlock-audit/2024-02-tapioca/blob/main/Tapioca-bar/contracts/markets/bigBang/BBLeverage.sol#L93
https://github.com/sherlock-audit/2024-02-tapioca/blob/main/Tapioca-bar/contracts/markets/bigBang/BBLeverage.sol#L144
https://github.com/sherlock-audit/2024-02-tapioca/blob/main/Tapioca-bar/contracts/markets/singularity/SGLLeverage.sol#L77
https://github.com/sherlock-audit/2024-02-tapioca/blob/main/Tapioca-bar/contracts/markets/singularity/SGLLeverage.sol#L129
Tool used
Manual Review
Recommendation
Update the interface used in BBLeverage.sol and SGLLeverage.sol and pass the proper parameters so that calls can succeed.
The text was updated successfully, but these errors were encountered: