Farseen0/scar-pairs huggingface dataset:
HIGH severity: Vulnerable function: ```\nfunction mintNFTsForLM(address \_liquidiyMiningAddr) external {\n    uint256[] memory \_ids = n. ```\nfunction mintNFTsForLM(address \_liquidiyMiningAddr) external {\n    uint256[] memory \_ids = new uint256[](NFT\_TYPES\_COUNT);\n    uint256[] memory \_amounts = new uint256[](NFT\_TYPES\_COUNT);\n\n    \_ids[0] = 1;\n    \_amounts[0] = 5;\n\n    \_ids[1] = 2;\n    \_amounts[1] = 1 \* LEADERBOA

Vulnerable code:
```\nfunction mintNFTsForLM(address \_liquidiyMiningAddr) external {\n    uint256[] memory \_ids = new uint256[](NFT\_TYPES\_COUNT);\n    uint256[] memory \_amounts = new uint256[](NFT\_TYPES\_COUNT);\n\n    \_ids[0] = 1;\n    \_amounts[0] = 5;\n\n    \_ids[1] = 2;\n    \_amounts[1] = 1 \* LEADERBOARD\_SIZE;\n\n    \_ids[2] = 3;\n    \_amounts[2] = 3 \* LEADERBOARD\_SIZE;\n\n    \_ids[3] = 4;\n    \_amounts[3] = 6 \* LEADERBOARD\_SIZE;\n\n    \_mintBatch(\_liquidiyMiningAddr, \_ids, \_amounts, "");\n}\n```\n
MEDIUM severity: Vulnerable function: ```\n    function prefundedRedeem(address recipient) external virtual returns (uint256, uint256) {\n. ```\n    function prefundedRedeem(address recipient) external virtual returns (uint256, uint256) {\n        // SOME CODE\n\n        // If the buffer is insufficient, shares cannot be redeemed immediately\n        // Need to wait for the withdrawal to be completed and the buffer to be refilled.\n>   

Vulnerable code:
```\n    function prefundedRedeem(address recipient) external virtual returns (uint256, uint256) {\n        // SOME CODE\n\n        // If the buffer is insufficient, shares cannot be redeemed immediately\n        // Need to wait for the withdrawal to be completed and the buffer to be refilled.\n>     if (assets > bufferEthCache) revert InsufficientBuffer();\n\n        // SOME CODE\n    }\n```\n
MEDIUM severity: Vulnerable function: ```\ncontract StreamReceiveETHTest is StreamTest {\n    function setUp() public override {\n        . ```\ncontract StreamReceiveETHTest is StreamTest {\n    function setUp() public override {\n        super.setUp();\n    }\n\n    function test_receiveETH() public {\n        s = Stream(\n            factory.createStream(\n                payer, recipient, STREAM_AMOUNT, address(token), startTime, st

Vulnerable code:
```\ncontract StreamReceiveETHTest is StreamTest {\n    function setUp() public override {\n        super.setUp();\n    }\n\n    function test_receiveETH() public {\n        s = Stream(\n            factory.createStream(\n                payer, recipient, STREAM_AMOUNT, address(token), startTime, stopTime\n            )\n        );\n\n        vm.deal(payer, 10 ether);\n        vm.prank(payer);\n        (bool success, ) = address(s).call{value: 1 ether}("");\n        assertEq(success, true);\n        assertEq(address(s).balance, 1 ether);\n    }\n}\n```\n
MEDIUM severity: Vulnerable function: ```\n"The realized volatility of most assets hover between 75% and 200% annualiz. ```\n"The realized volatility of most assets hover between 75% and 200% annualized in ETH terms. If we compare this to the IV extracted from the Uniswap v3 pools, we get:\n\nNote that the volatilities are somewhat lower, perhaps a factor of ~2.5, for most assets."\n```\n

Vulnerable code:
```\n"The realized volatility of most assets hover between 75% and 200% annualized in ETH terms. If we compare this to the IV extracted from the Uniswap v3 pools, we get:\n\nNote that the volatilities are somewhat lower, perhaps a factor of ~2.5, for most assets."\n```\n
MEDIUM severity: Vulnerable function: ```\nfunction _cloPriceInQuote(address _fromToken, address _toToken)\n        internal\n        view. ```\nfunction _cloPriceInQuote(address _fromToken, address _toToken)\n        internal\n        view\n        returns (uint256 refPrice, uint256 refTimestamp)\n    {\n        address baseOracle = clOracles[_fromToken].oracle;\n        if (baseOracle == address(0)) {\n            return (0, 0);\n    

Vulnerable code:
```\nfunction _cloPriceInQuote(address _fromToken, address _toToken)\n        internal\n        view\n        returns (uint256 refPrice, uint256 refTimestamp)\n    {\n        address baseOracle = clOracles[_fromToken].oracle;\n        if (baseOracle == address(0)) {\n            return (0, 0);\n        }\n        address quoteOracle = clOracles[_toToken].oracle;\n        uint8 quoteDecimal = clOracles[_toToken].decimal;\n\n        (, int256 rawBaseRefPrice, , uint256 baseUpdatedAt, ) = AggregatorV3Interface(baseOracle).latestRoundData();\n        (, int256 rawQuoteRefPrice, , uint256 quoteUpdatedAt, ) = AggregatorV3Interface(quoteOracle).latestRoundData();\n        uint256 baseRefPrice = uint256(rawBaseRefPrice);\n        uint256 quoteRefPrice = uint256(rawQuoteRefPrice);\n\n        // NOTE: Assume wooracle token decimal is same as chainlink token decimal.\n        uint256 ceoff = uint256(10)**quoteDecimal;\n        refPrice = (baseRefPrice * ceoff) / quoteRefPrice;\n        refTimestamp = baseUpdatedAt >= quoteUpdatedAt ? quoteUpdatedAt : baseUpdatedAt;\n    }\n```\n
HIGH severity: Vulnerable function: ```\nfunction properDepositRatio(\n  address pos,\n  uint256 deposit0,\n  uint256 deposit1\n) public. ```\nfunction properDepositRatio(\n  address pos,\n  uint256 deposit0,\n  uint256 deposit1\n) public view returns (bool) {\n  (uint256 hype0, uint256 hype1) = IHypervisor(pos).getTotalAmounts();\n  if (IHypervisor(pos).totalSupply() != 0) {\n    uint256 depositRatio = deposit0 == 0 ? 10e18 : deposit

Vulnerable code:
```\nfunction properDepositRatio(\n  address pos,\n  uint256 deposit0,\n  uint256 deposit1\n) public view returns (bool) {\n  (uint256 hype0, uint256 hype1) = IHypervisor(pos).getTotalAmounts();\n  if (IHypervisor(pos).totalSupply() != 0) {\n    uint256 depositRatio = deposit0 == 0 ? 10e18 : deposit1.mul(1e18).div(deposit0);\n    depositRatio = depositRatio > 10e18 ? 10e18 : depositRatio;\n    depositRatio = depositRatio < 10e16 ? 10e16 : depositRatio;\n    uint256 hypeRatio = hype0 == 0 ? 10e18 : hype1.mul(1e18).div(hype0);\n    hypeRatio = hypeRatio > 10e18 ? 10e18 : hypeRatio;\n    hypeRatio = hypeRatio < 10e16 ? 10e16 : hypeRatio;\n    return (FullMath.mulDiv(depositRatio, deltaScale, hypeRatio) < depositDelta &&\n            FullMath.mulDiv(hypeRatio, deltaScale, depositRatio) < depositDelta);\n  }\n  return true;\n}\n```\n
HIGH severity: Vulnerable function: ```\n  function depositNative(GMXTypes.DepositParams memory dp) external payable nonReentrant {\n   . ```\n  function depositNative(GMXTypes.DepositParams memory dp) external payable nonReentrant {\n    GMXDeposit.deposit(_store, dp, true);\n  }\n```\n

Vulnerable code:
```\n  function depositNative(GMXTypes.DepositParams memory dp) external payable nonReentrant {\n    GMXDeposit.deposit(_store, dp, true);\n  }\n```\n
HIGH severity: Vulnerable function: ```\n  function delegateTreasury(\n        address delegatee,\n        uint256 amount,\n        uint. ```\n  function delegateTreasury(\n        address delegatee,\n        uint256 amount,\n        uint256[] calldata nftIds\n    ) external override onlyThis {\n        require(amount > 0 || nftIds.length > 0, "Gov: empty delegation");\n        require(getExpertStatus(delegatee), "Gov: delegatee is no

Vulnerable code:
```\n  function delegateTreasury(\n        address delegatee,\n        uint256 amount,\n        uint256[] calldata nftIds\n    ) external override onlyThis {\n        require(amount > 0 || nftIds.length > 0, "Gov: empty delegation");\n        require(getExpertStatus(delegatee), "Gov: delegatee is not an expert");\n\n        _unlock(delegatee);\n\n        if (amount != 0) {\n            address token = _govUserKeeper.tokenAddress();\n\n  >          IERC20(token).transfer(address(_govUserKeeper), amount.from18(token.decimals())); //@audit no check if tokens are actually transferred\n\n            _govUserKeeper.delegateTokensTreasury(delegatee, amount);\n        }\n\n        if (nftIds.length != 0) {\n            IERC721 nft = IERC721(_govUserKeeper.nftAddress());\n\n            for (uint256 i; i < nftIds.length; i++) {\n  >              nft.safeTransferFrom(address(this), address(_govUserKeeper), nftIds[i]); //-n no check if nft's are actually transferred\n            }\n\n            _govUserKeeper.delegateNftsTreasury(delegatee, nftIds);\n        }\n\n        _revoteDelegated(delegatee, VoteType.TreasuryVote);\n\n        emit DelegatedTreasury(delegatee, amount, nftIds, true);\n    }\n```\n
HIGH severity: Vulnerable function: ```\nFile: DelayedOrder.sol\n    function executeOrder(\n        address account,\n        bytes[] c. ```\nFile: DelayedOrder.sol\n    function executeOrder(\n        address account,\n        bytes[] calldata priceUpdateData\n    )\n        external\n        payable\n        nonReentrant\n        whenNotPaused\n        updatePythPrice(vault, msg.sender, priceUpdateData)\n        orderInvariantCheck

Vulnerable code:
```\nFile: DelayedOrder.sol\n    function executeOrder(\n        address account,\n        bytes[] calldata priceUpdateData\n    )\n        external\n        payable\n        nonReentrant\n        whenNotPaused\n        updatePythPrice(vault, msg.sender, priceUpdateData)\n        orderInvariantChecks(vault)\n    {\n        // Settle funding fees before executing any order.\n        // This is to avoid error related to max caps or max skew reached when the market has been skewed to one side for a long time.\n        // This is more important in case the we allow for limit orders in the future.\n        vault.settleFundingFees();\n..SNIP..\n    }\n```\n
MEDIUM severity: Vulnerable function: ```\nif (collateralval > amountToBuyLeftUSD) {\n   // sell a portion of collater. ```\nif (collateralval > amountToBuyLeftUSD) {\n   // sell a portion of collateral and exit\n   if (collateral[i].pathsell.length > 0) {\n       uint256 amountBefore = IERC20Upgradeable(baseAsset).balanceOf(USSD);\n       uint256 amountToSellUnits = IERC20Upgradeable(collateral[i].token).balanceOf(U

Vulnerable code:
```\nif (collateralval > amountToBuyLeftUSD) {\n   // sell a portion of collateral and exit\n   if (collateral[i].pathsell.length > 0) {\n       uint256 amountBefore = IERC20Upgradeable(baseAsset).balanceOf(USSD);\n       uint256 amountToSellUnits = IERC20Upgradeable(collateral[i].token).balanceOf(USSD) * ((amountToBuyLeftUSD * 1e18 / collateralval) / 1e18) / 1e18;\n       IUSSD(USSD).UniV3SwapInput(collateral[i].pathsell, amountToSellUnits);\n       amountToBuyLeftUSD -= (IERC20Upgradeable(baseAsset).balanceOf(USSD) - amountBefore);\n       DAItosell += (IERC20Upgradeable(baseAsset).balanceOf(USSD) - amountBefore);\n   } \n   else {\n       // no need to swap DAI\n       DAItosell = IERC20Upgradeable(collateral[i].token).balanceOf(USSD) * amountToBuyLeftUSD / collateralval;\n   }\n}\n\nelse {\n   // @audit-issue Not handling the case where this is DAI as is done above.\n   // sell all or skip (if collateral is too little, 5% treshold)\n   if (collateralval >= amountToBuyLeftUSD / 20) {\n      uint256 amountBefore = IERC20Upgradeable(baseAsset).balanceOf(USSD);\n      // sell all collateral and move to next one\n      IUSSD(USSD).UniV3SwapInput(collateral[i].pathsell, IERC20Upgradeable(collateral[i].token).balanceOf(USSD));\n      amountToBuyLeftUSD -= (IERC20Upgradeable(baseAsset).balanceOf(USSD) - amountBefore);\n      DAItosell += (IERC20Upgradeable(baseAsset).balanceOf(USSD) - amountBefore);\n   }\n}\n```\n
HIGH severity: Vulnerable function: ```\nmodifier onlyDAOProtocolProposal() {\n    // If this contract has been init. ```\nmodifier onlyDAOProtocolProposal() {\n    // If this contract has been initialised, only allow access from the proposals contract\n    if(getBool(keccak256(abi.encodePacked(settingNameSpace, "deployed")))) require(getContractAddress('rocketDAOProtocolProposals') == msg.sender, "Only DAO Protoco

Vulnerable code:
```\nmodifier onlyDAOProtocolProposal() {\n    // If this contract has been initialised, only allow access from the proposals contract\n    if(getBool(keccak256(abi.encodePacked(settingNameSpace, "deployed")))) require(getContractAddress('rocketDAOProtocolProposals') == msg.sender, "Only DAO Protocol Proposals contract can update a setting");\n    \_;\n}\n```\n
MEDIUM severity: Vulnerable function: ```\nfallback() external payable {\n    address \_target = rocketStorage.getAddr. ```\nfallback() external payable {\n    address \_target = rocketStorage.getAddress(distributorStorageKey);\n    assembly {\n        calldatacopy(0x0, 0x0, calldatasize())\n        let result := delegatecall(gas(), \_target, 0x0, calldatasize(), 0x0, 0)\n        returndatacopy(0x0, 0x0, returndatasi

Vulnerable code:
```\nfallback() external payable {\n    address \_target = rocketStorage.getAddress(distributorStorageKey);\n    assembly {\n        calldatacopy(0x0, 0x0, calldatasize())\n        let result := delegatecall(gas(), \_target, 0x0, calldatasize(), 0x0, 0)\n        returndatacopy(0x0, 0x0, returndatasize())\n        switch result case 0 {revert(0, returndatasize())} default {return (0, returndatasize())}\n    }\n}\n```\n
HIGH severity: Vulnerable function: ```\n    function _withdrawUpdateRewardState(uint256 lpAmount_, bool claim_) internal {\n        uin. ```\n    function _withdrawUpdateRewardState(uint256 lpAmount_, bool claim_) internal {\n        uint256 numInternalRewardTokens = internalRewardTokens.length;\n        uint256 numExternalRewardTokens = externalRewardTokens.length;\n\n        // Handles accounting logic for internal and external rew

Vulnerable code:
```\n    function _withdrawUpdateRewardState(uint256 lpAmount_, bool claim_) internal {\n        uint256 numInternalRewardTokens = internalRewardTokens.length;\n        uint256 numExternalRewardTokens = externalRewardTokens.length;\n\n        // Handles accounting logic for internal and external rewards, harvests external rewards\n        uint256[] memory accumulatedInternalRewards = _accumulateInternalRewards();\n        uint256[] memory accumulatedExternalRewards = _accumulateExternalRewards();\n        for (uint256 i; i < numInternalRewardTokens;) {\n            _updateInternalRewardState(i, accumulatedInternalRewards[i]);\n            if (claim_) _claimInternalRewards(i);\n\n            // Update reward debts so as to not understate the amount of rewards owed to the user, and push\n            // any unclaimed rewards to the user's reward debt so that they can be claimed later\n            InternalRewardToken memory rewardToken = internalRewardTokens[i];\n            // @audit In our example, rewardDebtDiff = 3e17 (total rewards are 6e17 so 50% of shares earned 50% of reward tokens)\n            uint256 rewardDebtDiff = lpAmount_ * rewardToken.accumulatedRewardsPerShare;\n\n            // @audit 3e17 > 1e17\n            if (rewardDebtDiff > userRewardDebts[msg.sender][rewardToken.token]) {\n\n                // @audit userRewardDebts is set to 0 (original value was 1e17, the number of tokens that were already claimed)\n                userRewardDebts[msg.sender][rewardToken.token] = 0;\n                // @audit cached amount = 3e17 - 0 = 3e17.\n                // Alice is assigned 3e17 reward tokens to be distributed the next time they claim\n                // The remaining 3e17 LP shares are worth another 3e17 reward tokens.\n                // Alice already claimed 1e17 before the withdrawal.\n                // Thus, Alice receives 7e17 reward tokens instead of 6e17\n                cachedUserRewards[msg.sender][rewardToken.token] +=\n                    rewardDebtDiff - userRewardDebts[msg.sender][rewardToken.token];\n            } else {\n                userRewardDebts[msg.sender][rewardToken.token] -= rewardDebtDiff;\n            }\n\n            unchecked {\n                ++i;\n            }\n        }\n```\n
MEDIUM severity: Vulnerable function: ```\nFile: MetaStable2TokenVaultMixin.sol\nabstract contract MetaStable2TokenVau. ```\nFile: MetaStable2TokenVaultMixin.sol\nabstract contract MetaStable2TokenVaultMixin is TwoTokenPoolMixin {\n    constructor(NotionalProxy notional_, AuraVaultDeploymentParams memory params)\n        TwoTokenPoolMixin(notional_, params)\n    {\n        // The oracle is required for the vault to b

Vulnerable code:
```\nFile: MetaStable2TokenVaultMixin.sol\nabstract contract MetaStable2TokenVaultMixin is TwoTokenPoolMixin {\n    constructor(NotionalProxy notional_, AuraVaultDeploymentParams memory params)\n        TwoTokenPoolMixin(notional_, params)\n    {\n        // The oracle is required for the vault to behave properly\n        (/* */, /* */, /* */, /* */, bool oracleEnabled) = \n            IMetaStablePool(address(BALANCER_POOL_TOKEN)).getOracleMiscData();\n        require(oracleEnabled);\n    }\n```\n
HIGH severity: Vulnerable function: ```\nfunction withdraw(address \_accountAddr, address \_token, uint256 \_amount) external onlyAuthor. ```\nfunction withdraw(address \_accountAddr, address \_token, uint256 \_amount) external onlyAuthorized returns(uint256) {\n\n    // Check if withdraw amount is less than user's balance\n    require(\_amount <= getDepositBalanceCurrent(\_token, \_accountAddr), "Insufficient balance.");\n    uint256

Vulnerable code:
```\nfunction withdraw(address \_accountAddr, address \_token, uint256 \_amount) external onlyAuthorized returns(uint256) {\n\n    // Check if withdraw amount is less than user's balance\n    require(\_amount <= getDepositBalanceCurrent(\_token, \_accountAddr), "Insufficient balance.");\n    uint256 borrowLTV = globalConfig.tokenInfoRegistry().getBorrowLTV(\_token);\n```\n
HIGH severity: Vulnerable function: ```\nfinalise() --> \n  status == MinipoolStatus.Withdrawable  //<-- true\n  wit. ```\nfinalise() --> \n  status == MinipoolStatus.Withdrawable  //<-- true\n  withdrawalBlock > 0  //<-- true\n  _finalise() -->\n     !finalised  //<-- true\n        _refund()\n            nodeRefundBalance = 0  //<-- reset refund balance\n              ---> extCall: nodeWithdrawalAddress\n         

Vulnerable code:
```\nfinalise() --> \n  status == MinipoolStatus.Withdrawable  //<-- true\n  withdrawalBlock > 0  //<-- true\n  _finalise() -->\n     !finalised  //<-- true\n        _refund()\n            nodeRefundBalance = 0  //<-- reset refund balance\n              ---> extCall: nodeWithdrawalAddress\n                     ---> reenter: finalise()\n                        status == MinipoolStatus.Withdrawable  //<-- true\n                        withdrawalBlock > 0  //<-- true\n                        _finalise() -->\n                             !finalised  //<-- true\n                             nodeRefundBalance > 0  //<-- false; no refund()\n                             address(this).balance to RETH\n                             RocketTokenRETHInterface(rocketTokenRETH).depositExcessCollateral()\n                             rocketMinipoolManager.incrementNodeFinalisedMinipoolCount(nodeAddress)  //<-- 1st time\n                             eventually call rocketDAONodeTrusted.decrementMemberUnbondedValidatorCount(nodeAddress); \n                             finalised = true;\n                   <--- return from reentrant call\n        <--- return from _refund()\n     address(this).balance to RETH  //<-- NOP as balance was sent to RETH already\n     RocketTokenRETHInterface(rocketTokenRETH).depositExcessCollateral();   //<-- does not revert\n     rocketMinipoolManager.incrementNodeFinalisedMinipoolCount(nodeAddress);  //<-- no revert, increases\n     'node.minipools.finalised.count', 'minipools.finalised.count', reduces 'eth.matched.node.amount' one to\n     many times\n     eventually call rocketDAONodeTrusted.decrementMemberUnbondedValidatorCount(nodeAddress);  //<-- manipulates\n     'member.validator.unbonded.count' by +1\n     finalised = true;  //<-- is already 'true', gracefully continues\n<--- returns      \n```\n
MEDIUM severity: Vulnerable function: ```\nrequire(\n    \_isOperatorForPartition(\_partition, msg.sender, \_from) ||\. ```\nrequire(\n    \_isOperatorForPartition(\_partition, msg.sender, \_from) ||\n        (\_value <= \_allowedByPartition[\_partition][\_from][msg.sender]),\n    EC\_53\_INSUFFICIENT\_ALLOWANCE\n);\n```\n

Vulnerable code:
```\nrequire(\n    \_isOperatorForPartition(\_partition, msg.sender, \_from) ||\n        (\_value <= \_allowedByPartition[\_partition][\_from][msg.sender]),\n    EC\_53\_INSUFFICIENT\_ALLOWANCE\n);\n```\n
HIGH severity: Vulnerable function: ```\nFile: AccountFacetImpl.sol\n    function depositForPartyB(uint256 amount) internal {\n        I. ```\nFile: AccountFacetImpl.sol\n    function depositForPartyB(uint256 amount) internal {\n        IERC20(GlobalAppStorage.layout().collateral).safeTransferFrom(\n            msg.sender,\n            address(this),\n            amount\n        );\n        uint256 amountWith18Decimals = (amount * 1e1

Vulnerable code:
```\nFile: AccountFacetImpl.sol\n    function depositForPartyB(uint256 amount) internal {\n        IERC20(GlobalAppStorage.layout().collateral).safeTransferFrom(\n            msg.sender,\n            address(this),\n            amount\n        );\n        uint256 amountWith18Decimals = (amount * 1e18) /\n        (10 ** IERC20Metadata(GlobalAppStorage.layout().collateral).decimals());\n        AccountStorage.layout().balances[msg.sender] += amountWith18Decimals;\n    }\n```\n
MEDIUM severity: Vulnerable function: ```\n/\*\*\n \* @notice Calculate the utilization rate: `\_borrows / (\_cash + \_borrows - \_reserve. ```\n/\*\*\n \* @notice Calculate the utilization rate: `\_borrows / (\_cash + \_borrows - \_reserves)`\n \* @param \_cash Asset balance\n \* @param \_borrows Asset borrows\n \* @param \_reserves Asset reserves\n \* @return Asset utilization [0, 1e18]\n \*/\nfunction utilizationRate(\n    uint256 \_

Vulnerable code:
```\n/\*\*\n \* @notice Calculate the utilization rate: `\_borrows / (\_cash + \_borrows - \_reserves)`\n \* @param \_cash Asset balance\n \* @param \_borrows Asset borrows\n \* @param \_reserves Asset reserves\n \* @return Asset utilization [0, 1e18]\n \*/\nfunction utilizationRate(\n    uint256 \_cash,\n    uint256 \_borrows,\n    uint256 \_reserves\n) internal pure returns (uint256) {\n    // Utilization rate is 0 when there are no borrows\n    if (\_borrows == 0) return 0;\n\n    return \_borrows.mul(BASE).div(\_cash.add(\_borrows).sub(\_reserves));\n}\n```\n
MEDIUM severity: Vulnerable function: ```\n    function getOracleData() external view override returns (OracleData memory oracleData) {\n/. ```\n    function getOracleData() external view override returns (OracleData memory oracleData) {\n// rest of code\n        (/* */, uint256 supplyCap) = IPoolDataProvider(POOL_DATA_PROVIDER).getReserveCaps(underlying);\n        // Supply caps are returned as whole token values\n        supplyCap = s

Vulnerable code:
```\n    function getOracleData() external view override returns (OracleData memory oracleData) {\n// rest of code\n        (/* */, uint256 supplyCap) = IPoolDataProvider(POOL_DATA_PROVIDER).getReserveCaps(underlying);\n        // Supply caps are returned as whole token values\n        supplyCap = supplyCap * UNDERLYING_PRECISION;\n        uint256 aTokenSupply = IPoolDataProvider(POOL_DATA_PROVIDER).getATokenTotalSupply(underlying);\n\n        // If supply cap is zero, that means there is no cap on the pool\n        if (supplyCap == 0) {\n            oracleData.maxExternalDeposit = type(uint256).max;\n        } else if (supplyCap <= aTokenSupply) {\n            oracleData.maxExternalDeposit = 0;\n        } else {\n            // underflow checked as consequence of if / else statement\n          oracleData.maxExternalDeposit = supplyCap - aTokenSupply;\n        }\n```\n