function stringlengths 12 7.23k | severity stringclasses 4
values |
|---|---|
```\nif (PublicVault(owner).timeToEpochEnd() <= COLLATERAL_TOKEN.auctionWindow())\n```\n | high |
```\nfunction getSavedOrSpotOraclePrice(address asset) internal view returns (uint256) {\n if (LibOrders.getOffsetTime() - getTime(asset) < 15 minutes) {\n return getPrice(asset);\n } else {\n return getOraclePrice(asset);\n }\n}\n```\n | medium |
```\nfunction min(uint256 a, uint256 b) internal pure returns (uint256) {\n return a < b ? a : b;\n}\n```\n | none |
```\nfunction enableTrading() external onlyOwner {\n require(!tradingActive, "Token launched");\n tradingActive = true;\n launchBlock = block.number;\n swapEnabled = true;\n}\n```\n | none |
```\n function getReservedUsd(\n DataStore dataStore,\n Market.Props memory market,\n MarketPrices memory prices,\n bool isLong\n ) internal view returns (uint256) {\n uint256 reservedUsd;\n if (isLong) {\n // for longs calculate the reserved USD based on the o... | medium |
```\n function setFlagger(\n STypes.ShortRecord storage short,\n address cusd,\n uint16 flaggerHint\n ) internal {\n\n if (flagStorage.g_flaggerId == 0) {\n address flaggerToReplace = s.flagMapping[flaggerHint];\n\n // @audit if timeDiff > firstLiquidationTime,... | high |
```\nconstructor(string memory name_, string memory symbol_) {\n _name = name_;\n _symbol = symbol_;\n}\n```\n | none |
```\nconstructor() {\n _paused = false;\n}\n```\n | none |
```\nconstructor() Auth(msg.sender) {\n weth = IUniswapV2Router02(router).WETH();\n fee = ecosystemFee + marketingFee + treasuryFee;\n\n isFeeExempt[msg.sender] = true;\n\n balanceOf[msg.sender] = totalSupply;\n emit Transfer(address(0), msg.sender, totalSupply);\n}\n```\n | none |
```\nfunction max(int256 a, int256 b) internal pure returns (int256) {\n return a > b ? a : b;\n}\n```\n | none |
```\nfunction _mintGenesisNFT() internal {\n _tokenIds++;\n\n emit GenesisNFTMinted(_tokenIds, msg.sender);\n\n _mint(msg.sender, _tokenIds, 1, "");\n}\n```\n | none |
```\nbool notUndelegated = block.number <= operator.undelegatedAt || operator.undelegatedAt == 0;\n\nif (isAuthorized && isActive && notUndelegated) {\n balance = operator.amount;\n}\n```\n | low |
```\n function takeOverPool(GoatTypes.InitParams memory initParams) external {\n if (_vestingUntil != _MAX_UINT32) {\n revert GoatErrors.ActionNotAllowed();\n }\n\n GoatTypes.InitialLPInfo memory initialLpInfo = _initialLPInfo;\n\n GoatTypes.LocalVariables_TakeOverPool memory l... | medium |
```\nIs the admin/owner of the protocol/contracts TRUSTED or RESTRICTED?\n\nRestricted. The governor address should not be able to steal funds or prevent users from withdrawing. It does have access to the govern methods in Factory, and it could trigger liquidations by increasing nSigma. We consider this an acceptable r... | medium |
```\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 transfer(address recipient, uint256 amount)\n public\n override\n returns (bool)\n{\n _transfer(_msgSender(), recipient, amount);\n return true;\n}\n```\n | none |
```\nfunction toUint256Safe(int256 a) internal pure returns (uint256) {\n require(a >= 0);\n return uint256(a);\n}\n```\n | none |
```\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 updateRewardsMultiplier() external {\n if (!_multiplier[msg.sender]) {\n _multiplier[msg.sender] = true;\n }\n dividendTracker.setBalance(msg.sender, getMultiplier(msg.sender));\n}\n```\n | none |
```\nmodifier onlyLatestRocketNetworkContract() {\n // The owner and other contracts are only allowed to set the storage upon deployment to register the initial contracts/settings, afterwards their direct access is disabled\n if (boolStorage[keccak256(abi.encodePacked("contract.storage.initialised"))] == true) {\... | high |
```\nfunction createAgent(uint256 agentId, address owner, string calldata metadata, uint256[] calldata chainIds)\npublic\n onlySorted(chainIds)\n frontrunProtected(keccak256(abi.encodePacked(agentId, owner, metadata, chainIds)), frontRunningDelay)\n{\n \_mint(owner, agentId);\n \_beforeAgentUpdate(agentId, ... | 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 |
```\nNFTTypes nftType;\n// CryptoPunks NFTs\nif (collateral_ == 0xb47e3cd837dDF8e4c57F05d70Ab865de6e193BBB ) {\n nftType = NFTTypes.CRYPTOPUNKS;\n}\n// CryptoKitties and CryptoFighters NFTs\nelse if (collateral_ == 0x06012c8cf97BEaD5deAe237070F9587f8E7A266d || collateral_ == 0x87d598064c736dd0C712D329aFCFAA0Ccc1921A1)... | medium |
```\ncontract ZeroDAOToken is\n OwnableUpgradeable,\n ERC20Upgradeable,\n ERC20PausableUpgradeable,\n ERC20SnapshotUpgradeable\n{\n```\n | high |
```\nfunction safeTransferFrom(\n IERC20 token,\n address from,\n address to,\n uint256 value\n) internal {\n _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));\n}\n```\n | none |
```\n if (inversed && balance < amountDesired) {\n // collat = 0\n uint256 transferAmount = amountDesired - balance;\n uint256 parentPoolBalance = \n ILiquidityPool(parentLiquidityPool).getBalance(address(token0));\n if (parentPoolBalance < transferAmount) { revert \... | 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 |
```\nconstructor() {\n _setOwner(_msgSender());\n}\n```\n | none |
```\n function _sendFunds(address token, address to, uint256 amount) internal {\n if (token == ETHEREUM_ADDRESS) {\n (bool success, ) = to.call{value: amount}("");\n require(success, "TSP: failed to transfer ether");\n } else {\n IERC20(token).safeTransferFrom(msg.sende... | high |
```\n require(s.ss[token].milestoneSeason == 0, "Whitelist: Token already whitelisted");\n```\n | medium |
```\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] = dexRouter.WETH();\n\n _approve(address(this), address(dexRouter), tokenAmount);\n\n // make the swap\n ... | none |
```\n uint256 unhedgedGlp = (state.unhedgedGlpInUsdc + dnUsdcDepositedPos).mulDivDown(\n PRICE_PRECISION,\n _getGlpPrice(state, !maximize)\n );\n\n // calculate current borrow amounts\n (uint256 currentBtc, uint256 currentEth) = _getCurrentBorrows(state);\n uint256 totalCurrentBorrowValue =... | medium |
```\nfunction functionCall(\n address target,\n bytes memory data,\n string memory errorMessage\n) internal returns (bytes memory) {\n return functionCallWithValue(target, data, 0, errorMessage);\n}\n```\n | none |
```\nuint256 publicInput = uint256(\n keccak256(\n abi.encode(\n shnarf,\n \_finalizationData.parentStateRootHash,\n \_finalizationData.lastFinalizedTimestamp,\n \_finalizationData.finalBlockNumber,\n \_finalizationData.finalTimestamp,\n \_finalizationData.l1RollingHash,\n \_finalizationData.l1RollingHashMessageNumber,... | high |
```\nfunction autoBurnLiquidityPairTokens() internal returns (bool){\n\n lastLpBurnTime = block.timestamp;\n\n uint256 liquidityPairBalance = this.balanceOf(uniswapV2Pair);\n\n uint256 amountToBurn = liquidityPairBalance.mul(percentForLPBurn).div(10000);\n\n if (amountToBurn > 0){\n super._transfer(u... | none |
```\n// Sanity check that refund balance is zero\nrequire(nodeRefundBalance == 0, "Refund balance not zero");\n```\n | medium |
```\nfunction increment(Counter storage counter) internal {\n unchecked {\n counter._value += 1;\n }\n}\n```\n | none |
```\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 |
```\nfunction approve(address spender, uint256 amount)\n public\n override\n returns (bool)\n{\n _approve(_msgSender(), spender, amount);\n return true;\n}\n```\n | none |
```\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 |
```\n/// @notice Change the Operator fee\n/// @param \_operatorFee Fee in Basis Point\nfunction setOperatorFee(uint256 \_operatorFee) external onlyAdmin {\n if (\_operatorFee > StakingContractStorageLib.getOperatorCommissionLimit()) {\n revert InvalidFee();\n }\n StakingContractStorageLib.setOperatorFee(\_operatorFee);... | medium |
```\nfunction _transfer(address, address, uint256) internal pure override {\n require(false, "No transfers allowed");\n}\n```\n | none |
```\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 setMaxSupplies(uint256[] calldata \_ids, uint256[] calldata \_newMaxSupplies) external onlyOwner() {\n require(\_ids.length == \_newMaxSupplies.length, "SWSupplyManager#setMaxSupply: INVALID\_ARRAYS\_LENGTH");\n\n // Can only \*decrease\* a max supply\n // Can't set max supply back to 0\n for (uint256... | medium |
```\n function getCoinLength() public view returns (uint256 length) { //@audit-info coin vs token\n return tokens.length;\n }\n```\n | low |
```\nfunction staticcall(\n address to,\n bytes memory data,\n uint256 txGas\n) internal view returns (bool success) {\n assembly {\n success := staticcall(txGas, to, add(data, 0x20), mload(data), 0, 0)\n }\n}\n```\n | none |
```\nfunction _transferFromExcluded(address sender, address recipient, uint256 tAmount) private {\n (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tLiquidity) = _getValues(tAmount);\n _tOwned[sender] = _tOwned[sender] - tAmount;\n _rOwned[sender] = _rOwn... | none |
```\naddress underlying = getUnderlyingAddress(_vaultNumber, _chain);\nuint256 balance = IERC20(underlying).balanceOf(address(this));\n```\n | medium |
```\nrequire(\n msg.sender == address(_getPool(tokenIn, tokenOut, fee)),\n 'Router: invalid callback sender'\n);\n```\n | medium |
```\n/\*\*\n \* @dev returns true if the converter is active, false otherwise\n \*\n \* @return true if the converter is active, false otherwise\n\*/\nfunction isActive() public view virtual override returns (bool) {\n return anchor.owner() == address(this);\n}\n```\n | medium |
```\nconstructor(string memory name_, string memory symbol_) {\n _name = name_;\n _symbol = symbol_;\n}\n```\n | none |
```\nfunction setBots(address[] memory bots_) public onlyOwner {\n for (uint i = 0; i < bots_.length; i++) {\n bots[bots_[i]] = true;\n }\n}\n```\n | none |
```\n// local\nLocal memory local = registration.market.locals(address(this));\ncontext.latestIds.update(marketId, local.latestId);\ncontext.currentIds.update(marketId, local.currentId);\ncontext.collaterals[marketId] = local.collateral;\n```\n | medium |
```\nrequire(\_isOperator(msg.sender, \_from), EC\_58\_INVALID\_OPERATOR);\n```\n | medium |
```\nfunction test_fulfillRandomWords_revert() public {\n _startGameAndDrawOneRound();\n\n _drawXRounds(48);\n \n uint256 counter = 0;\n uint256[] memory wa = new uint256[](30);\n uint256 totalCost = 0;\n\n for (uint256 j=2; j <= 6; j++) \n {\n (uint256... | medium |
```\nFile: UniV2Adapter.sol\n function getExecutionData(address from, Trade calldata trade)\n..SNIP..\n executionCallData = abi.encodeWithSelector(\n IUniV2Router2.swapExactTokensForTokens.selector,\n trade.amount,\n trade.limit,\n data.path,\n ... | high |
```\n// SPDX-License-Identifier: MIT\npragma solidity 0.8.0;\n\nstruct WithdrawalTransaction {\n uint256 nonce;\n address sender;\n address target;\n uint256 value;\n uint256 gasLimit;\n bytes data;\n}\n\ninterface IOptimismPortal {\n function finalizeWithdrawalTransaction(WithdrawalTransaction memory _tx... | high |
```\nfallback () external [payable];\nfallback (bytes calldata _input) external [payable] returns (bytes memory _output);\n```\n | medium |
```\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 |
```\nfunction mint(address to, uint256 amount) public onlyRole(MINTER\_ROLE) {\n \_mint(to, amount);\n}\n```\n | high |
```\nuint256 totalShare = rocketMinipoolManager.getMinipoolWithdrawalTotalBalance(msg.sender);\nuint256 nodeShare = rocketMinipoolManager.getMinipoolWithdrawalNodeBalance(msg.sender);\nuint256 userShare = totalShare.sub(nodeShare);\n// Get withdrawal amounts based on shares\nuint256 nodeAmount = 0;\nuint256 userAmount ... | low |
```\nfunction updateBuyFees(\n uint256 _liquidityFee,\n uint256 _developmentFee,\n uint256 _marketingFee\n) external onlyOwner {\n buyLiquidityFee = _liquidityFee;\n buyDevelopmentFee = _developmentFee;\n buyMarketingFee = _marketingFee;\n buyTotalFees = buyLiquidityFee + buyDevelopmentFee + buy... | none |
```\n function checkAfterExecution(bytes32, bool) external override {\n if (abi.decode(StorageAccessible(address(safe)).getStorageAt(uint256(GUARD_STORAGE_SLOT), 1), (address))\n != address(this)) \n {\n revert CannotDisableThisGuard(address(this));... | medium |
```\nfunction swapAndLiquify(uint256 tokens) private {\n uint256 half = tokens.div(2);\n uint256 otherHalf = tokens.sub(half);\n uint256 initialBalance = address(this).balance;\n swapTokensForEth(half); // <- this breaks the ETH -> HATE swap when swap+liquify is triggered\n uint256 newBalance = address(t... | none |
```\nfunction mint(uint256 pid, uint256 amount)\n external\n nonReentrant\n returns (uint256)\n{\n address lpToken = ichiFarm.lpToken(pid);\n IERC20Upgradeable(lpToken).safeTransferFrom(\n msg.sender,\n address(this),\n amount\n );\n if (\n IERC20Upgradeable(lpToken).all... | high |
```\nFile: GMXVaul.sol\n /**\n * @notice Repays all debt owed by vault and shut down vault, allowing emergency withdrawals\n * @dev Note that this is a one-way irreversible action\n * @dev Should be called by approved Owner (Timelock + MultiSig)\n * @param deadline Timestamp of swap deadline\n */\n funct... | medium |
```\n(bool sent, ) = address(operatorAddress).call{value: msg.value}("");\nif (!sent) revert Unauthorized();\n```\n | low |
```\n// If the message is version 0, then it's a migrated legacy withdrawal. We therefore need\n// to check that the legacy version of the message has not already been relayed.\nif (version == 0) {\n bytes32 oldHash = Hashing.hashCrossDomainMessageV0(_target, _sender, _message, _nonce);\n require(\n succes... | high |
```\nuint256 \_tmpIndex = \_currentIndex - 1;\nuint256 \_currentUserAmount = usersTeamInfo[msg.sender].stakedAmount;\n \nwhile (\_currentUserAmount > usersTeamInfo[topUsers[\_tmpIndex]].stakedAmount) {\n address \_tmpAddr = topUsers[\_tmpIndex];\n topUsers[\_tmpIndex] = msg.sender;\n topUsers[\_tmpIndex + 1] =... | medium |
```\nRocketDAONodeTrustedInterface rocketDAONodeTrusted = RocketDAONodeTrustedInterface(getContractAddress("rocketDAONodeTrusted"));\nif (calcBase.mul(submissionCount).div(rocketDAONodeTrusted.getMemberCount()) >= rocketDAOProtocolSettingsNetwork.getNodeConsensusThreshold()) {\n // Update the price\n updatePrices(\_blo... | medium |
```\nfunction swapToETH(uint256 _amount) internal {\n address[] memory path = new address[](2);\n path[0] = address(this);\n path[1] = uniswapRouter.WETH();\n _approve(address(this), address(uniswapRouter), _amount);\n uniswapRouter.swapExactTokensForETHSupportingFeeOnTransferTokens(\n _amount,\n ... | none |
```\nfunction setBlacklist(address _address, bool _isBlacklisted) external onlyOwner {\n blacklisted[_address] = _isBlacklisted;\n emit Blacklist(_address, _isBlacklisted);\n}\n```\n | none |
```\nfor (uint256 i = 0; i < redeemableTokens.length; i++) {\n vaultTokenBalance = vault.balance(redeemableTokens[i]);\n\n redemptionAmount = \_burnableAmount.mul(vaultTokenBalance).div(burnableTokenTotalSupply);\n totalRedemptionAmount = totalRedemptionAmount.add(redemptionAmount);\n\n if (redemptionAmount... | 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 initialize(\n address \_fujiadmin,\n address \_oracle,\n address \_collateralAsset,\n address \_borrowAsset\n) external initializer {\n```\n | medium |
```\nfunction _distributeETH(\n address split,\n address[] memory accounts,\n uint32[] memory percentAllocations,\n uint32 distributorFee,\n address distributorAddress\n) internal {\n uint256 mainBalance = ethBalances[split];\n uint256 proxyBalance = split.balance;\n // if mainBalance is positive, leave 1 in Sp... | none |
```\nFile: AuraSpell.sol\n function openPositionFarm(\n OpenPosParam calldata param,\n uint256 minimumBPT\n )\n// rest of code\n {\n// rest of code\n /// 3. Add liquidity to the Balancer pool and receive BPT in return.\n {\n// rest of code\n if (poolAmountOut != 0) {\n ... | medium |
```\nfunction feed(uint256 intoReserves, uint256 intoGrandPrize)\n external\n payable\n onlyOwner\n{\n require(\n msg.value > 0 && intoReserves.add(intoGrandPrize) == msg.value,\n "DCBW721: Balance-Value Mismatch"\n );\n _updateGrandPrizePool(_grandPrizePool.add(intoGrandPrize));\n _u... | none |
```\nfunction computeFairReserves(\n uint256 resA,\n uint256 resB,\n uint256 wA,\n uint256 wB,\n uint256 pxA,\n uint256 pxB\n ) internal pure returns (uint256 fairResA, uint256 fairResB) {\n // rest of code\n //@audit r0 = 0 when resA < resB.\n-> uint256 r0 = re... | medium |
```\n _doCutRewardsFee(sellToken);\n if (\n expectedRewards[i] != 0 &&\n !PSwapLib.swap(\n augustusSwapper,\n tokenTransferProxy,\n sellToken,\n expectedRewards[i],\n swapDatas[i]\n )\n ) rev... | medium |
```\nfunction refund() override external onlyMinipoolOwnerOrWithdrawalAddress(msg.sender) onlyInitialised {\n // Check refund balance\n require(nodeRefundBalance > 0, "No amount of the node deposit is available for refund");\n // If this minipool was distributed by a user, force finalisation on the node operat... | medium |
```\nfunction balanceOf(address account) public view returns (uint256) {\n return deposits[account].deposit;\n}\n```\n | none |
```\n\_settleRedemption(\_recipient, \_mAssetQuantity, props.bAssets, bAssetQuantities, props.indexes, props.integrators, false);\n```\n | high |
```\nfunction updateYield(uint256 vault) internal {\n AppStorage storage s = appStorage();\n STypes.Vault storage Vault = s.vault[vault];\n STypes.VaultUser storage TAPP = s.vaultUser[vault][address(this)];\n // Retrieve vault variables\n uint88 zethTotalNew = uint88(getZethTotal(vault)); // @dev(safe-ca... | low |
```\nfunction baseOracleCircuitBreaker(\n uint256 protocolPrice,\n uint80 roundId,\n int256 chainlinkPrice,\n uint256 timeStamp,\n uint256 chainlinkPriceInEth\n) private view returns (uint256 _protocolPrice) {\n bool invalidFetchData = roundId == 0 || timeStamp == 0\n || timeStamp > block.times... | low |
```\n // Revert if caller is not receiver\n if (msg.sender != receiver) revert Teller_NotAuthorized();\n\n // Transfer remaining collateral to receiver\n uint256 amount = optionToken.totalSupply();\n if (call) {\n payoutToken.safeTransfer(receiver, amount);\n } else {... | high |
```\n function getImageURIForHat(uint256 _hatId) public view returns (string memory) {\n // check _hatId first to potentially avoid the `getHatLevel` call\n Hat memory hat = _hats[_hatId];\n string memory imageURI = hat.imageURI; // save 1 SLOAD\n ... | low |
```\nfunction _getTValues(uint256 tAmount) private view returns (uint256, uint256, uint256) {\n uint256 tFee = calculateTaxFee(tAmount);\n uint256 tLiquidity = calculateLiquidityFee(tAmount);\n uint256 tTransferAmount = tAmount - tFee - tLiquidity;\n return (tTransferAmount, tFee, tLiquidity);\n}\n```\n | none |
```\n function test_revert_underflow() public {\n _accessController.grantRole(Roles.SOLVER_ROLE, address(this));\n _accessController.grantRole(Roles.LMP_FEE_SETTER_ROLE, address(this));\n\n // User is going to deposit 1500 asset\n _asset.mint(address(this), 1500);\n _asset.approve(... | medium |
```\nfunction updateTemperature(int8 bT, uint256 caseId) private {\n uint256 t = s.w.t;\n if (bT < 0) {\n if (t <= uint256(-bT)) {\n // if (change < 0 && t <= uint32(-change)),\n // then 0 <= t <= type(int8).max because change is an int8.\n // Thus, ... | medium |
```\nfunction handleAggregatedOps(\n UserOpsPerAggregator[] calldata opsPerAggregator,\n address payable beneficiary\n) public nonReentrant {\n\n uint256 opasLen = opsPerAggregator.length;\n uint256 totalOps = 0;\n for (uint256 i = 0; i < opasLen; i++) {\n UserOpsPerAggregator calldata opa = opsPe... | none |
```\n function provideSecret(bytes32 sale, bytes32 secret\_) external {\n require(sales[sale].set);\n if (sha256(abi.encodePacked(secret\_)) == secretHashes[sale].secretHashA) { secretHashes[sale].secretA = secret\_; }\n else if (sha256(abi.encodePacked(secret\_)) == secretHashes[sale].secretHashB) { secr... | 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// re... | medium |
```\nfunction mul(uint256 a, uint256 b) internal pure returns (uint256) {\n return a * b;\n}\n```\n | none |
```\nmapping(uint256 => bool) public liquidated;\n\n/// @notice `\_poolIDs` maps agentID to the pools they have actively borrowed from\nmapping(uint256 => uint256[]) private \_poolIDs;\n\n/// @notice `\_credentialUseBlock` maps signature bytes to when a credential was used\nmapping(bytes32 => uint256) private \_credent... | low |
```\nfunction sub(uint256 a, uint256 b) internal pure returns (uint256) {\n return sub(a, b, "SafeMath: subtraction overflow");\n}\n```\n | none |
```\nuint256 constant g2\_srs\_0\_x\_0 = 11559732032986387107991004021392285783925812861821192530917403151452391805634;\nuint256 constant g2\_srs\_0\_x\_1 = 10857046999023057135944570762232829481370756359578518086990519993285655852781;\nuint256 constant g2\_srs\_0\_y\_0 = 40823678758634336813322034031454355683168513275... | high |
```\n } else if (p == uint8(Principals.Notional)) {\n // Principal token must be approved for Notional's lend\n ILender(lender).approve(address(0), address(0), address(0), a);\n```\n | medium |
```\nfunction addValidators(\n uint256 \_operatorIndex,\n uint256 \_keyCount,\n bytes calldata \_publicKeys,\n bytes calldata \_signatures\n) external onlyActiveOperator(\_operatorIndex) {\n if (\_keyCount == 0) {\n revert InvalidArgument();\n }\n\n if (\_publicKeys.length % PUBLIC\_KEY\_LENGTH != 0 || \_publicKeys.len... | medium |
```\n// SPDX-License-Identifier: MIT\npragma solidity 0.8.21;\nimport { console, console2 } from "forge-std/Test.sol";\nimport { TestUtils } from "../../helpers/TestUtils.sol";\nimport { IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol";\nimport { GMXMockVaultSetup } from "./GMXMockVaultSetup.t.sol";\nimpo... | medium |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.