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.
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
liquidateVaultsForToken() is not transferring the funds for the swap in asyncSwapper
Summary
LiquidationRow.liquidateVaultsForToken() is not transferring the funds for the swap.
Vulnerability Detail
LIQUIDATOR invokes LiquidationRow.liquidateVaultsForToken().
one of the things that need to be done here is initiating the swap process via the asyncSwapper. by sub call to LiquidationRow._performLiquidation()
File: LiquidationRow.sol
240: function _performLiquidation(
...
243: addressasyncSwapper,
244: IDestinationVault[] memoryvaultsToLiquidate,
245: SwapParams memoryparams,
...
248: ) private {
249: uint256 length = vaultsToLiquidate.length;
250: // the swapper checks that the amount received is greater or equal than the params.buyAmount251: uint256 amountReceived =IAsyncSwapper(asyncSwapper).swap(params);
the asyncSwapper needs to receive the funds from LiquidationRow.sol first, because it need to set the approval for the AGGREGATOR.
sherlock-admin
changed the title
Formal Magenta Okapi - liquidateVaultsForToken() is not transferring the funds for the swap in asyncSwapper
Ch_301 - liquidateVaultsForToken() is not transferring the funds for the swap in asyncSwapperOct 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
Ch_301
medium
liquidateVaultsForToken()
is not transferring the funds for the swap inasyncSwapper
Summary
LiquidationRow.liquidateVaultsForToken()
is not transferring the funds for the swap.Vulnerability Detail
LIQUIDATOR invokes
LiquidationRow.liquidateVaultsForToken()
.one of the things that need to be done here is initiating the swap process via the
asyncSwapper
. by sub call toLiquidationRow._performLiquidation()
the
asyncSwapper
needs to receive the funds fromLiquidationRow.sol
first, because it need to set the approval for the AGGREGATOR.otherways it will revert with
InsufficientBalance(...)
Impact
LiquidationRow.liquidateVaultsForToken()
.Code Snippet
https://github.com/sherlock-audit/2023-06-tokemak/blob/main/v2-core-audit-2023-07-14/src/liquidation/BaseAsyncSwapper.sol#L19-L34
Tool used
Manual Review
Recommendation
Transfer the funds (swapParams.sellTokenAddress) to
asyncSwapper
first.Duplicate of #205
The text was updated successfully, but these errors were encountered: