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 = co...
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 {...
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, "...
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 \_op...
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 = ICu...
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-->PoolMi...
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.ti...
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...
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 blockAd...
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 \...
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 d...
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(primaryAddre...
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 ...
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 (, i...
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 ...
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 t...
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...
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...
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,) ...
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...
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 OpenToBuyer...
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 verifyC...
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....
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.getProposa...
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-contra...
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 consol...
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 sta...
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 ...
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 (, int...
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 ...
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 curren...
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...
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 ...
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) * 6...
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 re...
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 ...
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 memo...
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_);...
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 ...
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, b...
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\_d...
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 operat...
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 ...
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, rem...
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...
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.primeCashH...
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)...
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) ...
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, q...
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_M...
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 range...
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