Skip to content

Latest commit

 

History

History
29 lines (15 loc) · 938 Bytes

060.md

File metadata and controls

29 lines (15 loc) · 938 Bytes

moneyversed

medium

Potential underflow in _hasMarketVerification function

Summary

There is a risk of underflow when computing _marketId in the _hasMarketVerification function. Proper checks should be in place to avoid this issue.

Vulnerability Detail

In the LenderManager.sol contract, the _hasMarketVerification function is susceptible to underflow when computing _marketId, potentially leading to incorrect calculations.

Impact

Incorrect calculations could lead to unintended behavior and vulnerabilities within the contract.

Code Snippet

https://github.com/sherlock-audit/2023-03-teller/blob/main/teller-protocol-v2/packages/contracts/contracts/LenderManager.sol#L61

Tool used

Manual Review

Recommendation

Ensure proper checks for underflow are in place when computing _marketId in the _hasMarketVerification function. Consider using SafeMath from the OpenZeppelin library to prevent underflow issues.