function
stringlengths
12
63.3k
severity
stringclasses
4 values
```\nfunction totalFees() public view returns (uint256) {\n return _tFeeTotal;\n}\n```\n
none
```\n/// Controlled Value) than the circulating (user-owned) FEI, i.e.\n/// a positive Protocol Equity.\n/// Note: the validity status is ignored in this function.\nfunction isOvercollateralized() external override view whenNotPaused returns (bool) {\n (,, int256 \_protocolEquity, bool \_valid) = pcvStats();\n re...
low
```\nfunction setEarlySellTax(bool onoff) external onlyOwner {\n enableEarlySellTax = onoff;\n}\n```\n
none
```\nfunction setReinvest(address account, bool value) external onlyOwner {\n autoReinvest[account] = value;\n}\n```\n
none
```\n\_poolById[poolId].numberOfMakers = uint256(\_poolById[poolId].numberOfMakers).safeSub(1).downcastToUint32();\n```\n
medium
```\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: BondBaseSDA.sol\n // Set last decay timestamp based on size of purchase to linearize decay\n uint256 lastDecayIncrement = debtDecayInterval.mulDiv(payout_, lastTuneDebt);\n metadata[id_].lastDecay += uint48(lastDecayIncrement);\n```\n
medium
```\nconstructor(string memory name) EIP712(name, "1") {}\n```\n
none
```\nuint256 pausedDuration = 10 days;\n```\n
low
```\nfunction _doSafeBatchTransferAcceptanceCheck(\n address operator,\n address from,\n address to,\n uint256[] memory ids,\n uint256[] memory amounts,\n bytes memory data\n) private {\n if (to.isContract()) {\n try IERC1155Receiver(to).onERC1155BatchReceived(operator, from, ids, amounts, d...
none
```\nfunction excludeFromFee(address account) public onlyOwner {\n _isExcludedFromFee[account] = true;\n}\n```\n
none
```\nfunction div(uint256 a, uint256 b) internal pure returns (uint256) {\n return div(a, b, "SafeMath: division by zero");\n}\n```\n
none
```\n// Redirect net portion of minor's side to maker\nif (fromPosition.long.gt(fromPosition.short)) {\n fundingValues.fundingMaker = fundingValues.fundingShort.mul(Fixed6Lib.from(fromPosition.skew().abs()));\n fundingValues.fundingShort = fundingValues.fundingShort.sub(fundingValues.fundingMaker);\n}\nif (fromPo...
medium
```\n uint locked = \_getAndUpdateLockedAmount(from);\n if (locked > 0) {\n require(\_balances[from] >= locked.add(amount), "Token should be unlocked for burning");\n }\n//-------------------------------------------------------------------------\n\n \_callTokensToSend(\n ...
high
```\nfunction \_swapLidoForWETH(uint256 amountToSwap) internal {\n IUniswapSwapRouter.ExactInputSingleParams\n memory params = IUniswapSwapRouter.ExactInputSingleParams({\n tokenIn: address(ldo),\n tokenOut: address(weth),\n fee: UNISWAP\_FEE,\n recipient: address(t...
medium
```\nfunction registerClaimer(address \_claimerAddress, bool \_enabled) override external onlyClaimContract {\n // The name of the claiming contract\n string memory contractName = getContractName(msg.sender);\n // Record the block they are registering at\n uint256 registeredBlock = 0;\n // How many users...
low
```\nfunction acceptControl(address split)\n external\n override\n onlySplitNewPotentialController(split)\n{\n delete splits[split].newPotentialController;\n emit ControlTransfer(split, splits[split].controller, msg.sender);\n splits[split].controller = msg.sender;\n}\n```\n
none
```\nfunction getPositionValue() public view returns (uint256) {\n uint256 markPrice = getMarkPriceTwap(15);\n int256 positionSize = IAccountBalance(clearingHouse.getAccountBalance())\n .getTakerPositionSize(address(this), market);\n return markPrice.mulWadUp(_abs(positionSize));\n}\n\nfunction getMarkP...
high
```\ndaiAToken balance = 30000\nwethDebtToken balance = 10\n\nThe price of WETH when the trade was opened was ~ 3000 DAI\n```\n
high
```\nFile: ERC4626Oracle.sol\n function getPrice(address token) external view returns (uint) {\n uint decimals = IERC4626(token).decimals();\n return IERC4626(token).previewRedeem(\n 10 ** decimals\n ).mulDivDown(\n oracleFacade.getPrice(IERC4626(token).asset()),\n ...
medium
```\nfunction eject(\n uint256 shares,\n address receiver,\n address owner\n) public returns (uint256 assets, uint256 excessBal, bool isExcessPTs) {\n\n // rest of code\n\n //@audit call of interest\n (excessBal, isExcessPTs) = _exitAndCombine(shares);\n\n _burn(owner, shares); // Burn after percen...
high
```\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
```\naddress internal constant DIVIDER = 0x09B10E45A912BcD4E80a8A3119f0cfCcad1e1f12;\n```\n
medium
```\nfunction sub(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 verify(\n bytes32[] memory proof,\n bytes32 root,\n bytes32 leaf\n) internal pure returns (bool) {\n return processProof(proof, leaf) == root;\n}\n```\n
none
```\nfunction setOperatorStrategyCap(\n RioLRTOperatorRegistryStorageV1.StorageV1 storage s,\n uint8 operatorId,\n IRioLRTOperatorRegistry.StrategyShareCap memory newShareCap\n ) internal {\n .\n OperatorUtilizationHeap.Data memory utilizationHeap = s.getOperatorUtilizationHeapForS...
high
```\nsetSettingUint('members.challenge.cooldown', 6172); // How long a member must wait before performing another challenge, approx. 1 day worth of blocks\nsetSettingUint('members.challenge.window', 43204); // How long a member has to respond to a challenge. 7 days worth of blocks\nsetSetting...
high
```\nassert(amount < targetReserveBalance);\n```\n
low
```\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 minPrice = base.getPrice(tokens[0]);\n for(uint256 i = 1; i != length; ++i) {\n uint256 price = base.getPrice(tokens[i]);\n minPrice = (price < minPrice) ? price : minPrice;\n }\n return minPrice.mulWadDown(pool.getRate());\n```\n
high
```\n function testInsolvency() public {\n \n // ============== Setup Scenario ==============\n uint256 interestRateOne = 0.05 * 10**18; // Collateral // Quote (loaned token, short position)\n address poolThreeAddr = erc20PoolFactory.deployPool(address(dai), address(weth), inte...
medium
```\nfunction getNonce(address sender, uint192 key)\npublic view override returns (uint256 nonce) {\n return nonceSequenceNumber[sender][key] | (uint256(key) << 64);\n}\n```\n
none
```\nrequire(\_proposal.voters[\_voter].nonce < \_relayerNonce, "INVALID\_NONCE");\n```\n
low
```\n function _routerSwap(\n uint16 _dstChainId,\n uint256 _srcPoolId,\n uint256 _dstPoolId,\n uint256 _amount,\n uint256 _slippage,\n address payable _oft,\n address _erc20\n ) private {\n bytes memory _dst = abi.encodePacked(connectedOFTs[_oft][_dstChainI...
medium
```\nfunction withdrawInsurance(uint256 amount, address to)\n external\n nonReentrant\n onlyOwner\n{\n if (amount == 0) {\n revert ZeroAmount();\n }\n\n insuranceDeposited -= amount;\n\n vault.withdraw(insuranceToken(), amount);\n IERC20(insuranceToken()).transfer(to, amount);\n\n emit...
high
```\n function fund(IMarket market) external {\n if (!instances(IInstance(address(market)))) revert FactoryNotInstanceError();\n market.claimFee();\n }\n```\n
high
```\nfunction setIncludeDividends(address account) public onlyOwner {\n dividendTracker.includeFromDividends(account);\n dividendTracker.setBalance(account, getMultiplier(account));\n}\n```\n
none
```\nfunction dismissSlashProposal(uint256 \_proposalId, string[] calldata \_evidence) external onlyRole(SLASHING\_ARBITER\_ROLE) {\n \_transition(\_proposalId, DISMISSED);\n \_submitEvidence(\_proposalId, DISMISSED, \_evidence);\n \_returnDeposit(\_proposalId);\n \_unfreeze(\_proposalId);\n}\n```\n
high
```\nfunction isExcludedFromAutoClaim(address account) external view onlyOwner returns (bool) {\n return excludedFromAutoClaim[account];\n}\n```\n
none
```\nfunction setAutomatedMarketMakerPair(address pair, bool value) public onlyOwner {\n require(pair != uniswapV2Pair, "The pair cannot be removed from automatedMarketMakerPairs");\n\n _setAutomatedMarketMakerPair(pair, value);\n}\n```\n
none
```\nFile: ERC20.sol\n function _mint(address account, uint256 amount) internal virtual {\n..SNIP..\n _beforeTokenTransfer(address(0), account, amount);\n\n _totalSupply += amount;\n unchecked {\n // Overflow not possible: balance + amount is at most totalSupply + amount, which is che...
high
```\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
```\ntoken.safeTransferFrom(\_from, address(this), \_amount);\n```\n
medium
```\nfor (uint i = 0; i < shares.length; ++i) {\n skaleToken.send(address(skaleBalances), shares[i].amount, abi.encode(shares[i].holder));\n\n uint created = delegationController.getDelegation(shares[i].delegationId).created;\n uint delegationStarted = timeHelpers.getNextMonthStartFromDate(created);\n skale...
high
```\nfunction sendInterests(Loan storage loan, Provision storage provision) internal returns (uint256 sent) {\n uint256 interests = loan.payment.paid - loan.lent;\n if (interests == loan.payment.minInterestsToRepay) {\n // this is the case if the loan is repaid shortly after issuance\n // each lende...
medium
```\nfunction \_stakeDAIx(address \_user, uint256 \_amount, address \_policyBookAddr) internal {\n require (\_amount > 0, "BMIDAIStaking: Can't stake zero tokens");\n\n PolicyBook \_policyBook = PolicyBook(\_policyBookAddr);\n // transfer DAI from PolicyBook to yield generator\n daiToken.transferFrom(\_poli...
high
```\nfunction _setTransceiver(address transceiver) internal returns (uint8 index) {\n /* snip */\n if (transceiver == address(0)) {\n revert InvalidTransceiverZeroAddress();\n }\n\n if (_numTransceivers.registered >= MAX_TRANSCEIVERS) {\n revert TooManyTransceivers();\n }\n\n if (transce...
medium
```\nfunction ownerToggleSalesTax(bool state) external onlyOwner() {\n toggleSalesTax(state);\n emit ToggledSalesTax(state);\n}\n```\n
none
```\nfunction _setOwner(address newOwner) private {\n address oldOwner = _owner;\n _owner = newOwner;\n emit OwnershipTransferred(oldOwner, newOwner);\n}\n```\n
none
```\nfunction donationAddress() public view returns (address) {\n return _donationAddress;\n}\n```\n
none
```\n/// @notice Adds an external ERC721 token as an additional prize that can be awarded\n/// @dev Only the Prize-Strategy owner/creator can assign external tokens,\n/// and they must be approved by the Prize-Pool\n/// NOTE: The NFT must already be owned by the Prize-Pool\n/// @param \_externalErc721 The address of an...
medium
```\n function triggerRoot() external {\n bytes32 rootCandidateAValue = rootCandidateA.value;\n if (rootCandidateAValue != rootCandidateB.value || rootCandidateAValue == bytes32(0)) revert RootCandidatesInvalid();\n root = Root({value: rootCandidateAValue, lastUpdatedAt: block.timestamp});\n ...
medium
```\nfunction sendValue(address payable recipient, uint256 amount) internal {\n require(\n address(this).balance >= amount,\n "Address: insufficient balance"\n );\n\n // solhint-disable-next-line avoid-low-level-calls, avoid-call-value\n (bool success, ) = recipient.call{value: amount}("");\n ...
none
```\n /**\n * @notice Get token A and token B's LP token amount required for a given value\n * @param givenValue Given value needed, expressed in 1e30 -------------------------- refer this\n * @param marketToken LP token address\n * @param indexToken Index token address\n * @param longToken Long token a...
low
```\nfunction processAccount(address payable account, bool automatic) public onlyOwner\n returns (bool)\n{\n if (dividendsPaused) {\n return false;\n }\n\n bool reinvest = autoReinvest[account];\n\n if (automatic && reinvest && !allowAutoReinvest) {\n return false;\n }\n\n uint256 amo...
none
```\nfunction mod(uint256 a, uint256 b) internal pure returns (uint256) {\n return a % b;\n}\n```\n
none
```\nfunction _withdraw(address account) internal returns (uint256 withdrawn) {\n // leave balance of 1 for gas efficiency\n // underflow if ethBalance is 0\n withdrawn = ethBalances[account] - 1;\n ethBalances[account] = 1;\n account.safeTransferETH(withdrawn);\n}\n```\n
none
```\nfunction owner() public view returns (address) {\n return _owner;\n}\n```\n
none
```\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
```\nfunction add(uint x, uint y) internal pure returns (uint z) {\n require((z = x + y) >= x, "add-overflow");\n}\n```\n
low
```\nreceive() external payable {}\n```\n
none
```\nuint256 realDebt = borrows.div(record.interestIndex == 0 ? 1e18 : record.interestIndex).mul(info.borrowIndex);\n```\n
medium
```\nfunction toggleSalesTax(bool state) private {\n timeSalesTaxEnabled = block.timestamp;\n salesTaxEnabled = state;\n}\n```\n
none
```\nfunction changeWalletLimit(uint256 newLimit) external onlyOwner {\n require(\n newLimit >= _totalSupply / 100,\n "New wallet limit should be at least 1% of total supply"\n );\n maxBag = newLimit;\n emit MaxBagChanged(newLimit);\n}\n```\n
none
```\nmapping(uint256 => EnumerableSetUpgradeable.AddressSet)\n internal commitmentBorrowersList;\n \nfunction updateCommitmentBorrowers(\n uint256 _commitmentId,\n address[] calldata _borrowerAddressList\n ) public commitmentLender(_commitmentId) {\n delete commitmentBorrowersList[...
medium
```\nfunction _prepareTake(\n Liquidation memory liquidation_,\n uint256 t0Debt_,\n uint256 collateral_,\n uint256 inflator_\n ) internal view returns (TakeLocalVars memory vars) {\n // rest of code// rest of code..\n vars.auctionPrice = _auctionPrice(liquidation_.referencePrice, k...
medium
```\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(address accountantaddress) external {\n require(!initialized);\n initialized = true;\n accountant = zAuctionAccountant(accountantaddress);\n}\n```\n
medium
```\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
```\nfunction checkGasV1(bytes calldata _message)\n public\n view\n returns (uint256, uint256)\n {\n uint256 gas1 = gasleft();\n bytes32 versionedHash = Hashing.hashCrossDomainMessageV1(\n 0,\n address(this),\n address(this),\n 0,\n ...
medium
```\n function claimReward() external onlyOwner {\n for (uint256 marketId; marketId < totalMarkets; marketId++) {\n _registrations[marketId].read().market.claimReward();\n _registrations[marketId].read().market.reward().push(factory().owner());\n }\n }\n```\n
medium
```\nFile: StrategyUtils.sol\n function _checkPriceLimit(\n StrategyContext memory strategyContext,\n uint256 oraclePrice,\n uint256 poolPrice\n ) internal pure {\n uint256 lowerLimit = (oraclePrice * \n (VaultConstants.VAULT_PERCENT_BASIS - strategyContext.vaultSettings.ora...
medium
```\nrequire(weightSum >= 1e18 && weightSum <= 4e18, "Basket weight must be >= 100 && <= 400%");\n```\n
low
```\nfunction SetZauction(address zauctionaddress) external onlyAdmin{\n zauction = zauctionaddress;\n emit ZauctionSet(zauctionaddress);\n}\n```\n
medium
```\n function _allocate(bytes memory _data, address _sender) internal virtual override {\n …\n\n // check that the recipient has voice credits left to allocate\n if (!_hasVoiceCreditsLeft(voiceCreditsToAllocate, allocator.voiceCredits)) revert INVALID();\n\n _qv_allocate(allocator, recip...
high
```\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
```\n// ABI encode calldata for `fillOrder`\nbytes memory fillOrderCalldata = abi.encodeWithSelector(\n IExchangeCore(address(0)).fillOrder.selector,\n order,\n takerAssetFillAmount,\n signature\n);\n\n(bool didSucceed, bytes memory returnData) = address(this).delegatecall(fillOrderCalldata);\n```\n
medium
```\n uint256 relayerFee = _relayerFee != 0 ? _relayerFee : msg.value;\n IConnext(connext).xcall{value: relayerFee}(\n _destinationDomain, // _destination: Domain ID of the destination chain\n target, // _to: address of the target contract\n address(0), // _asset: use address zero for 0-value trans...
high
```\nFile: BalancerComposableAuraVault.sol\n function _checkPriceAndCalculateValue() internal view override returns (uint256) {\n (uint256[] memory balances, uint256[] memory spotPrices) = SPOT_PRICE.getComposableSpotPrices(\n BALANCER_POOL_ID,\n address(BALANCER_POOL_TOKEN),\n ...
high
```\n function afterDepositExecution(\n bytes32 depositKey,\n IDeposit.Props memory /* depositProps */,\n IEvent.Props memory /* eventData */\n ) external onlyController {\n GMXTypes.Store memory _store = vault.store();\n\n if (\n _store.status == GMXTypes.Status.Deposit &&\n _store.depositCa...
medium
```\nunction testAttack() public {\n mockRootPrice(WSTETH, 1_123_300_000_000_000_000); //wstETH\n mockRootPrice(CBETH, 1_034_300_000_000_000_000); //cbETH\n\n IBalancerMetaStablePool pool = IBalancerMetaStablePool(WSTETH_CBETH_POOL);\n\n address[] memory assets = new address[](2);\n a...
medium
```\nfunction hash256(bytes memory \_b) internal pure returns (bytes32) {\n return abi.encodePacked(sha256(abi.encodePacked(sha256(\_b)))).toBytes32();\n}\n```\n
low
```\nFile: BaseLSTAdapter.sol\n function prefundedDeposit() external nonReentrant returns (uint256, uint256) {\n..SNIP..\n uint256 stakeAmount;\n unchecked {\n stakeAmount = availableEth + queueEthCache - targetBufferEth; // non-zero, no underflow\n }\n // If the stake amount e...
medium
```\nfunction setIsPool(address contractAddress, bool contractIsPool) public onlyOwner {\n isPool[contractAddress] = contractIsPool;\n emit IsPool(contractAddress, contractIsPool);\n}\n```\n
none
```\n/// @dev Set read-only mode (state cannot be changed).\nfunction setReadOnlyMode(bool shouldSetReadOnlyMode)\n external\n onlyAuthorized\n{\n // solhint-disable-next-line not-rely-on-time\n uint96 timestamp = block.timestamp.downcastToUint96();\n if (shouldSetReadOnlyMode) {\n stakingContract...
medium
```\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
```\n(\n uint256 initialPrice,\n uint256 scalingFactor,\n uint256 timeCoefficient,\n uint256 bucketSize,\n bool isDecreasing,\n uint256 maxPrice,\n uint256 minPrice\n) = getDecodedData(_priceAdapterConfigData);\n\nuint256 timeBucket = _timeElapsed / bucketSize;\n\nint256 expArgument = int256(timeCo...
medium
```\nconstructor(string memory name, string memory version) {\n _name = name.toShortStringWithFallback(_nameFallback);\n _version = version.toShortStringWithFallback(_versionFallback);\n _hashedName = keccak256(bytes(name));\n _hashedVersion = keccak256(bytes(version));\n\n _cachedChainId = block.chainid...
none
```\nfunction _placePerpOrder(\n uint256 amount,\n bool isShort,\n bool amountIsInput,\n uint160 sqrtPriceLimit\n) private returns (uint256, uint256) {\n uint256 upperBound = 0; // 0 = no limit, limit set by sqrtPriceLimit\n\n IClearingHouse.OpenPositionParams memory params = IClearingHouse\n ....
medium
```\nfunction sendValue(address payable recipient, uint256 amount) internal {\n require(\n address(this).balance >= amount,\n "Address: insufficient balance"\n );\n\n // solhint-disable-next-line avoid-low-level-calls, avoid-call-value\n (bool success, ) = recipient.call{value: amount}("");\n ...
none
```\n (lpPrice(\n virtualPrice,\n base.getPrice(tokens[1]),\n ethPrice,\n base.getPrice(tokens[0])\n ) * 1e18) / ethPrice;\n```\n
high
```\nfunction _takeWalletFee(uint256 tWallet) private {\n uint256 currentRate = _getRate();\n uint256 rWallet = tWallet.mul(currentRate);\n _rOwned[address(this)] = _rOwned[address(this)].add(rWallet);\n if (_isExcluded[address(this)])\n _tOwned[address(this)] = _tOwned[address(this)].add(tWallet);\n...
none
```\nfunction _convertToToken(address token, address receiver) internal returns (uint256 amountOut) {\n // this value should be whatever glp is received by calling withdraw/redeem to junior vault\n uint256 outputGlp = fsGlp.balanceOf(address(this));\n\n // using min price of glp because giving in glp\n uint...
medium
```\nfunction freezeSchains(uint nodeIndex) external allow("SkaleManager") {\n SchainsInternal schainsInternal = SchainsInternal(contractManager.getContract("SchainsInternal"));\n bytes32[] memory schains = schainsInternal.getActiveSchains(nodeIndex);\n for (uint i = 0; i < schains.length; i++) {\n Rota...
medium
```\nfunction set(uint256 \_pid, uint128 \_allocPoint, IRewarder \_rewarder, bool overwrite) public onlyGovernor {\n totalAllocPoint = (totalAllocPoint - poolInfo[\_pid].allocPoint) + \_allocPoint;\n poolInfo[\_pid].allocPoint = \_allocPoint.toUint64();\n\n if (overwrite) {\n rewarder[\_pid] = \_rewarde...
low
```\nfunction safeApprove(\n IERC20 token,\n address spender,\n uint256 value\n) internal {\n // safeApprove should only be called when setting an initial allowance,\n // or when resetting it to zero. To increase and decrease it, use\n // 'safeIncreaseAllowance' and 'safeDecreaseAllowance'\n requir...
none
```\nfunction abs(int256 a) internal pure returns (int256) {\n require(a != MIN_INT256);\n return a < 0 ? -a : a;\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
```\nif (upcomingMilestone != 0) revert MILESTONES_ALREADY_SET();\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