function stringlengths 12 7.23k | severity stringclasses 4
values |
|---|---|
```\n/\*\*\n \* @notice Checks that a leaf hash is contained in a root hash\n \* @param leaf Leaf hash to verify\n \* @param index Position of the leaf hash in the Merkle tree\n \* @param rootHash Root of the Merkle tree\n \* @param proof A Merkle proof demonstrating membership of the leaf hash\n \* @return True, if th... | medium |
```\n function deposit(address r, uint256 a) external override returns (uint256) {\n if (block.timestamp > maturity) {\n revert Exception(\n 21,\n block.timestamp,\n maturity,\n address(0),\n address(0)\n );\n ... | medium |
```\nfunction _transferOwnership(address newOwner) internal {\n _owner = newOwner;\n emit OwnershipTransferred(newOwner);\n}\n```\n | none |
```\nfunction gas(uint256 _amountToLeave) internal view {\n uint256 i = 0;\n while (gasleft() > _amountToLeave) {\n ++i;\n }\n}\n```\n | medium |
```\nFile: BalancerSpotPrice.sol\n function _calculateStableMathSpotPrice(\n..SNIP..\n // Apply scale factors\n uint256 secondary = balances[index2] * scalingFactors[index2] / BALANCER_PRECISION;\n\n uint256 invariant = StableMath._calculateInvariant(\n ampParam, StableMath._balances(... | high |
```\n if (entitledShares > queue[index].assets) {\n // skip the rollover for the user if the assets cannot cover the relayer fee instead of revert.\n if (queue[index].assets < relayerFee) {\n index++;\n continue;\n ... | medium |
```\nfunction getRoundData(uint80 _roundId)\n public\n view\n virtual\n override\n returns (\n uint80 roundId,\n int256 answer,\n uint256 startedAt,\n uint256 updatedAt,\n uint80 answeredInRound\n )\n {\n (uint16 phaseId, uint64 aggregatorRoundId) = parseIds(_roundId);\n\n... | medium |
```\n function setProposalThreshold(uint256 newProposalThreshold) external {\n if(msg.sender != multisig) revert NotMultisig();\n if(newProposalThreshold < MIN_PROPOSAL_THRESHOLD || newProposalThreshold > MAX_PROPOSAL_THRESHOLD) revert InvalidVotingParameter();\n uint256 oldProposalThreshold = proposalThresho... | medium |
```\n (uint256 unitFee, , ) = _fees(10**decimals(), settlementFeePercentage);\n amount = (newFee * 10**decimals()) / unitFee;\n```\n | medium |
```\nfunction _claimDeposit(\n address owner,\n address receiver\n)\n internal\n returns (uint256 shares)\n{\n shares = previewClaimDeposit(owner);\n\n uint256 lastRequestId = lastDepositRequestId[owner];\n uint256 assets = epochs[lastRequestId].depositRequestBalance[owner];\n epochs[lastRequest... | high |
```\n uint inputTotalUSDValueE36;\n for (uint i; i < openTokenInfos.length; ) {\n inputTotalUSDValueE36 += openTokenInfos[i].inputAmt * tokenPriceE36s[i];\n borrowTotalUSDValueE36 += openTokenInfos[i].borrowAmt * tokenPriceE36s[i];\n uncheck... | high |
```\nDataStoreUtils.DataStore private DATASTORE;\nGeodeUtils.Universe private GEODE;\nStakeUtils.StakePool private STAKEPOOL;\n```\n | low |
```\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 transferAdmin(address newOwner) public onlyOwner {\n dividendTracker.excludeFromDividends(newOwner);\n _isExcludedFromFees[newOwner] = true;\n transferOwnership(newOwner);\n}\n```\n | none |
```\nfunction deposit(\n address asset,\n uint256 amount\n) external onlyController returns (uint256) {\n if (asset == assetToken) {\n _depositAsset(amount);\n (, uint256 quoteAmount) = _openShort(amount);\n return quoteAmount; // @audit this mint UXD equivalent to the amount of vUSD gaine... | medium |
```\n uint256 constant ISOUSD_TIME_DELAY = 3; // days;\n```\n | medium |
```\nfunction updateSwapTokensAtAmount(uint256 newAmount) external onlyOwner returns (bool){\n require(newAmount >= totalSupply() * 1 / 100000, "Swap amount cannot be lower than 0.001% total supply.");\n require(newAmount <= totalSupply() * 5 / 1000, "Swap amount cannot be higher than 0.5% total supply.");\n s... | none |
```\n\_to.transfer(address(this).balance);\n```\n | medium |
```\nfunction calculateTaxFee(uint256 _amount) private view returns (uint256) {\n return _amount.mul(_taxFee).div(10**2);\n}\n```\n | none |
```\nfunction setDeListingBonus(uint64 delistingBonus) external onlyOwner() {\n ListingUpdate memory update = listingUpdate;\n require(update.tokenToDelist != address(0), "DFP: No active delisting");\n\n DFPconfig.delistingBonus = delistingBonus;\n}\n```\n | none |
```\nfunction setSwapTriggerAmount(uint256 amount) public onlyOwner {\n swapTokensAtAmount = amount * (10**18);\n}\n```\n | none |
```\nfunction trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {\n unchecked {\n if (b > a) return (false, 0);\n return (true, a - b);\n }\n}\n```\n | none |
```\nFile: SFrxETHAdapter.sol\n function claimWithdrawal() external override {\n uint256 _requestId = requestId;\n uint256 _withdrawalQueueEth = withdrawalQueueEth;\n if (_requestId == 0) revert NoPendingWithdrawal();\n\n /// WRITE ///\n delete withdrawalQueueEth;\n delete r... | medium |
```\n// can we reproduce the same hash from the raw claim metadata?\nrequire(hashMatch(user\_id, user\_address, user\_amount, delegate\_address, leaf, eth\_signed\_message\_hash\_hex), 'TokenDistributor: Hash Mismatch.');\n```\n | low |
```\n while (i < withdrawals.length && (i - start) < maxWithdrawalProcesses) {\n Withdrawal memory withdrawal = withdrawals[i];\n if (reserve < withdrawal.amount) {\n break;\n }\n\n (bool success, bytes memory data) = withdrawal.usr.call{value: withdrawal.amount}("");\n ... | medium |
```\n function _revertOnMinDebt(\n LoansState storage loans_,\n uint256 poolDebt_,\n uint256 borrowerDebt_,\n uint256 quoteDust_\n ) view {\n if (borrowerDebt_ != 0) {\n uint256 loansCount = Loans.noOfLoans(loans_);\n if (loansCount >= 10) {\n ... | medium |
```\nfunction \_deposit(uint256 \_amount, address \_tranche) internal returns (uint256 \_minted) {\n // check that we are not depositing more than the contract available limit\n \_guarded(\_amount);\n // set \_lastCallerBlock hash\n \_updateCallerBlock();\n // check if strategyPrice decreased\n \_checkDefault();\... | medium |
```\nfunction checkWhitelist(address _wallet) external view returns (bool) {\n return whitelisted[_wallet];\n}\n```\n | none |
```\n function testswapExactTokensForETHStuckTokens() public {\n address wrappedTokenA = IChilizWrapperFactory(wrapperFactory).wrappedTokenFor(address(tokenA));\n\n tokenA.approve(address(wrapperFactory), type(uint256).max);\n wrapperFactory.wrap(address(this), address(tokenA), 100);\n\n ... | medium |
```\nfunction _functionCallWithValue(\n address target,\n bytes memory data,\n uint256 weiValue,\n string memory errorMessage\n) private returns (bytes memory) {\n require(isContract(target), "Address: call to non-contract");\n\n // solhint-disable-next-line avoid-low-level-calls\n (bool success, b... | none |
```\n uint _claimable = claimable[_gauge];\n if (SATIN_CASH_LP_GAUGE == _gauge) {\n veShare = calculateSatinCashLPVeShare(_claimable);\n _claimable -= veShare;\n }\n if (_claimable > IMultiRewardsPool(_gauge).left(token) && _claimable / DURATION > 0) {\n claimable[_gauge] = ... | high |
```\nfunction startBridge() external onlyRole(BRIDGE_MANAGER) {\n active = true;\n}\n```\n | none |
```\nfunction withdrawStuckTokens(address ERC20_token) external onlyOwner {\n require(ERC20_token != address(this), "Owner cannot claim native tokens");\n\n uint256 tokenBalance = IERC20(ERC20_token).balanceOf(address(this));\n require(tokenBalance > 0, "No tokens available to withdraw");\n\n bool success =... | none |
```\n uint tokenInPrice = _getMinPrice(address(baseAsset));\n uint tokenOutPrice = _getMaxPrice(address(quoteAsset));\n // rest of code\n uint minOut = tokenInPrice\n .multiplyDecimal(marketPricingParams[_optionMarket].minReturnPercent)\n .multiplyDecimal(_amountBase)\n .divideDecim... | medium |
```\nmodifier onlySource(address _originSender, uint32 _origin) {\n require(_originSender == trustedRemoteConnext[_origin] && msg.sender == connext, "Not trusted");\n _;\n}\n```\n | high |
```\nfunction setExcludeFees(address account, bool excluded) public onlyOwner {\n _isExcludedFromFees[account] = excluded;\n emit ExcludeFromFees(account, excluded);\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 |
```\n function SetZauction(address zauctionaddress) external onlyAdmin{\n zauction = zauctionaddress;\n emit ZauctionSet(zauctionaddress);\n }\n\n function SetAdmin(address newadmin) external onlyAdmin{\n admin = newadmin;\n emit AdminSet(msg.sender, newadmin);\n }\n```\n | high |
```\n function trackVaultFee(address vault, uint256 feeAmount) external {\n // Check sender:\n IDVP dvp = IDVP(msg.sender);\n if (vault != dvp.vault()) {\n revert WrongVault();\n }\n\n vaultFeeAmounts[vault] += feeAmount;\n\n emit TransferVaultFee(vault, feeAmount... | 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 |
```\nit('pending deposit pushed by 1 epoch causing shares difference', async () => {\n const smallDeposit = utils.parseEther('1000')\n const smallestDeposit = utils.parseEther('0.000001')\n\n await updateOracleEth() // epoch now stale\n // make a pending deposit\n await vault.connect(user).depo... | high |
```\nfunction setFeeOracle(address _feeOracle) external onlyRole(TOKEN_MANAGER) {\n feeOracle = _feeOracle;\n}\n```\n | none |
```\nfunction transfer(address recipient, uint256 amount)\n external\n override\n returns (bool)\n{\n return _transferFrom(msg.sender, recipient, amount);\n}\n```\n | none |
```\nfunction ownerToggleSalesTax(bool state) external onlyOwner() {\n toggleSalesTax(state);\n emit ToggledSalesTax(state);\n}\n```\n | none |
```\nfunction getExcludedBalances() internal view returns (uint256) {\n uint256 totalExcludedHoldings = 0;\n for (uint i = 0; i < excludedFromRewards.length; i++) {\n totalExcludedHoldings += balanceOf(excludedFromRewards[i]);\n }\n return totalExcludedHoldings;\n}\n```\n | none |
```\nuint256 shares = \_deposit(to, tokenAmount);\n\n// Transfer Token Transfer Message Sender\nIERC20Upgradeable(token).transferFrom(\n msg.sender,\n address(this),\n tokenAmount\n);\n```\n | high |
```\nif (memoryData.shareOwed <= memoryData.shareOut) {\n _repay(from, from, memoryData.partOwed);\n} else {\n //repay as much as we can\n uint256 partOut = totalBorrow.toBase(amountOut, false);\n _repay(from, from, partOut);\n}\n```\n | medium |
```\nfunction borrow(address account, address token, uint amt)\n external\n whenNotPaused\n onlyOwner(account)\n{\n if (registry.LTokenFor(token) == address(0))\n revert Errors.LTokenUnavailable();\n if (!riskEngine.isBorrowAllowed(account, token, amt))\n revert Errors.RiskThresholdBreached... | medium |
```\nfunction release(address beneficiary) public {\n uint256 unreleased = getReleasableAmount(beneficiary);\n require(unreleased > 0, "Nothing to release");\n\n TokenAward storage award = getTokenAwardStorage(beneficiary);\n award.released += unreleased;\n\n targetToken.safeTransfer(beneficiary, unreleased);\n\n ... | low |
```\nif (!instance.transfer(getSendAddress(), forwarderBalance)) {\n revert('Could not gather ERC20');\n}\n```\n | high |
```\nrolloverQueue[index].assets = _assets;\n```\n | high |
```\nfunction numberMarker() internal view {\n assembly {mstore(0, number())}\n}\n```\n | none |
```\nfunction beneficiaryWithdrawable(\n address recipient,\n address sender,\n uint256 agentID,\n uint256 proposedAmount\n) external returns (\n uint256 amount\n) {\n AgentBeneficiary memory beneficiary = \_agentBeneficiaries[agentID];\n address benneficiaryAddress = beneficiary.active.beneficiary;\n // If the sender ... | high |
```\nfor (uint i = 0; i < \_blockheaders.length; i++) {\n (calcParent, calcBlockhash) = getParentAndBlockhash(\_blockheaders[i]);\n if (calcBlockhash != currentBlockhash) {\n return 0x0;\n }\n currentBlockhash = calcParent;\n}\n```\n | medium |
```\nfunction _payout(DrawData memory current) private {\n require(current.winner != address(0), "DCBW721: Address cannot be 0");\n require(current.prizePoolWon > 0, "DCBW721: Prize pool is empty");\n\n /// @notice updating reserve pool & grand prize pool\n if (current.isGrandPrize == 1) {\n _updateG... | none |
```\nfunction add(uint256 a, uint256 b) internal pure returns (uint256) {\n return a + b;\n}\n```\n | none |
```\n uint256 balanceBefore = getVaultBalance() - reservedFunds;\n vaultCurrency.safeTransferFrom(msg.sender, address(this), _amount);\n uint256 balanceAfter = getVaultBalance() - reservedFunds;\n uint256 amount = balanceAfter - balanceBefore;\n```\n | medium |
```\n(obtainedPremium, ) = dvp.premium(params.strike, params.notionalUp, params.notionalDown);\n```\n | medium |
```\nfunction buyCollateralFromAuction(address token, uint amount) override external {\n Auction memory auction = auctions[token];\n // validate auction\n require(_isAuctionOngoing(auction.startedAt, auction.expiryTime), "IF.no_ongoing_auction");\n\n // transfer funds\n uint vusdToTransfer = _calcVusdAmo... | medium |
```\nit('panprog liquidate unsuspecting user / self in 1 transaction', async () => {\n\n function setupOracle(price: string, timestamp : number, nextTimestamp : number) {\n const oracleVersion = {\n price: parse6decimal(price),\n timestamp: timestamp,\n valid: true,\n }\n or... | medium |
```\nFile: SecondaryRewarder.sol\n function _claimRewards(address account, uint256 nTokenBalanceBefore, uint256 nTokenBalanceAfter) private { \n uint256 rewardToClaim = _calculateRewardToClaim(account, nTokenBalanceBefore, accumulatedRewardPerNToken); \n\n // Precision here is:\n // nTokenBalan... | medium |
```\nfunction swapbackValues()\n external\n view\n returns (\n bool _swapbackEnabled,\n uint256 _swapBackValueMin,\n uint256 _swapBackValueMax\n )\n{\n _swapbackEnabled = swapbackEnabled;\n _swapBackValueMin = swapBackValueMin;\n _swapBackValueMax = swapBackValueMax;\n}\n```\n | none |
```\nfunction point\_mul(dst,src,s, mPtr) {\n // let mPtr := add(mload(0x40), state\_last\_mem)\n let state := mload(0x40)\n mstore(mPtr,mload(src))\n mstore(add(mPtr,0x20),mload(add(src,0x20)))\n mstore(add(mPtr,0x40),s)\n let l\_success := staticcall(sub(gas(), 2000),7,mPtr,0x60,dst,0x40)\n mstore(add(state, state\_s... | high |
```\nfunction add(uint256 a, uint256 b) internal pure returns (uint256) {\n return a + b;\n}\n```\n | none |
```\n/// @notice Initializes Keep Vendor contract implementation.\n/// @param registryAddress Keep registry contract linked to this contract.\nfunction initialize(\n address registryAddress\n)\n public\n{\n require(!initialized(), "Contract is already initialized.");\n \_initialized["BondedECDSAKeepVendorIm... | medium |
```\n function getMarketTokenPrice(\n DataStore dataStore,\n Market.Props memory market,\n Price.Props memory indexTokenPrice,\n Price.Props memory longTokenPrice,\n Price.Props memory shortTokenPrice,\n bytes32 pnlFactorType,\n bool maximize\n ) external view retu... | medium |
```\n (\n uint80 _latestRoundId,\n int256 _latestAnswer,\n /* uint256 _startedAt */,\n uint256 _latestTimestamp,\n /* uint80 _answeredInRound */\n ) = AggregatorV3Interface(_feed).latestRoundData();\n```\n | low |
```\nfunction div(uint256 a, uint256 b) internal pure returns (uint256) {\n return div(a, b, "SafeMath: division by zero");\n}\n```\n | none |
```\nfunction updatePixelMintMerkleRoot(bytes32 hash)\n external\n onlyOwner\n returns (bool)\n{\n merkleRootOfPixelMintWhitelistAddresses = hash;\n emit UpdatedMerkleRootOfPixelMint(hash, msg.sender);\n\n return true;\n}\n```\n | none |
```\n function _sendPayout(\n address recipient_,\n uint256 payoutAmount_,\n Routing memory routingParams_,\n bytes memory\n ) internal {\n \n if (fromVeecode(derivativeReference) == bytes7("")) {\n Transfer.transfer(baseToken, recipient_, payoutAmount_, true);... | medium |
```\nfunction init(IWeightedPool \_pool) external {\n require(address(pool) == address(0), "BalancerLBPSwapper: initialized");\n\n pool = \_pool;\n IVault \_vault = \_pool.getVault();\n\n vault = \_vault;\n\n // Check ownership\n require(\_pool.getOwner() == address(this), "BalancerLBPSwapper: contrac... | medium |
```\n function approve(address spender, uint256 amount) public virtual returns (bool) {\n allowance[msg.sender][spender] = amount;\n\n emit Approval(msg.sender, spender, amount);\n\n return true;\n }\n```\n | medium |
```\nif (vAssets.borrowAsset == FTM) {\n require(msg.value >= debtTotal, Errors.VL\_AMOUNT\_ERROR);\n} else {\n```\n | medium |
```\nfunction functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\n return functionStaticCall(target, data, "Address: low-level static call failed");\n}\n```\n | none |
```\n function _revertIfLotConcluded(uint96 lotId_) internal view virtual {\n // Beyond the conclusion time\n if (lotData[lotId_].conclusion < uint48(block.timestamp)) {\n revert Auction_MarketNotActive(lotId_);\n }\n\n // Capacity is sold-out, or cancelled\n if (lotData... | medium |
```\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 |
```\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 ... | medium |
```\nFile: Boosted3TokenAuraVault.sol\n function getEmergencySettlementBPTAmount(uint256 maturity) external view returns (uint256 bptToSettle) {\n Boosted3TokenAuraStrategyContext memory context = _strategyContext();\n bptToSettle = context.baseStrategy._getEmergencySettlementParams({\n matu... | 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 |
```\n// Calculate value of all collaterals\n// collateralValuePerToken = underlyingPrice \* exchangeRate \* collateralFactor\n// collateralValue = balance \* collateralValuePerToken\n// sumCollateral += collateralValue\nuint256 \_len = \_accountData.collaterals.length();\nfor (uint256 i = 0; i < \_len; i++) {\n IiTo... | high |
```\nmodifier onlyWhenUnderlyingsReceived(uint256 _vaultNumber) {\n require(\n vaultStage[_vaultNumber].underlyingReceived == vaultStage[_vaultNumber].activeVaults,\n "Not all underlyings received"\n );\n _;\n}\n```\n | medium |
```\nnpx hardhat test --network hardhat --grep 'usage of Attack contract and receiving NFT'\n```\n | low |
```\n _withdraw(_totalSupply, _totalSupply);\n```\n | high |
```\n(1,400,000 + 2 * 604,800) / 604,800 = 4\n\n4 * 604,800 = 2,419,200\n```\n | medium |
```\nfunction getBNBAmountOut(uint256 amountIn) public view returns (uint256) {\n uint256 beansBefore = liqConst / _balances[address(this)];\n uint256 beansAfter = liqConst / (_balances[address(this)] + amountIn);\n return beansBefore - beansAfter;\n}\n```\n | none |
```\nfunction setGlobalParameter(bytes32 key, uint256 value) public onlyWhitelistAdmin {\n if (key == "withdrawalLockBlockCount") {\n withdrawalLockBlockCount = value;\n } else if (key == "brokerLockBlockCount") {\n brokerLockBlockCount = value;\n } else {\n revert("key not exists");\n ... | high |
```\nfunction requestWithdrawal(uint256 \_tokensToWithdraw) external override {\n WithdrawalStatus \_status = getWithdrawalStatus(msg.sender);\n\n require(\_status == WithdrawalStatus.NONE || \_status == WithdrawalStatus.EXPIRED,\n "PB: Can't request withdrawal");\n\n uint256 \_daiTokensToWithdraw = \_tokensToWit... | high |
```\nbytes32 resultHash = keccak256(abi.encodePacked(groupPubKey, misbehaved));\n```\n | medium |
```\n function test_Audit_createProfile() public {\n // create profile\n bytes32 newProfileId = registry().createProfile(nonce, name, metadata, profile1_owner(), profile1_members());\n Registry.Profile memory profile = registry().getProfileById(newProfileId);\n Anchor _anchor = Anchor(pay... | high |
```\nfunction _depositLPIncentive(\n StoredReward memory reward,\n uint256 amount,\n uint256 periodReceived\n) private {\n IERC20(reward.token).safeTransferFrom(\n msg.sender,\n address(this),\n amount\n );\n\n // @audit stored `amount` here will be incorrect since it doesn't acco... | medium |
```\nuint256 currentThreshold = safe.getThreshold();\nuint256 newThreshold;\nuint256 target = targetThreshold; // save SLOADs\n\nif (validSignerCount <= target && validSignerCount != currentThreshold) {\n newThreshold = validSignerCount;\n} else if (validSignerCount > target && currentThreshold < target) {\n newT... | medium |
```\n uint extraRewardsCount = IAuraRewarder(crvRewarder)\n .extraRewardsLength(); <- @audit-issue rewardTokenCount pulled fresh\n tokens = new address[](extraRewardsCount + 1);\n rewards = new uint256[](extraRewardsCount + 1);\n\n tokens[0] = IAuraRewarder(crvRewarder).rewardToken();\n rewards[0]... | high |
```\nconstructor(\n DAOFactory \_daoFactory,\n ENS \_ens,\n MiniMeTokenFactory \_miniMeFactory,\n IFIFSResolvingRegistrar \_aragonID,\n address \_dai,\n address \_ant\n)\n BaseTemplate(\_daoFactory, \_ens, \_miniMeFactory, \_arag... | low |
```\nfunction _setAutomatedMarketMakerPair(address pair, bool value) private {\n automatedMarketMakerPairs[pair] = value;\n\n if (value) {\n dividendTracker.excludeFromDividends(pair);\n }\n\n emit SetAutomatedMarketMakerPair(pair, value);\n}\n```\n | none |
```\n function _swapFarmEmissionTokens() internal { IERC20Upgradeable boo = IERC20Upgradeable(BOO);\n uint256 booBalance = boo.balanceOf(address(this));\n if (booToUsdcPath.length < 2 || booBalance == 0) {\n return;\n }\n boo.safeIncreaseAllowance(SPOOKY_ROUTER, booBalance);\n ... | medium |
```\nfunction _applyFees(uint256 fee0_, uint256 fee1_) internal {\n uint16 mManagerFeeBPS = managerFeeBPS;\n managerBalance0 += (fee0_ * mManagerFeeBPS) / hundredPercent;\n managerBalance1 += (fee1_ * mManagerFeeBPS) / hundredPercent;\n}\n```\n | medium |
```\nFile: SingleSidedLPVaultBase.sol\n /// @notice Restores withdrawn tokens from emergencyExit back into the vault proportionally.\n /// Unlocks the vault after restoration so that normal functionality is restored.\n /// @param minPoolClaim slippage limit to prevent front running\n function restoreVault(\... | high |
```\n if (depositAssets.gt(_maxDeposit(context)))\n revert VaultDepositLimitExceededError();\n// rest of code\nfunction _maxDeposit(Context memory context) private view returns (UFixed6) {\n if (context.latestCheckpoint.unhealthy()) return UFixed6Lib.ZERO;\n UFixed6 collateral = UFixed6Lib.from(totalAss... | medium |
```\nfunction getPayoutToken() public view returns (address) {\n return defaultToken;\n}\n```\n | none |
```\nfunction testLiquidateSteal() external {\n uint loanTokenAmount = 12000;\n uint borrowAmount = 1000;\n uint collateralAmountA = 10000;\n uint collateralAmountB = 1400;\n MockERC20 collateralToken = new MockERC20(collateralAmountA+collateralAmountB, 18);\n MockERC20 loanTok... | medium |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.