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 Apr 28, 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
If the token id has been burned, the borrower will not be able to repay the loan
Summary
When a lender has burned the token ID, rendering the protocol incapable of increasing liquidity.
Vulnerability Detail
During the repay process, the protocol will call the increaseLiquidity function of underlyingPositionManager contract with IncreaseLiquidityParams struct as argument.
function _increaseLiquidity(
addresssaleToken,
addressholdToken,
LoanInfo memoryloan,
uint256amount0,
uint256amount1
) private {
// increase if not equal to zero to avoid rounding down the amount of restored liquidity.if (amount0 >0) ++amount0;
if (amount1 >0) ++amount1;
// Call the increaseLiquidity function of underlyingPositionManager contract// with IncreaseLiquidityParams struct as argument
(uint128restoredLiquidity, , ) = underlyingPositionManager.increaseLiquidity(
INonfungiblePositionManager.IncreaseLiquidityParams({
tokenId: loan.tokenId,
amount0Desired: amount0,
amount1Desired: amount1,
amount0Min: 0,
amount1Min: 0,
deadline: block.timestamp
})
);
However,If the lender has already burned the token ID, the protocol will be unable to increase liquidity, resulting in the borrower being unable to repay their loan, causing bad debt in the protocol.
Impact
The borrowers will be unable to repay their loan, causing bad debt in the protocol.
To address this issue, the protocol should implement a mechanism to verify the availability and validity of token IDs before attempting to increase liquidity. This could involve a check to ensure that the token ID is still valid and not "burned" or otherwise unusable.
sherlock-admin2
changed the title
Colossal Tan Hyena - If the token id has been burned, the borrower will not be able to repay the loan
Bauer - If the token id has been burned, the borrower will not be able to repay the loan
Oct 30, 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
Bauer
medium
If the token id has been burned, the borrower will not be able to repay the loan
Summary
When a lender has burned the token ID, rendering the protocol incapable of increasing liquidity.
Vulnerability Detail
During the repay process, the protocol will call the increaseLiquidity function of underlyingPositionManager contract with IncreaseLiquidityParams struct as argument.
However,If the lender has already burned the token ID, the protocol will be unable to increase liquidity, resulting in the borrower being unable to repay their loan, causing bad debt in the protocol.
Impact
The borrowers will be unable to repay their loan, causing bad debt in the protocol.
Code Snippet
https://github.com/sherlock-audit/2023-10-real-wagmi/blob/main/wagmi-leverage/contracts/abstract/LiquidityManager.sol#L386-L407
Tool used
Manual Review
Recommendation
To address this issue, the protocol should implement a mechanism to verify the availability and validity of token IDs before attempting to increase liquidity. This could involve a check to ensure that the token ID is still valid and not "burned" or otherwise unusable.
Duplicate of #78
The text was updated successfully, but these errors were encountered: