You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Sep 15, 2024. It is now read-only.
DuplicateA valid issue that is a duplicate of an issue with `Has Duplicates` labelMediumA valid Medium severity issueRewardA payout will be made for this issue
LeverageExecutor is not working inside BBLeverage and SGLeverage
Summary
The buyCollateral and sellCollateral functions inside the BBLeverage and SGLeverage contracts are non-functional as there is no implementation of getCollateral and getAsset in the current LeverageExecutor interface.
However, these functions have completely different interfaces inside all the implementations of BaseLeverageExecutor, e.g. AssetToSGLPLeverageExecutor, AssetTotsDaiLeverageExecutor, SimpleLeverageExecutor.
It seems in the previous versions of Tapioca leverageExecutor had the interface that is now expected by BBLeverage and SGLeverage. This was probably introduced during the migration to new leverageExecutor.
Neverthless, the current buyCollateral and sellCollateral functions are non-functional as there is no implementation of getCollateral and getAsset in the current LeverageExecutor interface.
Impact
The buyCollateral and sellCollateral function inside the BBLeverage and SGLeverage contracts are non-functional as there is no implementation of getCollateral and getAsset in the current LeverageExecutor interface.
As this is a core functionality of the leverage contracts, it is a high-severity issue.
Change the logic inside the BBLeverage and SGLeverage contracts to use the correct interface of LeverageExecutor for getAsset and getCollateral functions, and pass the correct arguments to these functions.
1 comment(s) were left on this issue during the judging contest.
WangAudit commented:
BaseLeverageExecutor doesn't inherit ILeverageExecutor. If we look at Market.sol (this is where we declare leverageExecutor) it's ILeverageExecutor type. And this interface indeed has assetId as an input parameter -> BaseLeverageExecutor will not be called here cause BaseLeverageExecutor doesn't inherit ILeverageExecutor
sherlock-admin3
changed the title
Rural Amethyst Tapir - LeverageExecutor is not working inside BBLeverage and SGLeverage
GiuseppeDeLaZara - LeverageExecutor is not working inside BBLeverage and SGLeverageMar 31, 2024
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
DuplicateA valid issue that is a duplicate of an issue with `Has Duplicates` labelMediumA valid Medium severity issueRewardA payout will be made for this issue
GiuseppeDeLaZara
high
LeverageExecutor
is not working insideBBLeverage
andSGLeverage
Summary
The
buyCollateral
andsellCollateral
functions inside theBBLeverage
andSGLeverage
contracts are non-functional as there is no implementation ofgetCollateral
andgetAsset
in the currentLeverageExecutor
interface.Vulnerability Detail
BBLeverage::buyCollateral
andSGLeverage::buyCollateral
are callingLeverageExecutor::getCollateral
.BBLeverage::sellCollateral
andSGLeverage::buyCollateral
are callingLeverageExecutor::getAsset
.However, these functions have completely different interfaces inside all the implementations of
BaseLeverageExecutor
, e.g.AssetToSGLPLeverageExecutor
,AssetTotsDaiLeverageExecutor
,SimpleLeverageExecutor
.It seems in the previous versions of Tapioca
leverageExecutor
had the interface that is now expected byBBLeverage
andSGLeverage
. This was probably introduced during the migration to new leverageExecutor.Neverthless, the current
buyCollateral
andsellCollateral
functions are non-functional as there is no implementation ofgetCollateral
andgetAsset
in the currentLeverageExecutor
interface.Impact
The
buyCollateral
andsellCollateral
function inside theBBLeverage
andSGLeverage
contracts are non-functional as there is no implementation ofgetCollateral
andgetAsset
in the currentLeverageExecutor
interface.As this is a core functionality of the leverage contracts, it is a high-severity issue.
Code Snippet
Tool used
Manual Review
Recommendation
Change the logic inside the
BBLeverage
andSGLeverage
contracts to use the correct interface ofLeverageExecutor
forgetAsset
andgetCollateral
functions, and pass the correct arguments to these functions.Duplicate of #115
The text was updated successfully, but these errors were encountered: