function stringlengths 12 7.23k | severity stringclasses 4
values |
|---|---|
```\naddress owner = ownerOf(_tokenId);\nif (msg.sender != owner && !isApprovedForAll[owner][msg.sender] && msg.sender != getApproved[_tokenId]) revert NotAuthorized();\n```\n | high |
```\nfunction approve(address spender, uint256 amount) public override returns (bool) {\n _approve(_msgSender(), spender, amount);\n return true;\n}\n```\n | none |
```\n function handleOutgoingRESDL(\n address _sender,\n uint256 _lockId,\n address _sdlReceiver\n )\n external\n onlyCCIPController\n onlyLockOwner(_lockId, _sender)\n updateRewards(_sender)\n updateRewards(ccipController)\n returns (Lock memory)\n ... | high |
```\n_manage(context, depositAssets, claimAmount, !depositAssets.isZero() || !redeemShares.isZero());\n```\n | medium |
```\n// solhint-disable-next-line func-name-mixedcase\nfunction \_\_DramAccessControl\_init\_unchained(\n address admin\n) internal onlyInitializing {\n \_grantRole(ADMIN\_ROLE, admin);\n \_grantRole(ROLE\_MANAGER\_ROLE, admin);\n \_grantRole(SUPPLY\_MANAGER\_ROLE, admin);\n}\n```\n | low |
```\nfunction getPrice(address pair) external view returns (uint) {\n (uint r0, uint r1,) = IUniswapV2Pair(pair).getReserves();\n\n // 2 * sqrt(r0 * r1 * p0 * p1) / totalSupply\n return FixedPointMathLib.sqrt(\n r0\n .mulWadDown(r1)\n .mulWadDown(oracle.getPrice(IUniswapV2Pair(pair).token0... | high |
```\nfunction add(uint256 a, uint256 b) internal pure returns (uint256) {\n uint256 c = a + b;\n require(c >= a, "SafeMath: addition overflow");\n\n return c;\n}\n```\n | none |
```\nfunction initialize\_1(\n address \_admin,\n address \_treasury,\n address \_depositContract,\n address \_elDispatcher,\n address \_clDispatcher,\n address \_feeRecipientImplementation,\n uint256 \_globalFee,\n uint256 \_operatorFee,\n uint256 globalCommissionLimitBPS,\n uint256 operatorCommissionLimitBPS\n) exter... | medium |
```\nif(token.allowance(address(this), address(v)) < token.balanceOf(address(this))) {\n token.safeApprove(address(v), 0);\n token.safeApprove(address(v), type(uint256).max);\n}\n```\n | low |
```\nFile: PartyBFacetImpl.sol\n function openPosition(\n uint256 quoteId,\n uint256 filledAmount,\n uint256 openedPrice,\n PairUpnlAndPriceSig memory upnlSig\n ) internal returns (uint256 currentId) {\n..SNIP..\n\n LibQuote.removeFromPendingQuotes(quote);\n\n..SNIP..\n ... | high |
```\nfunction \_addLiquidityFor(address \_liquidityHolderAddr, uint256 \_liquidityAmount, bool \_isLM) internal {\n daiToken.transferFrom(\_liquidityHolderAddr, address(this), \_liquidityAmount); \n \n uint256 \_amountToMint = \_liquidityAmount.mul(PERCENTAGE\_100).div(getDAIToDAIxRatio());\n totalLiquidity = tot... | medium |
```\n // Generate executable to initiate swap on DCACoWAutomation return Types.Executable({\n callType: Types.CallType.DELEGATECALL, target: dcaCoWAutomation,\n value: 0,\n data: abi.encodeCall( DCACoWAutomation.initiateSwap,\n (params.tokenIn, params.tokenOut, swapRecipient, amountIn, minAmountOut,... | low |
```\nenum JoinKind { INIT, EXACT_TOKENS_IN_FOR_BPT_OUT, TOKEN_IN_FOR_EXACT_BPT_OUT }\n```\n | high |
```\nif (\n operators.value[\_operatorIndex].limit < \_limit &&\n StakingContractStorageLib.getLastValidatorEdit() > \_snapshot\n) {\n revert LastEditAfterSnapshot();\n}\n```\n | medium |
```\n// Mint gold cards\nskyweaverAssets.batchMint(\_order.cardRecipient, \_ids, amounts, "");\n```\n | high |
```\nfunction tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {\n unchecked {\n if (b == 0) return (false, 0);\n return (true, a / b);\n }\n}\n```\n | none |
```\nfunction _buildDomainSeparator() private view returns (bytes32) {\n return keccak256(abi.encode(_TYPE_HASH, _hashedName, _hashedVersion, block.chainid, address(this)));\n}\n```\n | none |
```\nfunction beforeRebalanceChecks(\n GMXTypes.Store storage self,\n GMXTypes.RebalanceType rebalanceType\n) external view {\n if (\n self.status != GMXTypes.Status.Open &&\n self.status != GMXTypes.Status.Rebalance_Open\n ) revert Errors.NotAllowedInCurrentVaultStatus();\n\n // Check that rebalance type is... | low |
```\n\_createPermissions(\_acl, grantees, \_fundraisingApps.bondedTokenManager, \_fundraisingApps.bondedTokenManager.MINT\_ROLE(), \_owner);\n\_acl.createPermission(\_fundraisingApps.marketMaker, \_fundraisingApps.bondedTokenManager, \_fundraisingApps.bondedTokenManager.BURN\_ROLE(), \_owner);\n```\n | high |
```\nfunction recoverETH() external onlyOwner() {\n uint256 contractETHBalance = address(this).balance;\n sendETHToFee(contractETHBalance);\n}\n```\n | none |
```\n/\*\*\n \* @dev Routing Function for Flashloan Provider\n \* @param info: struct information for flashLoan\n \* @param \_flashnum: integer identifier of flashloan provider\n \*/\nfunction initiateFlashloan(FlashLoan.Info calldata info, uint8 \_flashnum) external isAuthorized override {\n if (\_flashnum == 0) {\n \... | high |
```\nfunction mint(address to, uint256 _tokenId)\n external\n payable\n whenNotPaused\n requireState(DrawState.Closed)\n{\n uint256 received = msg.value;\n\n require(to != address(0), "DCBW721: Address cannot be 0");\n require(\n received == _mintPrice,\n "DCBW721: Ether sent mismatch... | none |
```\nfunction swapTokensForEth(uint256 tokenAmount) private {\n // generate the uniswap pair path of token -> weth\n address[] memory path = new address[](2);\n path[0] = address(this);\n path[1] = uniswapV2Router.WETH();\n\n _approve(address(this), address(uniswapV2Router), tokenAmount);\n\n // make ... | none |
```\n function rebalanceXChain(uint256 _slippage, uint256 _relayerFee) external payable {\n require(state == State.SendingFundsXChain, stateError);\n\n\n if (amountToSendXChain > getVaultBalance()) pullFunds(amountToSendXChain);\n if (amountToSendXChain > getVaultBalance()) amountToSendXChain = getVaultBalanc... | medium |
```\n function rebalance() override public {\n uint256 ownval = getOwnValuation(); // it low enough to dive into if statement (see line below) \n (uint256 USSDamount, uint256 DAIamount) = getSupplyProportion(); // (3000e6 USSD, 2000e18 DAI)\n if (ownval < 1e6 - threshold) {\n // peg-down recove... | medium |
```\nDATASTORE.subUintForId(poolId, "surplus", spentSurplus);\nself.gETH.burn(address(this), poolId, spentGeth - gEthDonation);\n\nif (self.TELESCOPE.\_isOracleActive()) {\n bytes32 dailyBufferKey = DataStoreUtils.getKey(\n block.timestamp - (block.timestamp % OracleUtils.ORACLE\_PERIOD),\n "burnBuffer"\n );\n DATASTOR... | low |
```\nuint256 fee = \_value.mul(buyFeePct).div(PCT\_BASE);\nuint256 value = \_value.sub(fee);\n\n// collect fee and collateral\nif (fee > 0) {\n \_transfer(\_buyer, beneficiary, \_collateral, fee);\n}\n\_transfer(\_buyer, address(reserve), \_collateral, value);\n```\n | medium |
```\n function _createHat(\n uint256 _id,\n string calldata _details,\n uint32 _maxSupply,\n address _eligibility,\n address _toggle,\n bool _mutable,\n string calldata _imageURI\n ) internal returns (Hat memory hat) {\n hat.details = _details;\n hat.... | medium |
```\ntransaction.data = abi.encodeWithSelector(\n IUniswapV2Router01.swapExactETHForTokens.selector,\n 0,\n path,\n msg.sender,\n type(uint256).max\n);\n```\n | medium |
```\nfunction getValueOfHoldings(address holder) public view returns (uint256) {\n return\n ((_balances[holder] * liquidity) / _balances[address(this)]) *\n getBNBPrice();\n}\n```\n | none |
```\n wAuraPools.getVault(lpToken).exitPool(\n IBalancerPool(lpToken).getPoolId(),\n address(this),\n address(this),\n IBalancerVault.ExitPoolRequest(\n tokens,\n minAmountsOut,\n abi.encode(0... | medium |
```\n function topUp(\n address source,\n uint256[] memory indices\n ) external onlyRole(EXECUTOR_ROLE) {\n for (uint i = 0; i < indices.length; i++) {\n // get staking contract and config\n StakingRewards staking = stakingContracts[i];\n StakingConfig memory ... | high |
```\nfunction addLiquidity(uint256 tokenAmount, uint256 ethAmount) private {\n _approve(address(this), address(uniswapV2Router), tokenAmount);\n\n uniswapV2Router.addLiquidityETH{value: ethAmount}(\n address(this),\n tokenAmount,\n 0, // slippage is unavoidable\n 0, // slippage is unav... | none |
```\nfunction disableTrading() external onlyOwner {\n require(tradingEnabled, "Trading is already disabled");\n tradingEnabled = false;\n}\n```\n | none |
```\ndebt_amount: uint256 = self._debt(_position_uid)\n margin_debt_ratio: uint256 = position.margin_amount * PRECISION / debt_amount\n\n\n amount_out_received: uint256 = self._swap(\n position.position_token, position.debt_token, _reduce_by_amount, min_amount_out\n )\n\n\n # reduce margin and debt, ... | high |
```\nfunction transferEther(address payable to, uint256 amount) public {\n to.transfer(amount);\n\n emit TransferredEther(to, amount);\n}\n```\n | low |
```\n function findMarketFor(\n address payout_,\n address quote_,\n uint256 amountIn_,\n uint256 minAmountOut_,\n uint256 maxExpiry_\n ) external view returns (uint256) {\n// rest of code\n if (expiry <= maxExpiry_) {\n payouts[i] = minAmountOut_ <= ma... | medium |
```\nfunction getTokenVotingPower(uint _tokenId) public override view returns (uint) {\n if (ownerOf(_tokenId) == address(0)) revert NonExistentToken();\n\n // If tokenId < 10000, it's a FrankenPunk, so 100/100 = a multiplier of 1\n uint multiplier = _tokenId < 10_000 ? PERCENT : monsterMultiplier;\n ... | medium |
```\nfunction \_updateL1L2MessageStatusToReceived(bytes32[] memory \_messageHashes) internal {\n uint256 messageHashArrayLength = \_messageHashes.length;\n\n for (uint256 i; i < messageHashArrayLength; ) {\n bytes32 messageHash = \_messageHashes[i];\n uint256 existingStatus = outboxL1L2MessageStatus[messageHash];\n\n i... | low |
```\n// Validate either on the first fill or if the signature type requires\n// regular validation.\naddress makerAddress = order.makerAddress;\nif (orderInfo.orderTakerAssetFilledAmount == 0 ||\n \_doesSignatureRequireRegularValidation(\n orderInfo.orderHash,\n makerAddress,\n signature\n )\... | high |
```\nassembly ("memory-safe") {\n // // rest of code\n liabilities0 := div(liabilities0, strain) // @audit rounds down to 0 <-\n liabilities1 := div(liabilities1, strain) // @audit rounds down to 0 <-\n // // rest of code\n}\n```\n | medium |
```\n //@audit -- this report raises an issue regarding the priceDeviation variable only, as the invalidFetchData (2-hour stale check) was flagged as a known issue\n function baseOracleCircuitBreaker(\n uint256 protocolPrice,\n uint80 roundId,\n int256 chainlinkPrice,\n uint256 timeSta... | low |
```\n while (_quantity > 0) {\n Receipt memory deposit = deposits[i];\n if (deposit.amount == 0) {\n i++;\n continue;\n }\n if (deposit.amount <= _quantity) {\n // deposit amount is lesser than quantity use it fully\n _quantity = _quantity - dep... | high |
```\n function _claimEpochRewards(uint48 epoch_) internal returns (uint256) {\n// rest of code\n uint256 rewards = ((rewardsPerTokenEnd - userRewardsClaimed) * stakeBalance[msg.sender]) /\n 10 ** stakedTokenDecimals;\n // Mint the option token on the teller\n // This transfers the rewar... | medium |
```\nfunction getAccountDividendsInfoAtIndex(uint256 index) external view returns (address, int256, int256,\n uint256, uint256, uint256) {\n return dividendTracker.getAccountAtIndex(index);\n}\n```\n | none |
```\nfunction _transferToExcluded(\n address sender,\n address recipient,\n uint256 tAmount\n) private {\n (\n uint256 tTransferAmount,\n uint256 tFee,\n uint256 tLiquidity,\n uint256 tWallet,\n uint256 tDonation\n ) = _getTValues(tAmount);\n (uint256 rAmount, uint25... | none |
```\nfunction average(uint256 a, uint256 b) internal pure returns (uint256) {\n // (a + b) / 2 can overflow.\n return (a & b) + (a ^ b) / 2;\n}\n```\n | none |
```\nfunction withdrawPayment() external returns (bool) {\n if (msg.sender != defaultPlatformAddress) revert UnAuthorizedRequest();\n\n uint256 contractBalance = address(this).balance;\n\n if (contractBalance == 0) revert UnAuthorizedRequest();\n\n (bool sent, ) = defaultPlatformAddress.call{value: contract... | none |
```\nfunction _withdrawERC20(address account, ERC20 token)\n internal\n returns (uint256 withdrawn)\n{\n // leave balance of 1 for gas efficiency\n // underflow if erc20Balance is 0\n withdrawn = erc20Balances[token][account] - 1;\n erc20Balances[token][account] = 1;\n token.safeTransfer(account, withdrawn);\n}\... | none |
```\n /**\n * @dev Hook override to forbid transfers except from whitelisted \n addresses and minting\n */\n function _beforeTokenTransfer(address from, address to, uint256 \n /*amount*/) internal view override {\n require(from == address(0) || _transferWhitelist... | low |
```\n /// @notice Roll into the next Series if there isn't an active series and the cooldown period has elapsed.\n function roll() external {\n if (maturity != MATURITY_NOT_SET) revert RollWindowNotOpen();\n\n if (lastSettle == 0) {\n // If this is the first roll, lock some shares in by minting the... | medium |
```\nFile: LibQuote.sol\n function closeQuote(Quote storage quote, uint256 filledAmount, uint256 closedPrice) internal {\n QuoteStorage.Layout storage quoteLayout = QuoteStorage.layout();\n AccountStorage.Layout storage accountLayout = AccountStorage.layout();\n\n quote.modifyTimestamp = block.t... | medium |
```\n function _addLiquidity(\n address token,\n uint256 tokenDesired,\n uint256 wethDesired,\n uint256 tokenMin,\n uint256 wethMin,\n GoatTypes.InitParams memory initParams\n ) internal returns (uint256, uint256, bool) {\n GoatTypes.LocalVariables_AddLiquidity mem... | medium |
```\n (s.share, left) = _claim(s);\n require(left > 0, "TokenSale: Nothing to claim");\n uint256 refundTaxAmount;\n if (s.taxAmount > 0) {\n uint256 tax = userTaxRate(s.amount, msg.sender);\n uint256 taxFreeAllc = _maxTaxfreeAllocation(msg.sender) * PCT_BASE;\n ... | high |
```\nit('exchange rate manipulation', async () => {\n const smallDeposit = utils.parseEther('1')\n const smallestDeposit = utils.parseEther('0.000000000000000001')\n\n // make a deposit with the attacker. Deposit 1 Wei to mint 1 Wei of shares\n await vault.connect(user).deposit(smallestDeposit, user... | medium |
```\nfunction sub(\n uint256 a,\n uint256 b,\n string memory errorMessage\n) internal pure returns (uint256) {\n unchecked {\n require(b <= a, errorMessage);\n return a - b;\n }\n}\n```\n | none |
```\nfunction _createActionInfo() internal view returns(ActionInfo memory) {\n ActionInfo memory rebalanceInfo;\n\n // Calculate prices from chainlink. Chainlink returns prices with 8 decimal places, but we need 36 - underlyingDecimals decimal places.\n // This is so that when the underlying amount... | medium |
```\n function _cancelOrderAccounting(OrderRequest calldata orderRequest, bytes32 orderId, OrderState memory orderState)\n internal\n virtual\n override\n {\n // rest of code\n\n uint256 refund = orderState.remainingOrder + feeState.remainingPercentageFees;\n\n // rest of... | medium |
```\nuint32 timeElapsed = blockTimestamp - blockTimestampLast; // overflow is desired\nif (timeElapsed > 0 && _reserve0 != 0 && _reserve1 != 0) {\n // * never overflows, and + overflow is desired\n price0CumulativeLast += uint256(UQ112x112.encode(_reserve1).uqdiv(_reserve0)) * timeElapsed;\n price1CumulativeLa... | medium |
```\nFile: BondBaseSDA.sol\n function marketPrice(uint256 id_) public view override returns (uint256) {\n uint256 price = currentControlVariable(id_).mulDivUp(currentDebt(id_), markets[id_].scale);\n\n return (price > markets[id_].minPrice) ? price : markets[id_].minPrice;\n }\n```\n | medium |
```\n(uint80 roundID, int256 price,, uint256 updatedAt, uint80 answeredInRound) = priceFeed.latestRoundData();\nrequire(price > 0, "Chainlink: Incorrect Price");\nrequire(block.timestamp - updatedAt < priceSources[token].heartBeat, "Chainlink: Stale Price");\nrequire(answeredInRound >= roundID, "Chainlink: Stale Price"... | medium |
```\nl2Outputs.push(\n Types.OutputProposal({\n outputRoot: _outputRoot,\n timestamp: uint128(block.timestamp),\n l2BlockNumber: uint128(_l2BlockNumber)\n })\n );\n```\n | medium |
```\n// File: test/foundry/strategies/RFPSimpleStrategy.t.sol:RFPSimpleStrategyTest\n// $ forge test --match-test "test_registrationIsBlockedWhenThePoolIsCreatedWithUseRegistryIsTrue" -vvv\n//\n function test_registrationIsBlockedWhenThePoolIsCreatedWithUseRegistryIsTrue() public {\n // The registerRecipient(... | medium |
```\nadjustmentSize * (secondPrice - firstPrice) - (adjustmentSize * tradeFees * 2)\n```\n | medium |
```\nfor (uint256 i; i < _ownerCount - 1;) {\n ownerToCheck = _owners[i];\n\n if (!isValidSigner(ownerToCheck)) {\n // prep the swap\n data = abi.encodeWithSignature(\n "swapOwner(address,address,address)",\n // rest of code\n```\n | medium |
```\nfunction emergencyShutdown() external onlyRole("emergency_shutdown") {\n active = false;\n\n // If necessary, defund sDAI.\n uint256 sdaiBalance = sdai.balanceOf(address(this));\n if (sdaiBalance != 0) defund(sdai, sdaiBalance);\n\n // If necessary, defund DAI.\n uint256 daiBalance = dai.balanceO... | medium |
```\nif (\_isPurchased[delegationId]) {\n address holder = delegation.holder;\n \_totalDelegated[holder] += delegation.amount;\n if (\_totalDelegated[holder] >= \_purchased[holder]) {\n purchasedToUnlocked(holder);\n }\n}\n```\n | high |
```\n function findOrderHintId(\n mapping(address => mapping(uint16 => STypes.Order)) storage orders,\n address asset,\n MTypes.OrderHint[] memory orderHintArray\n ) internal returns (uint16 hintId) {\n\n // more code\n\n // @audit if a reused order's prevOrderType is matche... | medium |
```\nfunction addLiquidity(\n LiquidityParams calldata lp,\n uint deadline\n) external override ensure(deadline) returns (uint256 amountBase) {\n if (IDAOfiV1Factory(factory).getPair(\n lp.tokenBase,\n lp.tokenQuote,\n lp.slopeNumerator,\n lp.n,\n lp.fee\n ) == address(0))... | high |
```\nFile: MarketUtils.sol\n\n cache.fundingUsd = (cache.sizeOfLargerSide / Precision.FLOAT_PRECISION) * cache.durationInSeconds * cache.fundingFactorPerSecond;\n\n if (result.longsPayShorts) {\n cache.fundingUsdForLongCollateral = cache.fundingUsd * cache.oi.longOpenInterestWithLongCollateral / cache.oi.lo... | medium |
```\nfunction _validateAccountPrepayment(uint256 opIndex, UserOperation calldata op, UserOpInfo memory opInfo, uint256 requiredPrefund)\ninternal returns (uint256 gasUsedByValidateAccountPrepayment, uint256 validationData) {\nunchecked {\n uint256 preGas = gasleft();\n MemoryUserOp memory mUserOp = opInfo.mUserOp... | none |
```\nFile: StableModule.sol\n function executeDeposit(\n address _account,\n uint64 _executableAtTime,\n FlatcoinStructs.AnnouncedStableDeposit calldata _announcedDeposit\n ) external whenNotPaused onlyAuthorizedModule returns (uint256 _liquidityMinted) {\n uint256 depositAmount = _ann... | 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 |
```\n function emergencyClose(GMXTypes.Store storage self, uint256 deadline) external {\n // Revert if the status is Paused.\n GMXChecks.beforeEmergencyCloseChecks(self);\n\n // Repay all borrowed assets; 1e18 == 100% shareRatio to repay\n GMXTypes.RepayParams memory _rp;\n (_rp.rep... | medium |
```\nreturn (amount_ * stethPerWsteth * stethUsd * decimalAdjustment) / (ohmEth * ethUsd * 1e18);\n```\n | medium |
```\nfunction setBuyFee(\n uint16 tax,\n uint16 liquidity,\n uint16 marketing,\n uint16 dev,\n uint16 donation\n) external onlyOwner {\n buyFee.tax = tax;\n buyFee.marketing = marketing;\n buyFee.liquidity = liquidity;\n buyFee.dev = dev;\n buyFee.donation = donation;\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\n return c;\n}\n```\n | none |
```\nfunction remove(UniqueAddressQueue storage baseQueue, address addrToRemove) internal returns (bool) {\n if (!contains(baseQueue, addrToRemove)) {\n return false;\n }\n\n if (baseQueue.HEAD == addrToRemove) {\n return removeFirst(baseQueue);\n }\n\n if (baseQueue.TAIL == addrToRemove) {... | high |
```\n params.minPrimary = poolContext._getTimeWeightedPrimaryBalance(\n oracleContext, strategyContext, bptToSettle\n );\n\n params.minPrimary = params.minPrimary * strategyContext.vaultSettings.balancerPoolSlippageLimitPercent / \n uint256(BalancerConstants.VAULT_PERCENT_BASIS);\n```\n | high |
```\ncontract LybraWstETHVault is LybraPeUSDVaultBase {\n Ilido immutable lido;\n //WstETH = 0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0;\n //Lido = 0xae7ab96520DE3A18E5e111B5EaAb095312D7fE84;\n constructor(address \_lido, address \_asset, address \_oracle, address \_config) LybraPeUSDVaultBase(\_asset, \_oracle, \_conf... | high |
```\nfunction distributeERC20(\n address split,\n ERC20 token,\n address[] calldata accounts,\n uint32[] calldata percentAllocations,\n uint32 distributorFee,\n address distributorAddress\n) external override validSplit(accounts, percentAllocations, distributorFee) {\n // use internal fn instead of modifier to a... | none |
```\nresult := mload(memPtr)\n```\n | high |
```\n/// @notice Closes keep when owner decides that they no longer need it.\n/// Releases bonds to the keep members. Keep can be closed only when\n/// there is no signing in progress or requested signing process has timed out.\n/// @dev The function can be called by the owner of the keep and only is the\n/// keep has ... | medium |
```\nFile: TellorOracle.sol\n function getPriceInEth(address tokenToPrice) external returns (uint256) {\n TellorInfo memory tellorInfo = _getQueryInfo(tokenToPrice);\n uint256 timestamp = block.timestamp;\n // Giving time for Tellor network to dispute price\n (bytes memory value, uint256 ... | medium |
```\n/\*\*\n \* @dev locked status, only applicable before unlock\_date\n \*/\nbool public \_is\_locked = true;\n\n/\*\*\n \* @dev Modifier that only allows function to run if either token is unlocked or time has expired.\n \* Throws if called while token is locked.\n \*/\nmodifier onlyUnlocked() {\n require(!\_is\_... | low |
```\nfunction sub(uint256 a, uint256 b) internal pure returns (uint256) {\n return sub(a, b, "SafeMath: subtraction overflow");\n}\n```\n | none |
```\nif addr == dump.MessagePasserAddress {\n statedumper.WriteMessage(caller.Address(), input)\n}\n```\n | medium |
```\n function _sqrtPriceX96ToUint(uint160 sqrtPriceX96) private pure returns (uint256)\n {\n uint256 numerator1 = uint256(sqrtPriceX96) * \n uint256(sqrtPriceX96);\n return FullMath.mulDiv(numerator1, 1, 1 << 192);\n }\n```\n | medium |
```\nfunction mul(uint256 a, uint256 b) internal pure returns (uint256) {\n if (a == 0) {\n return 0;\n }\n uint256 c = a * b;\n require(c / a == b, "SafeMath: multiplication overflow");\n return c;\n}\n```\n | none |
```\nFeeData.sol\n function setFeeValue(uint256 feeValue) external onlyOwner {\n require(feeValue < _feeDenominator, "Fee percentage must be less than 1");\n _feeValue = feeValue;\n }\n\n function setFixedFee(uint256 fixedFee) external onlyOwner {//@audit-issue validate min/max\n _fixedFee... | medium |
```\nfunction manualBurnLiquidityPairTokens(uint256 percent) external onlyOwner returns (bool){\n require(block.timestamp > lastManualLpBurnTime + manualBurnFrequency , "Must wait for cooldown to finish");\n require(percent <= 1000, "May not nuke more than 10% of tokens in LP");\n lastManualLpBurnTime = block.... | none |
```\nfunction name() public pure returns (string memory) {\n return _name;\n}\n```\n | none |
```\nfunction createSender(bytes calldata initCode) external returns (address sender) {\n address factory = address(bytes20(initCode[0 : 20]));\n bytes memory initCallData = initCode[20 :];\n bool success;\n /* solhint-disable no-inline-assembly */\n assembly {\n success := call(gas(), factory, 0,... | none |
```\nfunction _executeTrade(\n address target,\n uint256 msgValue,\n bytes memory params,\n address spender,\n Trade memory trade\n) private {\n uint256 preTradeBalance;\n\n if (trade.sellToken == address(Deployments.WETH) && spender == Deployments.ETH_ADDRESS) {\n preTradeBalance = address(... | high |
```\nfunction isReinvest(address account) external view returns (bool) {\n return dividendTracker.isReinvest(account);\n}\n```\n | none |
```\n function mintFee() public {\n _mint(_store.treasury, GMXReader.pendingFee(_store));\n _store.lastFeeCollected = block.timestamp;\n }\n```\n | high |
```\nfunction setTaxFeePercent(uint256 taxFee) external onlyOwner() {\n require(taxFee <= _maxTaxFee, "Tax fee must be less than or equal to _maxTaxFee");\n _taxFee = taxFee;\n emit TaxFeeUpdated(taxFee);\n}\n```\n | none |
```\nfunction init(address accountantaddress) external {\n require(!initialized);\n initialized = true;\n accountant = zAuctionAccountant(accountantaddress);\n}\n```\n | medium |
```\nFile: GMXWithdraw.sol#processWithdraw\nself.vault.burn(self.withdrawCache.user, self.withdrawCache.withdrawParams.shareAmt);\n```\n | high |
```\nfunction setAllowAutoReinvest(bool allow) external onlyOwner {\n require(allowAutoReinvest != allow);\n allowAutoReinvest = allow;\n emit SetAllowAutoReinvest(allow);\n}\n```\n | none |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.