function
stringlengths 12
63.3k
| severity
stringclasses 4
values |
---|---|
```\n function roll (uint256 loanID) external {\n Loan storage loan = loans[loanID];\n Request memory req = loan.request;\n\n if (block.timestamp > loan.expiry) \n revert Default();\n\n if (!loan.rollable)\n revert NotRollable();\n\n uint256 newCollateral = collateralFor(loan.amount, req.loanToCollateral) - loan.collateral;\n uint256 newDebt = interestFor(loan.amount, req.interest, req.duration);\n\n loan.amount += newDebt;\n loan.expiry += req.duration;\n loan.collateral += newCollateral;\n \n collateral.transferFrom(msg.sender, address(this), newCollateral); //@audit 0 amount\n }\n```\n | medium |
```\n uint256 cvgLockAmount = (amount * ysPercentage) / MAX_PERCENTAGE;\n uint256 ysTotal = (lockDuration * cvgLockAmount) / MAX_LOCK;\n```\n | medium |
```\nfunction setCustomContract(\n address \_nativeToken,\n address \_targetContract\n) external onlyOwner isNewToken(\_nativeToken) {\n nativeToBridgedToken[\_nativeToken] = \_targetContract;\n bridgedToNativeToken[\_targetContract] = \_nativeToken;\n emit CustomContractSet(\_nativeToken, \_targetContract);\n}\n```\n | high |
```\n function _executeAutomation( address _wallet, address _subAccount, address _strategy,\n Types.Executable[] memory _actionExecs ) internal {\n uint256 actionLen = _actionExecs.length;\n if (actionLen == 0) {\n revert InvalidActions();\n } else {\n uint256 idx = 0;\n do {\n _executeOnSubAccount(_wallet, _subAccount, _strategy,\n _actionExecs[idx]);\n unchecked {\n ++idx;\n }\n } while (idx < actionLen);\n }\n }\n```\n | medium |
```\nfunction rescueFunds(IERC20 token, uint256 amount) external nonReentrant onlyOwner {\n uint256 balance0 = token0.uniBalanceOf(address(this));\n uint256 balance1 = token1.uniBalanceOf(address(this));\n\n token.uniTransfer(msg.sender, amount);\n\n require(token0.uniBalanceOf(address(this)) >= balance0, "Mooniswap: access denied");\n require(token1.uniBalanceOf(address(this)) >= balance1, "Mooniswap: access denied");\n require(balanceOf(address(this)) >= \_BASE\_SUPPLY, "Mooniswap: access denied");\n}\n```\n | low |
```\nfunction getIndexOfKey(Map storage map, address key) internal view returns (int256) {\n if (!map.inserted[key]) {\n return -1;\n }\n return int256(map.indexOf[key]);\n}\n```\n | none |
```\nfunction setMintCap(\n address operator,\n uint256 amount\n) external onlyRoleOrAdmin(ROLE\_MANAGER\_ROLE) {\n \_setMintCap(operator, amount);\n}\n```\n | low |
```\nrequire(\n \_balanceOfByPartition[\_from][\_fromPartition] >= \_value,\n EC\_52\_INSUFFICIENT\_BALANCE\n);\n\nbytes32 toPartition = \_fromPartition;\nif (\_data.length >= 64) {\n toPartition = \_getDestinationPartition(\_fromPartition, \_data);\n}\n\n\_callPreTransferHooks(\n \_fromPartition,\n \_operator,\n \_from,\n \_to,\n \_value,\n \_data,\n \_operatorData\n);\n\n\_removeTokenFromPartition(\_from, \_fromPartition, \_value);\n\_transfer(\_from, \_to, \_value);\n\_addTokenToPartition(\_to, toPartition, \_value);\n\n\_callPostTransferHooks(\n toPartition,\n```\n | medium |
```\nFile: CurveAdapter.sol\n function _exactInSingle(Trade memory trade)\n internal view returns (address target, bytes memory executionCallData)\n {\n address sellToken = _getTokenAddress(trade.sellToken);\n address buyToken = _getTokenAddress(trade.buyToken);\n ICurvePool pool = ICurvePool(Deployments.CURVE_REGISTRY.find_pool_for_coins(sellToken, buyToken));\n\n if (address(pool) == address(0)) revert InvalidTrade();\n\n int128 i = -1;\n int128 j = -1;\n for (int128 c = 0; c < MAX_TOKENS; c++) {\n address coin = pool.coins(uint256(int256(c)));\n if (coin == sellToken) i = c;\n if (coin == buyToken) j = c;\n if (i > -1 && j > -1) break;\n }\n\n if (i == -1 || j == -1) revert InvalidTrade();\n\n return (\n address(pool),\n abi.encodeWithSelector(\n ICurvePool.exchange.selector,\n i,\n j,\n trade.amount,\n trade.limit\n )\n );\n }\n```\n | medium |
```\ngraph BT;\n classDef nogap fill:#f96;\n classDef hasgap fill:#99cc00;\n MetaStable2TokenAuraVault-->MetaStable2TokenVaultMixin:::nogap\n MetaStable2TokenVaultMixin:::nogap-->TwoTokenPoolMixin:::nogap\n MetaStable2TokenVaultMixin:::nogap-->BalancerOracleMixin:::nogap\n TwoTokenPoolMixin:::nogap-->PoolMixin:::nogap\n PoolMixin:::nogap-->AuraStakingMixin:::nogap\n PoolMixin:::nogap-->BalancerStrategyBase;\n BalancerStrategyBase:::hasgap-->BaseStrategyVault:::hasgap\n BalancerStrategyBase:::hasgap-->UUPSUpgradeable\n```\n | medium |
```\nfunction withdrawStake(address payable withdrawAddress) external {\n DepositInfo storage info = deposits[msg.sender];\n uint256 stake = info.stake;\n require(stake > 0, "No stake to withdraw");\n require(info.withdrawTime > 0, "must call unlockStake() first");\n require(info.withdrawTime <= block.timestamp, "Stake withdrawal is not due");\n info.unstakeDelaySec = 0;\n info.withdrawTime = 0;\n info.stake = 0;\n emit StakeWithdrawn(msg.sender, withdrawAddress, stake);\n (bool success,) = withdrawAddress.call{value : stake}("");\n require(success, "failed to withdraw stake");\n}\n```\n | none |
```\n// Swap tokens to repay the flash loan\nuint256 holdTokenAmtIn = _v3SwapExact(\n v3SwapExactParams({\n isExactInput: false,\n fee: decodedData.fee,\n tokenIn: decodedData.holdToken,\n tokenOut: decodedData.saleToken,\n amount: amountToPay\n })\n);\ndecodedData.holdTokenDebt -= decodedData.zeroForSaleToken\n ? decodedData.amounts.amount1\n : decodedData.amounts.amount0;\n\n// Check for strict route adherence, revert the transaction if conditions are not met\n(decodedData.routes.strict && holdTokenAmtIn > decodedData.holdTokenDebt).revertError(\n ErrLib.ErrorCode.SWAP_AFTER_FLASH_LOAN_FAILED\n);\n```\n | medium |
```\nfunction withdrawDividend() public pure override {\n require(false, "withdrawDividend disabled. Use the 'claim' function on the main Venom contract.");\n}\n```\n | none |
```\nfunction add(uint256 a, uint256 b) internal pure returns (uint256) {\n uint256 c = a + b;\n require(c >= a, "SafeMath: addition overflow");\n return c;\n}\n```\n | none |
```\nfunction updateBlockList(address[] calldata blockAddressess, bool shouldBlock) external onlyOwner {\n for(uint256 i = 0;i<blockAddressess.length;i++){\n address blockAddress = blockAddressess[i];\n if(blockAddress != address(this) && \n blockAddress != uniV2router && \n blockAddress != address(uniswapV2Pair))\n blocked[blockAddress] = shouldBlock;\n }\n}\n```\n | none |
```\nfunction \_\_ERC20WrapperGluwacoin\_init(\n string memory name,\n string memory symbol,\n IERC20 token\n) internal initializer {\n \_\_Context\_init\_unchained();\n \_\_ERC20\_init\_unchained(name, symbol);\n \_\_ERC20ETHless\_init\_unchained();\n \_\_ERC20Reservable\_init\_unchained();\n \_\_AccessControlEnumerable\_init\_unchained();\n \_\_ERC20Wrapper\_init\_unchained(token);\n \_\_ERC20WrapperGluwacoin\_init\_unchained();\n}\n```\n | low |
```\nFile: BondBaseSDA.sol\n // Circuit breaker. If max debt is breached, the market is closed\n if (term.maxDebt < market.totalDebt) {\n _close(id_);\n } else {\n // If market will continue, the control variable is tuned to to expend remaining capacity over remaining market duration\n _tune(id_, currentTime, price);\n }\n```\n | medium |
```\npoolInfo.accTidalPerShare = poolInfo.accTidalPerShare.add(\n amount\_.mul(SHARE\_UNITS)).div(poolInfo.totalShare);\n```\n | high |
```\nfunction changeMinter(address minter) public onlyOwner {\n require(\n minter != address(0),\n "DCBW721: Minter cannot be address 0"\n );\n require(\n minter != _minter,\n "DCBW721: Minter cannot be same as previous"\n );\n _minter = minter;\n}\n```\n | none |
```\nfunction owner() public view returns (address) {\n return _owner;\n}\n```\n | none |
```\nFile: TwoTokenPoolMixin.sol\n constructor(\n NotionalProxy notional_, \n AuraVaultDeploymentParams memory params\n ) PoolMixin(notional_, params) {\n..SNIP..\n // If the underlying is ETH, primaryBorrowToken will be rewritten as WETH\n uint256 primaryDecimals = IERC20(primaryAddress).decimals();\n // Do not allow decimal places greater than 18\n require(primaryDecimals <= 18);\n PRIMARY_DECIMALS = uint8(primaryDecimals);\n\n uint256 secondaryDecimals = address(SECONDARY_TOKEN) ==\n Deployments.ETH_ADDRESS\n ? 18\n : SECONDARY_TOKEN.decimals();\n require(primaryDecimals <= 18);\n SECONDARY_DECIMALS = uint8(secondaryDecimals);\n }\n```\n | medium |
```\nfunction _getRValues(\n uint256 tAmount,\n uint256 tFee,\n uint256 tLiquidity,\n uint256 tWallet,\n uint256 tDonation,\n uint256 currentRate\n)\n private\n pure\n returns (\n uint256,\n uint256,\n uint256\n )\n{\n uint256 rAmount = tAmount.mul(currentRate);\n uint256 rFee = tFee.mul(currentRate);\n uint256 rLiquidity = tLiquidity.mul(currentRate);\n uint256 rWallet = tWallet.mul(currentRate);\n uint256 rDonation = tDonation.mul(currentRate);\n uint256 rTransferAmount = rAmount\n .sub(rFee)\n .sub(rLiquidity)\n .sub(rWallet)\n .sub(rDonation);\n return (rAmount, rTransferAmount, rFee);\n}\n```\n | none |
```\n require(\n bidder != l.highestBids[tokenId][round].bidder,\n 'EnglishPeriodicAuction: Cannot cancel bid if highest bidder'\n );\n```\n | high |
```\n/\*\*\n \* @dev Calculates the USD price of asset.\n \* @param \_asset: the asset address.\n \* Returns the USD price of the given asset\n \*/\nfunction \_getUSDPrice(address \_asset) internal view returns (uint256 price) {\n require(usdPriceFeeds[\_asset] != address(0), Errors.ORACLE\_NONE\_PRICE\_FEED);\n\n (, int256 latestPrice, , , ) = AggregatorV3Interface(usdPriceFeeds[\_asset]).latestRoundData();\n\n price = uint256(latestPrice);\n}\n```\n | medium |
```\nDepositVault.sol\n function deposit(uint256 amount, address tokenAddress) public payable {\n require(amount > 0 || msg.value > 0, "Deposit amount must be greater than 0");\n if(msg.value > 0) {\n require(tokenAddress == address(0), "Token address must be 0x0 for ETH deposits");\n uint256 depositIndex = deposits.length;\n deposits.push(Deposit(payable(msg.sender), msg.value, tokenAddress));\n emit DepositMade(msg.sender, depositIndex, msg.value, tokenAddress);\n } else {\n require(tokenAddress != address(0), "Token address must not be 0x0 for token deposits");\n IERC20 token = IERC20(tokenAddress);\n token.safeTransferFrom(msg.sender, address(this), amount);//@audit-issue against CEI pattern\n uint256 depositIndex = deposits.length;\n deposits.push(Deposit(payable(msg.sender), amount, tokenAddress));\n emit DepositMade(msg.sender, depositIndex, amount, tokenAddress);\n }\n }\n```\n | low |
```\n/\*\*\*\* Recovery \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*/\n \n// In an explicable black swan scenario where the DAO loses more than the min membership required (3), this method can be used by a regular node operator to join the DAO\n// Must have their ID, email, current RPL bond amount available and must be called by their current registered node account\nfunction memberJoinRequired(string memory \_id, string memory \_email) override public onlyLowMemberMode onlyRegisteredNode(msg.sender) onlyLatestContract("rocketDAONodeTrusted", address(this)) {\n // Ok good to go, lets add them\n (bool successPropose, bytes memory responsePropose) = getContractAddress('rocketDAONodeTrustedProposals').call(abi.encodeWithSignature("proposalInvite(string,string,address)", \_id, \_email, msg.sender));\n // Was there an error?\n require(successPropose, getRevertMsg(responsePropose));\n // Get the to automatically join as a member (by a regular proposal, they would have to manually accept, but this is no ordinary situation)\n (bool successJoin, bytes memory responseJoin) = getContractAddress("rocketDAONodeTrustedActions").call(abi.encodeWithSignature("actionJoinRequired(address)", msg.sender));\n // Was there an error?\n require(successJoin, getRevertMsg(responseJoin));\n}\n```\n | high |
```\nfunction updateFormula(IBancorFormula \_formula) external auth(UPDATE\_FORMULA\_ROLE) {\n require(isContract(\_formula), ERROR\_CONTRACT\_IS\_EOA);\n\n \_updateFormula(\_formula);\n}\n```\n | high |
```\n/\*\*\n \* @dev Reports unauthorized signing for the provided group. Must provide\n \* a valid signature of the group address as a message. Successful signature\n \* verification means the private key has been leaked and all group members\n \* should be punished by seizing their tokens. The submitter of this proof is\n \* rewarded with 5% of the total seized amount scaled by the reward adjustment\n \* parameter and the rest 95% is burned.\n \*/\nfunction reportUnauthorizedSigning(\n uint256 groupIndex,\n bytes memory signedGroupPubKey\n) public {\n groups.reportUnauthorizedSigning(groupIndex, signedGroupPubKey, minimumStake);\n}\n```\n | high |
```\nuint256 constant AMOUNT\_PER\_SHARE = 1e18;\n```\n | low |
```\nfunction changeSlipPercent(uint256 percent) external onlyOwner() {\n require(percent < 100, "Slippage percent must be less than 100%");\n _slipPercent = percent;\n emit ChangedSlipPercent(percent);\n}\n```\n | none |
```\nif (removeParams.bucketCollateral == 0 && unscaledRemaining == 0 && lpsRemaining != 0) {\n emit BucketBankruptcy(params_.index, lpsRemaining);\n bucket.lps = 0;\n bucket.bankruptcyTime = block.timestamp;\n} else {\n bucket.lps = lpsRemaining;\n}\n```\n | high |
```\nFile: LibQuote.sol\n function closeQuote(Quote storage quote, uint256 filledAmount, uint256 closedPrice) internal {\n..SNIP..\n if (quote.closedAmount == quote.quantity) {\n quote.quoteStatus = QuoteStatus.CLOSED;\n quote.requestedClosePrice = 0;\n removeFromOpenPositions(quote.id);\n quoteLayout.partyAPositionsCount[quote.partyA] -= 1;\n quoteLayout.partyBPositionsCount[quote.partyB][quote.partyA] -= 1;\n } else if (\n quote.quoteStatus == QuoteStatus.CANCEL_CLOSE_PENDING || quote.quantityToClose == 0\n ) {\n quote.quoteStatus = QuoteStatus.OPENED;\n quote.requestedClosePrice = 0;\n quote.quantityToClose = 0; // for CANCEL_CLOSE_PENDING status\n } else {\n require(\n quote.lockedValues.total() >=\n SymbolStorage.layout().symbols[quote.symbolId].minAcceptableQuoteValue,\n "LibQuote: Remaining quote value is low"\n );\n }\n }\n```\n | medium |
```\n/// @notice Distributes the balance of this contract to its owners\nfunction distribute() override external {\n // Calculate node share\n uint256 nodeShare = getNodeShare();\n // Transfer node share\n address withdrawalAddress = rocketStorage.getNodeWithdrawalAddress(nodeAddress);\n (bool success,) = withdrawalAddress.call{value : nodeShare}("");\n require(success);\n // Transfer user share\n uint256 userShare = address(this).balance;\n address rocketTokenRETH = rocketStorage.getAddress(rocketTokenRETHKey);\n payable(rocketTokenRETH).transfer(userShare);\n // Emit event\n emit FeesDistributed(nodeAddress, userShare, nodeShare, block.timestamp);\n}\n```\n | high |
```\nfunction mul(uint256 a, uint256 b) internal pure returns (uint256) {\n if (a == 0) {\n return 0;\n }\n\n uint256 c = a * b;\n require(c / a == b, "SafeMath: multiplication overflow");\n return c;\n}\n```\n | none |
```\nfunction flagShort(address asset, address shorter, uint8 id, uint16 flaggerHint)\n external\n isNotFrozen(asset)\n nonReentrant\n onlyValidShortRecord(asset, shorter, id)\n {\n // initial code\n\n short.setFlagger(cusd, flaggerHint);\n emit Events.FlagShort(asset, shorter, id, msg.sender, adjustedTimestamp);\n }\n```\n | high |
```\nif (twapCheck || positions[pos].twapOverride) {\n // check twap\n checkPriceChange(\n pos,\n (positions[pos].twapOverride ? positions[pos].twapInterval : twapInterval),\n (positions[pos].twapOverride ? positions[pos].priceThreshold : priceThreshold)\n );\n}\n```\n | high |
```\nuint256 colRatio = StableMath.min(props.colRatio, StableMath.getFullScale());\n\n// Ensure payout is related to the collateralised mAsset quantity\nuint256 collateralisedMassetQuantity = \_mAssetQuantity.mulTruncate(colRatio);\n```\n | medium |
```\nfunction tryDiv(\n uint256 a,\n uint256 b\n) internal pure returns (bool, uint256) {\n unchecked {\n if (b == 0) return (false, 0);\n return (true, a / b);\n }\n}\n```\n | none |
```\n function deposit(uint256 _underlyingAmount, address _receiver)\n external\n override\n whenNotPaused\n nonReentrant\n {\n _deposit(_underlyingAmount, _receiver);\n }\n\n function _deposit(uint256 _underlyingAmount, address _receiver) internal {\n /// Verify that the pool is not in OpenToBuyers phase\n if (poolInfo.currentPhase == ProtectionPoolPhase.OpenToBuyers) {\n revert ProtectionPoolInOpenToBuyersPhase();\n }\n\n uint256 _sTokenShares = convertToSToken(_underlyingAmount);\n totalSTokenUnderlying += _underlyingAmount;\n _safeMint(_receiver, _sTokenShares);\n poolInfo.underlyingToken.safeTransferFrom(\n msg.sender,\n address(this),\n _underlyingAmount\n );\n\n /// Verify leverage ratio only when total capital/sTokenUnderlying is higher than minimum capital requirement\n if (_hasMinRequiredCapital()) {\n /// calculate pool's current leverage ratio considering the new deposit\n uint256 _leverageRatio = calculateLeverageRatio();\n\n if (_leverageRatio > poolInfo.params.leverageRatioCeiling) {\n revert ProtectionPoolLeverageRatioTooHigh(_leverageRatio);\n }\n }\n\n emit ProtectionSold(_receiver, _underlyingAmount);\n }\n```\n | high |
```\n require(oraclePrice >= 0); /// @dev Chainlink rate error\n```\n | medium |
```\nfunction functionStaticCall(\n address target,\n bytes memory data,\n string memory errorMessage\n) internal view returns (bytes memory) {\n require(isContract(target), "Address: static call to non-contract");\n\n (bool success, bytes memory returndata) = target.staticcall(data);\n return verifyCallResult(success, returndata, errorMessage);\n}\n```\n | none |
```\nif (protected && (\n !context.closable.isZero() || // @audit even if closable is 0, position can still increase\n context.latestPosition.local.maintained(\n context.latestVersion,\n context.riskParameter,\n context.pendingCollateral.sub(collateral)\n ) ||\n collateral.lt(Fixed6Lib.from(-1, _liquidationFee(context, newOrder)))\n)) revert MarketInvalidProtectionError();\n\nif (\n !(context.currentPosition.local.magnitude().isZero() && context.latestPosition.local.magnitude().isZero()) && // sender has no position\n !(newOrder.isEmpty() && collateral.gte(Fixed6Lib.ZERO)) && // sender is depositing zero or more into account, without position change\n (context.currentTimestamp - context.latestVersion.timestamp >= context.riskParameter.staleAfter) // price is not stale\n) revert MarketStalePriceError();\n\nif (context.marketParameter.closed && newOrder.increasesPosition())\n revert MarketClosedError();\n\nif (context.currentPosition.global.maker.gt(context.riskParameter.makerLimit))\n revert MarketMakerOverLimitError();\n\nif (!newOrder.singleSided(context.currentPosition.local) || !newOrder.singleSided(context.latestPosition.local))\n revert MarketNotSingleSidedError();\n\nif (protected) return; // The following invariants do not apply to protected position updates (liquidations)\n```\n | high |
```\nmodifier lockedWhileVotesCast() {\n uint[] memory activeProposals = governance.getActiveProposals();\n for (uint i = 0; i < activeProposals.length; i++) {\n if (governance.getReceipt(activeProposals[i], getDelegate(msg.sender)).hasVoted) revert TokenLocked();\n (, address proposer,) = governance.getProposalData(activeProposals[i]);\n if (proposer == getDelegate(msg.sender)) revert TokenLocked();\n }\n _;\n}\n```\n | medium |
```\n function heal(uint256[] calldata agentIds) external nonReentrant {\n _assertFrontrunLockIsOff();\n//@audit If there are not enough activeAgents, heal is disabled\n if (gameInfo.activeAgents <= NUMBER_OF_SECONDARY_PRIZE_POOL_WINNERS) {\n revert HealingDisabled();\n }\n```\n | medium |
```\nfunction sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\n require(b <= a, errorMessage);\n uint256 c = a - b;\n return c;\n}\n```\n | none |
```\nif (safe.getThreshold() != _getCorrectThreshold()) {\n revert SignersCannotChangeThreshold();\n}\n```\n | high |
```\nfunction functionCallWithValue(\n address target,\n bytes memory data,\n uint256 value,\n string memory errorMessage\n) internal returns (bytes memory) {\n require(address(this).balance >= value, "Address: insufficient balance for call");\n require(isContract(target), "Address: call to non-contract");\n\n (bool success, bytes memory returndata) = target.call{value: value}(data);\n return verifyCallResult(success, returndata, errorMessage);\n}\n```\n | none |
```\nfunction deleteExcluded(uint index) internal {\n require(index < excludedFromRewards.length, "Index is greater than array length");\n excludedFromRewards[index] = excludedFromRewards[excludedFromRewards.length - 1];\n excludedFromRewards.pop();\n}\n```\n | none |
```\n * @notice Withdraws deposited collateral from the created escrow of a bid that has been successfully repaid.\n * @param _bidId The id of the bid to withdraw collateral for.\n */\n function withdraw(uint256 _bidId) external {\n BidState bidState = tellerV2.getBidState(_bidId);\n console2.log("WITHDRAW %d", uint256(bidState));\n if (bidState == BidState.PAID) {\n _withdraw(_bidId, tellerV2.getLoanBorrower(_bidId));\n } else if (tellerV2.isLoanDefaulted(_bidId)) { audit\n _withdraw(_bidId, tellerV2.getLoanLender(_bidId));\n emit CollateralClaimed(_bidId);\n } else {\n revert("collateral cannot be withdrawn");\n }\n }\n```\n | medium |
```\n IPoolTokensContainer(anchor).burn(\_poolToken, msg.sender, \_amount);\n\n // calculate how much liquidity to remove\n // if the entire supply is liquidated, the entire staked amount should be sent, otherwise\n // the price is based on the ratio between the pool token supply and the staked balance\n uint256 reserveAmount = 0;\n if (\_amount == initialPoolSupply)\n reserveAmount = balance;\n else\n reserveAmount = \_amount.mul(balance).div(initialPoolSupply);\n\n // sync the reserve balance / staked balance\n reserves[reserveToken].balance = reserves[reserveToken].balance.sub(reserveAmount);\n uint256 newStakedBalance = stakedBalances[reserveToken].sub(reserveAmount);\n stakedBalances[reserveToken] = newStakedBalance;\n```\n | high |
```\nFile: BridgeRouterFacet.sol\n function withdraw(address bridge, uint88 zethAmount)\n external\n nonReentrant\n onlyValidBridge(bridge)\n {\n if (zethAmount == 0) revert Errors.ParameterIsZero();\n uint88 fee;\n uint256 withdrawalFee = bridge.withdrawalFee();\n uint256 vault;\n if (bridge == rethBridge || bridge == stethBridge) {\n vault = Vault.CARBON;\n } else {\n vault = s.bridge[bridge].vault;\n }\n if (withdrawalFee > 0) {\n fee = zethAmount.mulU88(withdrawalFee);\n zethAmount -= fee;\n s.vaultUser[vault][address(this)].ethEscrowed += fee;\n }\n uint88 ethAmount = _ethConversion(vault, zethAmount);\n vault.removeZeth(zethAmount, fee);\n IBridge(bridge).withdraw(msg.sender, ethAmount);\n emit Events.Withdraw(bridge, msg.sender, zethAmount, fee);\n }\n// rest of code\n function _ethConversion(uint256 vault, uint88 amount) private view returns (uint88) {\n uint256 zethTotalNew = vault.getZethTotal();\n uint88 zethTotal = s.vault[vault].zethTotal;\n if (zethTotalNew >= zethTotal) {\n // when yield is positive 1 zeth = 1 eth\n return amount;\n } else {\n // negative yield means 1 zeth < 1 eth\n return amount.mulU88(zethTotalNew).divU88(zethTotal);\n }\n }\n```\n | low |
```\ncontract StableOracleWBTC is IStableOracle {\n AggregatorV3Interface priceFeed;\n\n constructor() {\n priceFeed = AggregatorV3Interface(\n 0x5f4eC3Df9cbd43714FE2740f5E3616155c5b8419\n\n );\n }\n\n function getPriceUSD() external view override returns (uint256) {\n (, int256 price, , , ) = priceFeed.latestRoundData();\n // chainlink price data is 8 decimals for WBTC/USD\n return uint256(price) * 1e10;\n }\n}\n```\n | medium |
```\nbytes32 urlHash = keccak256(bytes(\_url));\n\n// make sure this url and also this owner was not registered before.\n// solium-disable-next-line\nrequire(!urlIndex[urlHash].used && signerIndex[\_signer].stage == Stages.NotInUse,\n "a node with the same url or signer is already registered");\n```\n | high |
```\n if (\n collateralBalance > 0 &&\n (currentFees + borrowing.feesOwed) / Constants.COLLATERAL_BALANCE_PRECISION >\n Constants.MINIMUM_AMOUNT\n ) {\n liquidationBonus +=\n uint256(collateralBalance) /\n Constants.COLLATERAL_BALANCE_PRECISION;\n } else {\n currentFees = borrowing.dailyRateCollateralBalance;\n }\n```\n | medium |
```\n function storePrice(address asset_) public override permissioned {\n Asset storage asset = _assetData[asset_];\n\n // Check if asset is approved\n if (!asset.approved) revert PRICE_AssetNotApproved(asset_);\n\n // Get the current price for the asset\n (uint256 price, uint48 currentTime) = _getCurrentPrice(asset_);\n\n // Store the data in the obs index\n uint256 oldestPrice = asset.obs[asset.nextObsIndex];\n asset.obs[asset.nextObsIndex] = price;\n\n // Update the last observation time and increment the next index\n asset.lastObservationTime = currentTime;\n asset.nextObsIndex = (asset.nextObsIndex + 1) % asset.numObservations;\n\n // Update the cumulative observation, if storing the moving average\n if (asset.storeMovingAverage)\n asset.cumulativeObs = asset.cumulativeObs + price - oldestPrice;\n\n // Emit event\n emit PriceStored(asset_, price, currentTime);\n }\n```\n | high |
```\nif (char == 0x3B) // 0x3B = ';'\n```\n | low |
```\n// rest of code\nexpiry = ((vesting_ + uint48(block.timestamp)) / uint48(1 days)) * uint48(1 days);\n\n// Fixed-term user payout information is handled in BondTeller.\n// Teller mints ERC-1155 bond tokens for user.\nuint256 tokenId = getTokenId(payoutToken_, expiry);\n\n// Create new bond token if it doesn't exist yet\nif (!tokenMetadata[tokenId].active) {\n _deploy(tokenId, payoutToken_, expiry);\n}\n// rest of code\n```\n | medium |
```\nfunction dividendTokenBalanceOf(address account) public view returns (uint256) {\n return dividendTracker.balanceOf(account);\n}\n```\n | none |
```\nfunction createSplit(\n address[] calldata accounts,\n uint32[] calldata percentAllocations,\n uint32 distributorFee,\n address controller\n)\n external\n override\n validSplit(accounts, percentAllocations, distributorFee)\n returns (address split)\n{\n bytes32 splitHash = _hashSplit(\n accounts,\n percentAllocations,\n distributorFee\n );\n if (controller == address(0)) {\n // create immutable split\n split = Clones.cloneDeterministic(walletImplementation, splitHash);\n } else {\n // create mutable split\n split = Clones.clone(walletImplementation);\n splits[split].controller = controller;\n }\n // store split's hash in storage for future verification\n splits[split].hash = splitHash;\n emit CreateSplit(split);\n}\n```\n | none |
```\nuint256 updatedTotalShares = totalShares + newShares;\nrequire(updatedTotalShares >= MIN\_NONZERO\_TOTAL\_SHARES,\n "StrategyBase.deposit: updated totalShares amount would be nonzero but below MIN\_NONZERO\_TOTAL\_SHARES");\n```\n | low |
```\nint256 premium = getMarkPriceTwap() - underlyingPrice;\n```\n | medium |
```\nfunction getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := slot\n }\n}\n```\n | none |
```\nfunction removeAllFee() private {\n if(_taxFee == 0 && _liquidityFee == 0) return;\n \n _previousTaxFee = _taxFee;\n _previousLiquidityFee = _liquidityFee;\n \n _taxFee = 0;\n _liquidityFee = 0;\n}\n```\n | none |
```\nfunction liquidate(\n address asset,\n address shorter,\n uint8 id,\n uint16[] memory shortHintArray\n)\n external\n isNotFrozen(asset)\n nonReentrant\n onlyValidShortRecord(asset, shorter, id)\n returns (uint88, uint88)\n{\n// rest of code\n}\n```\n | high |
```\nfunction sub(uint256 a, uint256 b) internal pure returns (uint256) {\n return a - b;\n}\n```\n | none |
```\nvaults[_vaultNumber].deltaAllocationProtocol[_chainId][i] = 0;\n```\n | medium |
```\nFile: contracts\libraries\SafeCall.sol\n function callWithMinGas(\n address _target,\n uint256 _minGas,\n uint256 _value,\n bytes memory _calldata\n ) internal returns (bool) {\n bool _success;\n assembly {\n // Assertion: gasleft() >= ((_minGas + 200) * 64) / 63\n //\n // Because EIP-150 ensures that, a maximum of 63/64ths of the remaining gas in the call\n // frame may be passed to a subcontext, we need to ensure that the gas will not be\n // truncated to hold this function's invariant: "If a call is performed by\n // `callWithMinGas`, it must receive at least the specified minimum gas limit." In\n // addition, exactly 51 gas is consumed between the below `GAS` opcode and the `CALL`\n // opcode, so it is factored in with some extra room for error.\n if lt(gas(), div(mul(64, add(_minGas, 200)), 63)) {\n // Store the "Error(string)" selector in scratch space.\n mstore(0, 0x08c379a0)\n // Store the pointer to the string length in scratch space.\n mstore(32, 32)\n // Store the string.\n //\n // SAFETY:\n // - We pad the beginning of the string with two zero bytes as well as the\n // length (24) to ensure that we override the free memory pointer at offset\n // 0x40. This is necessary because the free memory pointer is likely to\n // be greater than 1 byte when this function is called, but it is incredibly\n // unlikely that it will be greater than 3 bytes. As for the data within\n // 0x60, it is ensured that it is 0 due to 0x60 being the zero offset.\n // - It's fine to clobber the free memory pointer, we're reverting.\n mstore(88, 0x0000185361666543616c6c3a204e6f7420656e6f75676820676173)\n\n // Revert with 'Error("SafeCall: Not enough gas")'\n revert(28, 100)\n }\n\n // The call will be supplied at least (((_minGas + 200) * 64) / 63) - 49 gas due to the\n // above assertion. This ensures that, in all circumstances, the call will\n // receive at least the minimum amount of gas specified.\n // We can prove this property by solving the inequalities:\n // ((((_minGas + 200) * 64) / 63) - 49) >= _minGas\n // ((((_minGas + 200) * 64) / 63) - 51) * (63 / 64) >= _minGas\n // Both inequalities hold true for all possible values of `_minGas`.\n _success := call(\n gas(), // gas\n _target, // recipient\n _value, // ether value\n add(_calldata, 32), // inloc\n mload(_calldata), // inlen\n 0x00, // outloc\n 0x00 // outlen\n )\n }\n return _success;\n }\n```\n | high |
```\nfunction functionCallWithValue(\n address target,\n bytes memory data,\n uint256 value\n) internal returns (bytes memory) {\n return functionCallWithValue(target, data, value, "Address: low-level call with value failed");\n}\n```\n | none |
```\nconst config = nodes.nodes.find(\_ => \_.address.toLowerCase() === adr.toLowerCase())\nif (!config) // TODO do we need to throw here or is it ok to simply not deliver the signature?\n throw new Error('The ' + adr + ' does not exist within the current registered active nodeList!')\n\n// get cache signatures and remaining blocks that have no signatures\nconst cachedSignatures: Signature[] = []\nconst blocksToRequest = blocks.filter(b => {\n const s = signatureCaches.get(b.hash) && false\n return s ? cachedSignatures.push(s) \* 0 : true\n})\n\n// send the sign-request\nlet response: RPCResponse\ntry {\n response = (blocksToRequest.length\n ? await handler.transport.handle(config.url, { id: handler.counter++ || 1, jsonrpc: '2.0', method: 'in3\_sign', params: blocksToRequest })\n : { result: [] }) as RPCResponse\n if (response.error) {\n```\n | high |
```\n function getTargetExternalLendingAmount(\n Token memory underlyingToken,\n PrimeCashFactors memory factors,\n RebalancingTargetData memory rebalancingTargetData,\n OracleData memory oracleData,\n PrimeRate memory pr\n ) internal pure returns (uint256 targetAmount) {\n // Short circuit a zero target\n if (rebalancingTargetData.targetUtilization == 0) return 0;\n\n// rest of code.\n if (targetAmount < oracleData.currentExternalUnderlyingLend) {\n uint256 forRedemption = oracleData.currentExternalUnderlyingLend - targetAmount;\n if (oracleData.externalUnderlyingAvailableForWithdraw < forRedemption) {\n // increase target amount so that redemptions amount match externalUnderlyingAvailableForWithdraw\n targetAmount = targetAmount.add(\n // unchecked - is safe here, overflow is not possible due to above if conditional\n forRedemption - oracleData.externalUnderlyingAvailableForWithdraw\n );\n }\n }\n```\n | medium |
```\n // rest of code\n pushFeedbackToVault(_chainId, _vault, _relayerFee);\n xTransfer(_asset, _amount, _vault, _chainId, _slippage, _relayerFee);\n // rest of code\n```\n | medium |
```\nfunction div(uint256 a, uint256 b) internal pure returns (uint256) {\n return div(a, b, "SafeMath: division by zero");\n}\n```\n | none |
```\nfunction simulateHandleOp(UserOperation calldata op, address target, bytes calldata targetCallData) external override {\n\n UserOpInfo memory opInfo;\n _simulationOnlyValidations(op);\n (uint256 validationData, uint256 paymasterValidationData) = _validatePrepayment(0, op, opInfo);\n ValidationData memory data = _intersectTimeRange(validationData, paymasterValidationData);\n\n numberMarker();\n uint256 paid = _executeUserOp(0, op, opInfo);\n numberMarker();\n bool targetSuccess;\n bytes memory targetResult;\n if (target != address(0)) {\n (targetSuccess, targetResult) = target.call(targetCallData);\n }\n revert ExecutionResult(opInfo.preOpGas, paid, data.validAfter, data.validUntil, targetSuccess, targetResult);\n}\n```\n | none |
```\n function isDeviatingWithBpsCheck(\n uint256 value0_,\n uint256 value1_,\n uint256 deviationBps_,\n uint256 deviationMax_\n ) internal pure returns (bool) {\n if (deviationBps_ > deviationMax_)\n revert Deviation_InvalidDeviationBps(deviationBps_, deviationMax_);\n\n return isDeviating(value0_, value1_, deviationBps_, deviationMax_);\n }\n\n function isDeviating(\n uint256 value0_,\n uint256 value1_,\n uint256 deviationBps_,\n uint256 deviationMax_\n ) internal pure returns (bool) {\n return\n (value0_ < value1_)\n ? _isDeviating(value1_, value0_, deviationBps_, deviationMax_)\n : _isDeviating(value0_, value1_, deviationBps_, deviationMax_);\n }\n```\n | medium |
```\ncontext.currentPosition = registration.market.pendingPosition(global.currentId);\n```\n | medium |
```\n//@audit compound if only ARB is there, what about tokenA and tokenB?\nif (_tokenInAmt > 0) {\n self.refundee = payable(msg.sender);\n\n self.compoundCache.compoundParams = cp;\n\n ISwap.SwapParams memory _sp;\n\n _sp.tokenIn = cp.tokenIn;\n _sp.tokenOut = cp.tokenOut;\n _sp.amountIn = _tokenInAmt;\n _sp.amountOut = 0; // amount out minimum calculated in Swap\n _sp.slippage = self.minSlippage;\n _sp.deadline = cp.deadline;\n\n GMXManager.swapExactTokensForTokens(self, _sp);\n\n GMXTypes.AddLiquidityParams memory _alp;\n\n _alp.tokenAAmt = self.tokenA.balanceOf(address(this));\n _alp.tokenBAmt = self.tokenB.balanceOf(address(this));\n\n self.compoundCache.depositValue = GMXReader.convertToUsdValue(\n self,\n address(self.tokenA),\n self.tokenA.balanceOf(address(this))\n )\n + GMXReader.convertToUsdValue(\n self,\n address(self.tokenB),\n self.tokenB.balanceOf(address(this))\n );\n\n GMXChecks.beforeCompoundChecks(self);\n\n self.status = GMXTypes.Status.Compound;\n\n _alp.minMarketTokenAmt = GMXManager.calcMinMarketSlippageAmt(\n self,\n self.compoundCache.depositValue,\n cp.slippage\n );\n\n _alp.executionFee = cp.executionFee;\n\n self.compoundCache.depositKey = GMXManager.addLiquidity(\n self,\n _alp\n );\n }\n```\n | medium |
```\n function fulfillDomainBid(\n uint256 parentId,\n uint256 bidAmount,\n uint256 royaltyAmount,\n string memory bidIPFSHash,\n string memory name,\n string memory metadata,\n bytes memory signature,\n bool lockOnCreation,\n address recipient\n) external {\n bytes32 recoveredBidHash = createBid(parentId, bidAmount, bidIPFSHash, name);\n address recoveredBidder = recover(recoveredBidHash, signature);\n require(recipient == recoveredBidder, "ZNS: bid info doesnt match/exist");\n bytes32 hashOfSig = keccak256(abi.encode(signature));\n require(approvedBids[hashOfSig] == true, "ZNS: has been fullfilled");\n infinity.safeTransferFrom(recoveredBidder, controller, bidAmount);\n uint256 id = registrar.registerDomain(parentId, name, controller, recoveredBidder);\n registrar.setDomainMetadataUri(id, metadata);\n registrar.setDomainRoyaltyAmount(id, royaltyAmount);\n registrar.transferFrom(controller, recoveredBidder, id);\n if (lockOnCreation) {\n registrar.lockDomainMetadataForOwner(id);\n }\n approvedBids[hashOfSig] = false;\n emit DomainBidFulfilled(\n metadata,\n name,\n recoveredBidder,\n id,\n parentId\n );\n}\n```\n | medium |
```\nfunction wln(int256 x) internal pure returns (int256) {\n require(x > 0, "logE of negative number");\n require(x <= 10000000000000000000000000000000000000000, "logE only accepts v <= 1e22 \* 1e18"); // in order to prevent using safe-math\n int256 r = 0;\n uint8 extra\_digits = longer\_digits - fixed\_digits;\n```\n | low |
```\n function transferOwnership(address newPendingOwner) external payable;\n function renounceOwnership() external payable;\n```\n | low |
```\nfunction _nonReentrantBefore() private {\n // On the first call to nonReentrant, _status will be _NOT_ENTERED\n require(_status != _ENTERED, "ReentrancyGuard: reentrant call");\n\n // Any calls to nonReentrant after this point will fail\n _status = _ENTERED;\n}\n```\n | none |
```\nconstructor() {\n _transferOwnership(_msgSender());\n}\n```\n | none |
```\nfunction good(bytes calldata shared, address target, bytes calldata receipt) external pure returns (bool);\n```\n | medium |
```\nfunction \_domain()\ninternal view returns (IexecLibOrders\_v5.EIP712Domain memory)\n{\n return IexecLibOrders\_v5.EIP712Domain({\n name: "iExecODB"\n , version: "3.0-alpha"\n , chainId: \_chainId()\n , verifyingContract: address(this)\n });\n}\n```\n | medium |
```\nfunction setOperatorAddresses(\n uint256 \_operatorIndex,\n address \_operatorAddress,\n address \_feeRecipientAddress\n) external onlyActiveOperatorFeeRecipient(\_operatorIndex) {\n \_checkAddress(\_operatorAddress);\n \_checkAddress(\_feeRecipientAddress);\n StakingContractStorageLib.OperatorsSlot storage operators = StakingContractStorageLib.getOperators();\n\n operators.value[\_operatorIndex].operator = \_operatorAddress;\n operators.value[\_operatorIndex].feeRecipient = \_feeRecipientAddress;\n emit ChangedOperatorAddresses(\_operatorIndex, \_operatorAddress, \_feeRecipientAddress);\n}\n```\n | high |
```\nfunction _setBalance(address account, uint256 newBalance) internal {\n uint256 currentBalance = balanceOf(account);\n\n if (newBalance > currentBalance) {\n uint256 mintAmount = newBalance.sub(currentBalance);\n _mint(account, mintAmount);\n } \n else if (newBalance < currentBalance) {\n uint256 burnAmount = currentBalance.sub(newBalance);\n _burn(account, burnAmount);\n }\n}\n```\n | none |
```\n address vault = strategies[param.strategyId].vault;\n _doPutCollateral(\n vault,\n IERC20Upgradeable(ISoftVault(vault).uToken()).balanceOf(\n address(this)\n )\n );\n```\n | high |
```\nfunction \_decrementGaugeWeight(\n address user,\n address gauge,\n uint112 weight,\n uint32 cycle\n) internal {\n uint112 oldWeight = getUserGaugeWeight[user][gauge];\n\n getUserGaugeWeight[user][gauge] = oldWeight - weight;\n if (oldWeight == weight) {\n // If removing all weight, remove gauge from user list.\n assert(\_userGauges[user].remove(gauge));\n }\n```\n | low |
```\nconstructor() ERC20("NAVRAS Tech", "NAVRAS") {\n\n uniswapRouter = DexRouter(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);\n pairAddress = DexFactory(uniswapRouter.factory()).createPair(\n address(this),\n uniswapRouter.WETH()\n );\n whitelisted[msg.sender] = true;\n whitelisted[address(uniswapRouter)] = true;\n whitelisted[DevelopmentAddress] = true;\n whitelisted[OperationsAddress] = true;\n whitelisted[address(this)] = true; \n _mint(0xF8567e8161C885fb922Efdc819976f70f5F7D433, _totalSupply);\n\n}\n```\n | none |
```\nFile: PrimeRateLib.sol\n // This is purely done to fully reconcile off chain accounting with the edge condition where\n // leveraged vaults lend at zero interest.\n int256 fCashDebtInReserve = -int256(s.fCashDebtHeldInSettlementReserve);\n int256 primeCashInReserve = int256(s.primeCashHeldInSettlementReserve);\n if (fCashDebtInReserve > 0 || primeCashInReserve > 0) {\n int256 settledPrimeCash = convertFromUnderlying(settlementRate, fCashDebtInReserve);\n int256 excessCash;\n if (primeCashInReserve > settledPrimeCash) {\n excessCash = primeCashInReserve - settledPrimeCash;\n BalanceHandler.incrementFeeToReserve(currencyId, excessCash);\n } \n\n Emitter.emitSettlefCashDebtInReserve(\n currencyId, maturity, fCashDebtInReserve, settledPrimeCash, excessCash\n );\n }\n```\n | medium |
```\n function _registerRecipient(bytes memory _data, address _sender)\n internal\n override\n onlyActiveRegistration\n returns (address recipientId)\n {\n …\n\n uint8 currentStatus = _getUintRecipientStatus(recipientId);\n\n if (currentStatus == uint8(Status.None)) {\n // recipient registering new application\n recipientToStatusIndexes[recipientId] = recipientsCounter;\n _setRecipientStatus(recipientId, uint8(Status.Pending));\n\n bytes memory extendedData = abi.encode(_data, recipientsCounter);\n emit Registered(recipientId, extendedData, _sender);\n\n recipientsCounter++;\n } else {\n if (currentStatus == uint8(Status.Accepted)) {\n // recipient updating accepted application\n _setRecipientStatus(recipientId, uint8(Status.Pending));\n } else if (currentStatus == uint8(Status.Rejected)) {\n // recipient updating rejected application\n _setRecipientStatus(recipientId, uint8(Status.Appealed));\n }\n emit UpdatedRegistration(recipientId, _data, _sender, _getUintRecipientStatus(recipientId));\n }\n }\n```\n | high |
```\nFile: StrategyUtils.sol\n function _executeTradeExactIn(\n TradeParams memory params,\n ITradingModule tradingModule,\n address sellToken,\n address buyToken,\n uint256 amount,\n bool useDynamicSlippage\n ) internal returns (uint256 amountSold, uint256 amountBought) {\n require(\n params.tradeType == TradeType.EXACT_IN_SINGLE || params.tradeType == TradeType.EXACT_IN_BATCH\n );\n if (useDynamicSlippage) {\n require(params.oracleSlippagePercentOrLimit <= Constants.SLIPPAGE_LIMIT_PRECISION);\n }\n\n // Sell residual secondary balance\n Trade memory trade = Trade(\n params.tradeType,\n sellToken,\n buyToken,\n amount,\n useDynamicSlippage ? 0 : params.oracleSlippagePercentOrLimit,\n block.timestamp, // deadline\n params.exchangeData\n );\n```\n | medium |
```\n\_to.transfer(address(this).balance);\n```\n | medium |
```\n function rebalanceNeeded() public view returns (bool) {\n return (block.timestamp - lastTimeStamp) > rebalanceInterval || msg.sender == guardian;\n }\n```\n | medium |
```\n struct Routing {\n // rest of code\n uint96 funding; \n // rest of code\n }\n```\n | high |
```\nfunction getPriceFromChainlink(address base, address quote) internal view returns (uint256) {\n (, int256 price,,,) = registry.latestRoundData(base, quote);\n require(price > 0, "invalid price");\n\n // Extend the decimals to 1e18.\n return uint256(price) * 10 ** (18 - uint256(registry.decimals(base, quote)));\n}\n```\n | medium |
```\nFile: Curve2TokenPoolMixin.sol\n constructor(\n NotionalProxy notional_,\n DeploymentParams memory params\n ) SingleSidedLPVaultBase(notional_, params.tradingModule) {\n CURVE_POOL = params.pool;\n\n bool isCurveV2 = false;\n if (Deployments.CHAIN_ID == Constants.CHAIN_ID_MAINNET) {\n address[10] memory handlers = \n Deployments.CURVE_META_REGISTRY.get_registry_handlers_from_pool(address(CURVE_POOL));\n\n require(\n handlers[0] == Deployments.CURVE_V1_HANDLER ||\n handlers[0] == Deployments.CURVE_V2_HANDLER\n ); // @dev unknown Curve version\n isCurveV2 = (handlers[0] == Deployments.CURVE_V2_HANDLER);\n }\n IS_CURVE_V2 = isCurveV2;\n```\n | medium |
```\n // buy wETH\n // lowest price is best price when buying\n uint256 priceToUse = quotePrice < underlyingPrice ? quotePrice : \n underlyingPrice;\n RangeOrderDirection direction = inversed ? RangeOrderDirection.ABOVE \n : RangeOrderDirection.BELOW;\n RangeOrderParams memory rangeOrder = \n _getTicksAndMeanPriceFromWei(priceToUse, direction);\n```\n | high |
```\n/// @dev One instance per price feed should be deployed. Multiple products may use the same\n/// KeeperOracle instance if their payoff functions are based on the same underlying oracle.\n/// This implementation only supports non-negative prices.\n```\n | medium |
```\nfunction fillCloseRequest(\n..SNIP..\n if (quote.positionType == PositionType.LONG) {\n require(\n closedPrice >= quote.requestedClosePrice,\n "PartyBFacet: Closed price isn't valid"\n )\n```\n | medium |
```\n// load pending positions\nfor (uint256 id = context.local.latestId + 1; id < context.local.currentId; id++)\n _processPendingPosition(context, _loadPendingPositionLocal(context, account, id));\n```\n | medium |