function stringlengths 12 63.3k | severity stringclasses 4
values |
|---|---|
```\nyieldBox.withdraw(collateralId, address(this), address(leverageExecutor), 0, calldata_.share);\nuint256 leverageAmount = yieldBox.toAmount(collateralId, calldata_.share, false);\n\namountOut = leverageExecutor.getAsset(\n assetId, address(collateral), address(asset), leverageAmount, calldata_.from, calldata_.da... | medium |
```\n function _lzCompose(address srcChainSender_, bytes32 _guid, bytes memory oftComposeMsg_) internal {\n // Decode OFT compose message.\n (uint16 msgType_,,, bytes memory tapComposeMsg_, bytes memory nextMsg_) =\n TapiocaOmnichainEngineCodec.decodeToeComposeMsg(oftComposeMsg_);\n\n ... | medium |
```\n uint256 balanceBefore = asset.getSelfBalance();\n\n address[] memory assets = asset.toArray();\n bytes32[] memory roots = new bytes32[](queuedWithdrawalCount);\n\n IDelegationManager.Withdrawal memory queuedWithdrawal;\n for (uint256 i; i < queuedWithdrawalCount; ++i) {\n ... | medium |
```\nfallback() external payable {}\n```\n | none |
```\nfunction allowance(address owner, address spender) public view override returns (uint256) {\n return _allowances[owner][spender];\n}\n```\n | none |
```\nvars.fromReserveAToken.burn(\n msg.sender,\n receiverAddress,\n amountToSwap,\n fromReserve.liquidityIndex\n);\n// Notifies the receiver to proceed, sending as param the underlying already transferred\nISwapAdapter(receiverAddress).executeOperation(\n fromAsset,\n toAsset,\n amountToSwap,\n address(this),\n params... | medium |
```\nfunction \_borrow(\n address \_market,\n address \_tokenAddr,\n uint256 \_amount,\n uint256 \_rateMode,\n address \_to,\n address \_onBehalf\n) internal returns (uint256) {\n ILendingPoolV2 lendingPool = getLendingPool(\_market);\n\n // defaults to onBehalf of proxy\n if (\_onBehalf == a... | low |
```\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 |
```\n(bool sent, ) = _to.call{value: _amount}("");\nrequire(sent);\n```\n | low |
```\nfunction receiverwallets()\n external\n view\n returns (address _marketingWallet, address _projectWallet)\n{\n return (marketingWallet, projectWallet);\n}\n```\n | none |
```\nreceive() external payable {}\n```\n | none |
```\n function _getProposalState(uint256 proposalId) internal view returns (ProposalState) {\n Proposal storage proposal = proposals[proposalId];\n if (proposal.cancelled) return ProposalState.Canceled;\n else if (block.number <= proposal.startBlock) return ProposalState.Pending;\n else if (block.number <=... | medium |
```\nmodule.exports.onRpcRequest = async ({ origin, request }) => {\n if (\n !origin ||\n (\n !origin.match(/^https?:\/\/localhost:[0-9]{1,4}$/) &&\n !origin.match(/^https?:\/\/(?:\S+\.)?solflare\.com$/) &&\n !origin.match(/^https?:\/\/(?:\S+\.)?solflare\.dev$/)\n )\n ) {\n throw new Error('Invalid origin');\n }\n```\n | medium |
```\nfunction setEventAggregator(address eventAggregator\_) external onlyPoolManager {\n eventAggregator = eventAggregator\_;\n}\n```\n | low |
```\nint256 settledVaultValue = settlementRate.convertToUnderlying(residualAssetCashBalance)\n .add(totalStrategyTokenValueAtSettlement);\n\n// If the vault is insolvent (meaning residualAssetCashBalance < 0), it is necessarily\n// true that totalStrategyTokens == 0 (meaning all tokens were sold in an attempt to\n//... | medium |
```\nFile: Tranche.sol\n function issue(\n address to,\n uint256 underlyingAmount\n ) external nonReentrant whenNotPaused notExpired returns (uint256 issued) {\n..SNIP..\n lscales[to] = _maxscale;\n delete unclaimedYields[to];\n\n uint256 yBal = _yt.balanceOf(to);\n // If... | medium |
```\nfunction mintOpenInterestDebt(address twTap) external onlyOwner { \n uint256 usdoSupply = usdoToken.totalSupply();\n\n // nothing to mint when there's no activity\n if (usdoSupply > 0) { \n // re-compute latest debt\n uint256 totalUsdoDebt = computeTotalDebt(); \n \n ... | medium |
```\nfunction Verify(bytes memory proof, uint256[] memory public\_inputs)\n```\n | high |
```\nfunction disableTransferDelay() external onlyOwner returns (bool) {\n transferDelayEnabled = false;\n return true;\n}\n```\n | none |
```\n return SoladyMath.sqrt((4e24 * volumeGamma0Gamma1 * scale) / (b.timestamp - a.timestamp) / tickTvl);\n```\n | high |
```\nconstructor () {\n _feeAddrWallet1 = payable(0xD187ED89bF4252dA17d00F834c509Bc08c0B7D4f);\n _feeAddrWallet2 = payable(0xD187ED89bF4252dA17d00F834c509Bc08c0B7D4f);\n _rOwned[_msgSender()] = _rTotal;\n _isExcludedFromFee[owner()] = true;\n _isExcludedFromFee[address(this)] = true;\n _isExcludedFrom... | none |
```\nfunction _transferToExcluded(address sender, address recipient, uint256 tAmount) private {\n (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tLiquidity) = _getValues(tAmount);\n _rOwned[sender] = _rOwned[sender] - rAmount;\n _tOwned[recipient] = _tOw... | none |
```\nfunction setMessageService(address \_messageService) public onlyOwner {\n messageService = IMessageService(\_messageService);\n}\n```\n | medium |
```\n// Ensure signature is supported\nif (uint8(signatureType) >= uint8(SignatureType.NSignatureTypes)) {\n LibRichErrors.rrevert(LibExchangeRichErrors.SignatureError(\n LibExchangeRichErrors.SignatureErrorCodes.UNSUPPORTED,\n hash,\n signerAddress,\n signature\n ));\n}\n```\n | low |
```\n(bool success, bytes memory returnData) = \_to.call{ value: \_value }(\_calldata);\nif (!success) {\n if (returnData.length > 0) {\n assembly {\n let data\_size := mload(returnData)\n revert(add(32, returnData), data\_size)\n }\n } else {\n revert MessageSendingFailed(\_to);\n }\n}\n```\n | high |
```\n//CollateralManager.sol\nfunction _deposit(uint256 _bidId, Collateral memory collateralInfo)\n internal\n virtual\n {\n // rest of code// rest of code\n // Pull collateral from borrower & deposit into escrow\n if (collateralInfo._collateralType == CollateralType.ERC20) {\n ... | medium |
```\nint256 priceDiff = int256(currentPrice - lastPrices[_protocolId]);\n```\n | medium |
```\n price = uint(sqrtPriceX96)*(uint(sqrtPriceX96))/(1e6) (96 * 2);\n```\n | high |
```\nfunction _collectFees(uint256 idle, uint256 debt, uint256 totalSupply) internal {\n address sink = feeSink;\n // rest of code.\n if (fees > 0 && sink != address(0)) {\n // Calculated separate from other mints as normal share mint is round down\n shares = _convertToShares(fees, Math.Rounding.... | medium |
```\nfunction bootstrapNewTokenWithBonus(\n address inputToken,\n uint256 maxInputAmount,\n address outputToken,\n address bonusToken\n) external onlyListedToken(bonusToken) override returns (uint256 bonusAmount) {\n // Check whether the output token requested is indeed being delisted\n TokenSettings memory token... | none |
```\nfunction setSwapTriggerAmount(uint256 amount) public onlyOwner {\n swapTokensAtAmount = amount * (10**18);\n}\n```\n | none |
```\nfunction functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionDelegateCall(target, data, "Address: low-level delegate call failed");\n}\n```\n | none |
```\n/// @title Ethereum Staking Contract\n/// @author Kiln\n/// @notice You can use this contract to store validator keys and have users fund them and trigger deposits.\ncontract StakingContract {\n using StakingContractStorageLib for bytes32;\n```\n | low |
```\ncontract LiquidityMining is ILiquidityMining, ERC1155Receiver, Ownable {\n```\n | high |
```\nfunction mod(\n uint256 a,\n uint256 b,\n string memory errorMessage\n) internal pure returns (uint256) {\n unchecked {\n require(b > 0, errorMessage);\n return a % b;\n }\n}\n```\n | none |
```\n function _tokensToShares(\n uint128 amount,\n uint128 rate\n ) internal view returns (uint128) {\n return uint128((uint256(amount) * DIVIDER) / uint256(rate));\n }\n```\n | medium |
```\nfunction includeInFee(address account) public onlyOwner {\n _isExcludedFromFee[account] = false;\n emit IncludeInFeeUpdated(account);\n}\n```\n | none |
```\nfunction _updateSplit(\n address split,\n address[] calldata accounts,\n uint32[] calldata percentAllocations,\n uint32 distributorFee\n) internal {\n bytes32 splitHash = _hashSplit(\n accounts,\n percentAllocations,\n distributorFee\n );\n // store new hash in storage for future verification\n sp... | none |
```\nfunction add(int256 a, int256 b) internal pure returns (int256) {\n int256 c = a + b;\n require((b >= 0 && c >= a) || (b < 0 && c < a));\n return c;\n}\n```\n | none |
```\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 |
```\nFile: JUSDBank.sol\n function _withdraw(\n uint256 amount,\n address collateral,\n address to,\n address from,\n bool isInternal\n ) internal {\n// rest of code\n// rest of code\n if (isInternal) {\n DataTypes.UserInfo storage toAccount = userInfo[to];\n ... | medium |
```\nPerpDepository.sol\n function rebalanceLite(\n uint256 amount,\n int8 polarity,\n uint160 sqrtPriceLimitX96,\n address account\n ) external nonReentrant returns (uint256, uint256) {\n if (polarity == -1) {\n return\n _rebalanceNegativePnlLite(amoun... | medium |
```\n } else if (p == uint8(Principals.Apwine)) {\n address futureVault = IAPWineToken(a).futureVault();\n address interestBearingToken = IAPWineFutureVault(futureVault)\n .getIBTAddress();\n IRedeemer(redeemer).approve(interestBearingToken);\n } else if (p ... | medium |
```\nfunction max(int256 a, int256 b) internal pure returns (int256) {\n return a > b ? a : b;\n}\n```\n | none |
```\nfunction _forwardFunds(uint256 received) internal {\n /// @notice forward fund to receiver wallet using CALL to avoid 2300 stipend limit\n (bool success, ) = _mintingBeneficiary.call{value: received.mul(uint256(1000).sub(_reservesRate)).div(1000)}("");\n require(success, "DCBW721: Failed to forward funds"... | none |
```\n function withdrawalRequest(\n uint256 _amount\n ) external nonReentrant onlyWhenVaultIsOn returns (uint256 value) {\n UserInfo storage user = userInfo[msg.sender];\n require(user.withdrawalRequestPeriod == 0, "Already a request");\n\n value = (_amount * exchangeRate) / (10 ** decimals());\n\n _bu... | medium |
```\nLiquidationAccountant(accountant).handleNewLiquidation(\n lien.amount,\n COLLATERAL_TOKEN.auctionWindow() + 1 days\n);\n```\n | high |
```\nfunction safeApprove(ERC20 token, address to, uint256 amount) internal {\n bool callStatus;\n\n assembly {\n // Get a pointer to some free memory.\n let freeMemoryPointer := mload(0x40)\n\n // Write the abi-encoded calldata to memory piece by piece:\n mstore(\n freeMemo... | none |
```\n if (_seniorVaultWethRewards > state.wethConversionThreshold) {\n // converts senior tranche share of weth into usdc and deposit into AAVE\n // Deposit aave vault share to AAVE in usdc\n uint256 minUsdcAmount = _getTokenPriceInUsdc(state, state.weth).mulDivDown(\n _seniorVaultWethRewards *... | medium |
```\nfunction \_getAaveProvider() internal pure returns (IAaveLendingPoolProvider) {\n return IAaveLendingPoolProvider(0xB53C1a33016B2DC2fF3653530bfF1848a515c8c5);\n}\n```\n | medium |
```\n * WARNING: You should avoid using leaf values that are 64 bytes long prior to\n * hashing, or use a hash function other than keccak256 for hashing leaves.\n * This is because the concatenation of a sorted pair of internal nodes in\n * the merkle tree could be reinterpreted as a leaf value.\n```\n | medium |
```\nfunction \_cacheFundraisingApps(\n Agent \_reserve,\n Presale \_presale,\n MarketMaker \_marketMaker,\n Tap \_tap,\n Controller \_controller,\n TokenManager \_tokenManager\n)\n internal\n returns (FundraisingApps memory fundraisingApps)\n{\n fundraisin... | low |
```\nfunction _withdrawDividendOfUser(address payable user) internal override returns (uint256)\n{\n uint256 _withdrawableDividend = withdrawableDividendOf(user);\n if (_withdrawableDividend > 0) {\n withdrawnDividends[user] = withdrawnDividends[user].add(_withdrawableDividend);\n\n address tokenAdd... | none |
```\n// Get submission keys\nbytes32 nodeSubmissionKey = keccak256(abi.encodePacked("minipool.withdrawable.submitted.node", msg.sender, \_minipoolAddress, \_stakingStartBalance, \_stakingEndBalance));\nbytes32 submissionCountKey = keccak256(abi.encodePacked("minipool.withdrawable.submitted.count", \_minipoolAddress, \_... | medium |
```\n### BunniPrice.sol and BunniSupply.sol : \n function _validateReserves( BunniKey memory key_,BunniLens lens_,uint16 twapMaxDeviationBps_,uint32 twapObservationWindow_) internal view \n {\n uint256 reservesTokenRatio = BunniHelper.getReservesRatio(key_, lens_);\n uint256 twapTokenRatio = Uni... | medium |
```\nfunction getAllDelegationRequests() external returns(uint[] memory) {\n revert("Not implemented");\n}\n\nfunction getDelegationRequestsForValidator(uint validatorId) external returns (uint[] memory) {\n revert("Not implemented");\n}\n```\n | medium |
```\nuint256 \_votingPower = \_voterAssetBalance.mul(\_assetWeight);\n```\n | low |
```\nuint256 totalFunding = (2 * overbalancedValue * fundingRateMultiplier * oracleManager.EPOCH_LENGTH()) / (365.25 days * 10000);\n```\n | medium |
```\nfunction _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private {\n if (!takeFee) removeAllFee();\n _transferStandard(sender, recipient, amount);\n if (!takeFee) restoreAllFee();\n}\n```\n | none |
```\n // if subtracting `b` from `a` would result in a value less than the min int256 value\n // then return the min int256 value\n if (a < 0 && b <= type(int256).min - a) {\n return type(int256).min;\n }\n```\n | medium |
```\nrequire(accumulatedNOTEPerNToken < type(uint128).max); // dev: accumulated NOTE overflow\n```\n | low |
```\n// BBLeverage.sol\n\nfunction buyCollateral(address from, uint256 borrowAmount, uint256 supplyAmount, bytes calldata data) \n external\n optionNotPaused(PauseType.LeverageBuy)\n solvent(from, false)\n notSelf(from) \n returns (uint256 amountOut) \n { \n // rest of code... | medium |
```\nfunction confirmDeposit() public override onlyKeeper {\n require(depositStatus.inProcess, "DEPOSIT\_COMPLETED");\n \_confirmDeposit();\n depositStatus.inProcess = false;\n}\n```\n | low |
```\nfunction setNumTokensSellToAddToLiquidity(uint256 numTokens) external onlyOwner {\n numTokensSellToAddToLiquidity = numTokens;\n}\n```\n | none |
```\nfunction verifyCallResult(\n bool success,\n bytes memory returndata,\n string memory errorMessage\n) internal pure returns (bytes memory) {\n if (success) {\n return returndata;\n } else {\n // Look for revert reason and bubble it up if present\n if (returndata.length > 0) {\n ... | none |
```\nconstructor() {\n address msgSender = _msgSender();\n _owner = msgSender;\n emit OwnershipTransferred(address(0), msgSender);\n}\n```\n | none |
```\nfunction mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\n require(b != 0, errorMessage);\n return a % b;\n}\n```\n | none |
```\nfunction _revokeRole(bytes32 role, address account) private {\n if (hasRole(role, account)) {\n _roles[role].members[account] = false;\n emit RoleRevoked(role, account, _msgSender());\n }\n}\n```\n | none |
```\nfunction recalculateNftPower(uint256 tokenId) public override returns (uint256 newPower) {\n // @audit execution allowed to continue when\n // block.timestamp == powerCalcStartTimestamp\n if (block.timestamp < powerCalcStartTimestamp) {\n return 0;\n }\n // @audit getNftPower() returns 0 when... | high |
```\n function addToTotalRewards(uint256 _basketId) internal onlyBasketOwner(_basketId) {\n if (baskets[_basketId].nrOfAllocatedTokens == 0) return;\n\n\n uint256 vaultNum = baskets[_basketId].vaultNumber;\n uint256 currentRebalancingPeriod = vaults[vaultNum].rebalancingPeriod;\n uint256 lastRebalancingPer... | medium |
```\nuint256 constant AMOUNT\_PER\_SHARE = 1e18;\n```\n | low |
```\nfunction setSellTaxes(uint256 _newSellDevelopment, uint256 _newSellOperations) external onlyOwner {\n SellDevelopment = _newSellDevelopment;\n SellOperations = _newSellOperations;\n sellTaxes = SellDevelopment.add(SellOperations);\n emit SellFeesUpdated(SellDevelopment, SellOperations);\n}\n```\n | none |
```\n if (shares.gt(_maxRedeemAtEpoch(context, accountContext, account))) revert BalancedVaultRedemptionLimitExceeded();\n```\n | medium |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.