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 Mar 3, 2024. It is now read-only.
sherlock-admin opened this issue
Aug 30, 2023
· 0 comments
Labels
DuplicateA valid issue that is a duplicate of an issue with `Has Duplicates` labelHighA valid High severity issueRewardA payout will be made for this issue
Missing delegateCall function when performing liquidations.
Summary
When trying to execute the liquidateVaultsForToken function, it will be reverted because the required delegateCall is missing (Sequence diagram from README confirms this issue, as function should be in place). Particularly when making a call to the asyncSwapper for performing the swapping operation.
Vulnerability Detail
Inside the _performLiquidation() function within the LiquidationRow.sol contract there is a piece of code which uses the swap function to call the swapper, which executes the corresponding swapping using the assets available in the LiquidationRow.sol contract.
However, as there is no delegateCall function, when we invoke the swap() a revert will follow. Because of this issue, all rewards claimed from destination vaults are trapped within the contract.
The rewards meant for the destination's rewarders within the LiquidationRow contract will never be distributed and will be stuck inside that contract .
sherlock-admin2
changed the title
Bald Grape Dragonfly - Missing delegateCall function when performing liquidations.
MrjoryStewartBaxter - Missing delegateCall function when performing liquidations.
Oct 3, 2023
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` labelHighA valid High severity issueRewardA payout will be made for this issue
MrjoryStewartBaxter
high
Missing delegateCall function when performing liquidations.
Summary
When trying to execute the liquidateVaultsForToken function, it will be reverted because the required delegateCall is missing (Sequence diagram from README confirms this issue, as function should be in place). Particularly when making a call to the asyncSwapper for performing the swapping operation.
Vulnerability Detail
Inside the
_performLiquidation()
function within the LiquidationRow.sol contract there is a piece of code which uses theswap
function to call the swapper, which executes the corresponding swapping using the assets available in the LiquidationRow.sol contract.However, as there is no
delegateCall
function, when we invoke theswap()
a revert will follow. Because of this issue, all rewards claimed from destination vaults are trapped within the contract.// Line under
_performLiquidation()
https://github.com/sherlock-audit/2023-06-tokemak/blob/5d8e902ce33981a6506b1b5fb979a084602c6c9a/v2-core-audit-2023-07-14/src/liquidation/LiquidationRow.sol#L251
POC
Using the following test
test_OnlyLiquidateGivenTokenForGivenVaults()
inside the LiquidiationRow.t.sol :It will revert, since the function is not working correctly due to the aforementioned missing delegateCall.
Impact
The rewards meant for the destination's rewarders within the LiquidationRow contract will never be distributed and will be stuck inside that contract .
Code Snippet
https://github.com/sherlock-audit/2023-06-tokemak/blob/5d8e902ce33981a6506b1b5fb979a084602c6c9a/v2-core-audit-2023-07-14/src/liquidation/LiquidationRow.sol#L251
Tool used
Manual Review
Recommendation
delegateCall function should be implemented when calling asyncSwapper.
Duplicate of #205
The text was updated successfully, but these errors were encountered: