function
stringlengths
12
63.3k
severity
stringclasses
4 values
```\nfunction _mintGenesisNFT() internal {\n _tokenIds++;\n\n emit GenesisNFTMinted(_tokenIds, msg.sender);\n\n _mint(msg.sender, _tokenIds, 1, "");\n}\n```\n
none
```\nfunction _approve(address owner, address spender, uint256 amount) private {\n require(owner != address(0), "ERC20: approve from the zero address");\n require(spender != address(0), "ERC20: approve to the zero address");\n\n _allowances[owner][spender] = amount;\n emit Approval(owner, spender, amount);\...
none
```\nfunction approveBorrow(address spender, uint256 amount) external returns (bool) {\n _approveBorrow(msg.sender, spender, amount);\n return true;\n }\n```\n
high
```\nfunction div(\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 get(Map storage map, address key) internal view returns (uint256) {\n return map.values[key];\n}\n```\n
none
```\n (uint256 unitFee, , ) = _fees(10**decimals(), settlementFeePercentage);\n amount = (newFee * 10**decimals()) / unitFee;\n```\n
medium
```\nfunction unlock(\n uint128 lockId,\n address recipient, uint256 amount,\n bytes4 lockSource, bytes4 tokenSource,\n bytes32 tokenSourceAddress,\n bytes calldata signature) external isActive {\n // Create message hash and validate the signature\n IValidator(validator).createUnlock(\n ...
none
```\n function buyCollateral(address from, uint256 borrowAmount, uint256 supplyAmount, bytes calldata data)\n external\n optionNotPaused(PauseType.LeverageBuy)\n solvent(from, false)\n notSelf(from)\n returns (uint256 amountOut)\n {\n if (address(leverageExecutor) == addr...
medium
```\nfunction setMinimumTokenBalanceForAutoDividends(uint256 value) public onlyOwner {\n dividendTracker.setMinimumTokenBalanceForAutoDividends(value);\n}\n```\n
none
```\n return (uint32(block.timestamp) -\n _liquidationDelay -\n lastRepaidTimestamp(_bidId) >\n bidDefaultDuration[_bidId]);\n```\n
medium
```\nconstructor () {\n address msgSender = _msgSender();\n _owner = msgSender;\n emit OwnershipTransferred(address(0), msgSender);\n}\n```\n
none
```\nFile: contracts/libraries/LibOracle.sol\n\n85 uint256 twapPriceInEther = (twapPrice / Constants.DECIMAL_USDC) * 1 ether;\n86 uint256 twapPriceInv = twapPriceInEther.inv();\n87 if (twapPriceInEther == 0) {\n88 revert Errors.InvalidTwapPrice(); // @audit : unreachable ...
low
```\nMUST return the maximum amount of shares that could be transferred from `owner` through `redeem` and not cause a revert, which MUST NOT be higher than the actual maximum that would be accepted (it should underestimate if necessary).\n\nMUST factor in both global and user-specific limits, like if redemption is enti...
medium
```\n function getSellRate(address \_srcAddr, address \_destAddr, uint \_srcAmount, bytes memory) public override view returns (uint rate) {\n (rate, ) = KyberNetworkProxyInterface(KYBER\_INTERFACE)\n .getExpectedRate(IERC20(\_srcAddr), IERC20(\_destAddr), \_srcAmount);\n\n // multiply with ...
high
```\npragma solidity ^0.8;\n```\n
low
```\nfunction toUint256Safe(int256 a) internal pure returns (uint256) {\n require(a >= 0);\n return uint256(a);\n}\n```\n
none
```\nassembly {\n // store selector of destination function\n let freeMemPtr := 0\n if gt(customEgressSelector, 0) {\n mstore(0x0, customEgressSelector)\n freeMemPtr := add(freeMemPtr, 4)\n }\n\n // adjust the calldata offset, if we should ignore the selector\n let calldataOffset := 0\n ...
low
```\n uint256 latestTimestamp = global.latest == 0 ? 0 : oracles[global.latest].provider.latest().timestamp;\n if (uint256(oracles[global.latest].timestamp) > latestTimestamp) return false;\n```\n
medium
```\nfunction mod(uint256 a, uint256 b) internal pure returns (uint256) {\n return mod(a, b, "SafeMath: modulo by zero");\n}\n```\n
none
```\nfunction isExcludedFromFee(address account) public view returns(bool) {\n return _isExcludedFromFee[account];\n}\n```\n
none
```\nsharesOwed = convertToSharesFromRestakingTokens(asset, amountIn);\n```\n
medium
```\nconstructor(string memory name_, string memory symbol_) {\n _name = name_;\n _symbol = symbol_;\n}\n```\n
none
```\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
```\nfunction tryMod(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
```\n if (maxFCash < fCashAmount) {\n // NOTE: lending at zero\n uint256 fCashAmountExternal = fCashAmount * precision / uint256(Constants.INTERNAL_TOKEN_PRECISION);\n require(fCashAmountExternal <= depositAmountExternal);\n\n // NOTE: Residual (depositAmountExternal - fCashAmountExternal...
medium
```\nfunction log2(uint256 value) internal pure returns (uint256) {\n uint256 result = 0;\n unchecked {\n if (value >> 128 > 0) {\n value >>= 128;\n result += 128;\n }\n if (value >> 64 > 0) {\n value >>= 64;\n result += 64;\n }\n if (...
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 uint88 shares = eth * (timeTillMatch / 1 days);\n```\n
medium
```\nfunction delegateMgCvg(uint256 _tokenId, address _to, uint96 _percentage) external onlyTokenOwner(_tokenId) {\n require(_percentage <= 100, "INVALID_PERCENTAGE");\n\n uint256 _delegateesLength = delegatedMgCvg[_tokenId].length;\n require(_delegateesLength < maxMgDelegatees, "TOO_MUCH_DELEGATEES");\n\n ...
medium
```\nfunction getStringSlot(bytes32 slot) internal pure returns (StringSlot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := slot\n }\n}\n```\n
none
```\nfunction _addTokenToAllTokensEnumeration(uint256 tokenId) private {\n _allTokensIndex[tokenId] = _allTokens.length;\n _allTokens.push(tokenId);\n}\n```\n
none
```\nfunction increment(Counter storage counter) internal {\n unchecked {\n counter._value += 1;\n }\n}\n```\n
none
```\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
```\nfunction create(\n uint256 maxLoanDur\_,\n uint256 maxFundDur\_,\n address arbiter\_,\n bool compoundEnabled\_,\n uint256 amount\_\n) external returns (bytes32 fund) {\n require(fundOwner[msg.sender].lender != msg.sender || msg.sender == deployer); // Only allow one loan fund per address\...
medium
```\nif (validatorDetails.cap > 0 && newValidatorCap == 0) {\n // If there are active deposits, queue the operator for strategy exit.\n if (activeDeposits > 0) {\n -> operatorDetails.queueOperatorStrategyExit(operatorId, BEACON_CHAIN_STRATEGY);\n .\n }\n ...
medium
```\nfunction approve(address spender, uint256 amount) public override returns (bool) {\n _approve(_msgSender(), spender, amount);\n return true;\n}\n```\n
none
```\nminRoundId=1\nmaxRoundId=1001\n\n-> \n\nminRoundId=1\nmaxRoundId=501\n\n-> \n\nminRoundId=1\nmaxRoundId=251\n\n-> \n\nminRoundId=1\nmaxRoundId=126\n\n-> \n\nminRoundId=1\nmaxRoundId=63\n\n-> \n\nminRoundId=1\nmaxRoundId=32\n\n-> \n\nminRoundId=1\nmaxRoundId=16\n\n-> \n\nminRoundId=1\nmaxRoundId=8\n\n-> \n\nminRoun...
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
```\nfunction _incrementDeposit(address account, uint256 amount) internal {\n DepositInfo storage info = deposits[account];\n uint256 newAmount = info.deposit + amount;\n require(newAmount <= type(uint112).max, "deposit overflow");\n info.deposit = uint112(newAmount);\n}\n```\n
none
```\nif (getCancelled(\_proposalID)) {\n // Cancelled by the proposer?\n return ProposalState.Cancelled;\n // Has it been executed?\n} else if (getExecuted(\_proposalID)) {\n return ProposalState.Executed;\n // Has it expired?\n} else if (block.number >= getExpires(\_proposalID)) {\n return ProposalSt...
low
```\nfunction changeMaintainer(\n bytes calldata password,\n bytes32 newPasswordHash,\n address newMaintainer\n)\n external\n virtual\n override\n onlyPortal\n whenNotPaused\n returns (bool success)\n{\n require(\n SELF.PASSWORD\_HASH == bytes32(0) ||\n SELF.PASSWORD\_HASH ==\n keccak256(abi.encodePacked(SELF.ID, passw...
medium
```\n function updateTrust(address borrower, uint96 trustAmount) external onlyMember(msg.sender) whenNotPaused {\n// rest of code\n uint256 voucheesLength = vouchees[staker].length;\n if (voucheesLength >= maxVouchers) revert MaxVouchees();\n\n\n uint256 voucherIndex = vouchers[borro...
medium
```\nfunction functionCall(address target, bytes memory data)\n internal\n returns (bytes memory)\n{\n return functionCall(target, data, "Address: low-level call failed");\n}\n```\n
none
```\nfunction recreateBlockheaders(uint \_blockNumber, bytes[] memory \_blockheaders) public {\n\n bytes32 currentBlockhash = blockhashMapping[\_blockNumber];\n require(currentBlockhash != 0x0, "parentBlock is not available");\n\n bytes32 calculatedHash = reCalculateBlockheaders(\_blockheaders, currentBlockhas...
medium
```\n _withdraw(_totalSupply, _totalSupply);\n```\n
high
```\n function getMedianPriceIfDeviation(\n uint256[] memory prices_,\n bytes memory params_\n ) public pure returns (uint256) {\n // Misconfiguration\n if (prices_.length < 3) revert SimpleStrategy_PriceCountInvalid(prices_.length, 3);\n\n237 uint256[] memory nonZeroPrices = _getN...
medium
```\n contract UXDGovernor is\n ReentrancyGuard,\n Governor,\n GovernorVotes,\n GovernorVotesQuorumFraction,\n GovernorTimelockControl,\n GovernorCountingSimple,\n GovernorSettings\n```\n
medium
```\nif (!router.withdraws(transferId)) {\n router.withdraw(\_request, \_sigs, \_signers, \_powers);\n}\n```\n
high
```\nconstructor() {\n _paused = false;\n}\n```\n
none
```\nfunction distributeETH(\n address split,\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 avoid stack depth c...
none
```\nfunction \_poolBalanceIsSufficient(address \_collateral) internal view returns (bool) {\n return controller.balanceOf(address(reserve), \_collateral) >= collateralsToBeClaimed[\_collateral];\n}\n```\n
medium
```\n if (feeToken == ETH) \n {uint256 totalFee = (gasUsed + GAS_OVERHEAD_NATIVE) * tx.gasprice;\n totalFee = _applyMultiplier(totalFee);\n return (totalFee, recipient, TokenTransfer._nativeTransferExec(recipient, totalFee));\n } else {uint256 totalFee = (gasUsed + GAS_OVERHEAD_ERC20) * tx.gaspr...
high
```\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/// @notice Can be used to delegate call to the TradingModule's implementation in order to execute\n/// a trade.\nfunction \_executeTrade(\n uint16 dexId,\n Trade memory trade\n) internal returns (uint256 amountSold, uint256 amountBought) {\n (bool success, bytes memory result) = nProxy(payable(address(TR...
low
```\nbool isInitialized;\n```\n
low
```\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
```\n function claimProceeds(\n uint96 lotId_,\n bytes calldata callbackData_\n ) external override nonReentrant {\n \n // rest of code\n\n (uint96 purchased_, uint96 sold_, uint96 payoutSent_) =\n _getModuleForId(lotId_).claimProceeds(lotId_);\n\n // rest of c...
high
```\n function executeModule(ITOFT.Module _module, bytes memory _data, bool _forwardRevert)\n external\n payable\n whenNotPaused\n returns (bytes memory returnData)\n {\n// rest of code\n function sendPacket(LZSendParam calldata _lzSendParam, bytes calldata _composeMsg)\n publi...
medium
```\nfunction changeHatToggle(uint256 _hatId, address _newToggle) external {\n if (_newToggle == address(0)) revert ZeroAddress();\n\n _checkAdmin(_hatId);\n Hat storage hat = _hats[_hatId];\n\n if (!_isMutable(hat)) {\n revert Immutable();\n }\n\n hat.toggle = _newToggle;\n\n emit HatToggle...
medium
```\nfunction _getCurrentSupply() private view returns(uint256, uint256) {\n uint256 rSupply = _rTotal;\n uint256 tSupply = _tTotal; \n for (uint256 i = 0; i < _excluded.length; i++) {\n if (_rOwned[_excluded[i]] > rSupply || _tOwned[_excluded[i]] > tSupply) return (_rTotal, _tTotal);\n rSup...
none
```\nfunction governorAddPoolMultiplier(\n uint256 \_pid,\n uint64 lockLength,\n uint64 newRewardsMultiplier\n) external onlyGovernor {\n PoolInfo storage pool = poolInfo[\_pid];\n uint256 currentMultiplier = rewardMultipliers[\_pid][lockLength];\n // if the new multplier is less than the current mult...
medium
```\n// tokenSpent and tokenReceived are immutable\ntokenSpent = \_tokenSpent;\ntokenReceived = \_tokenReceived;\n```\n
low
```\nfunction _validatePaymasterPrepayment(uint256 opIndex, UserOperation calldata op, UserOpInfo memory opInfo, uint256 requiredPreFund, uint256 gasUsedByValidateAccountPrepayment)\ninternal returns (bytes memory context, uint256 validationData) {\nunchecked {\n MemoryUserOp memory mUserOp = opInfo.mUserOp;\n ui...
none
```\nuint256 barBeforeBalance = bar.balanceOf(address(this));\nuint256 sushiBeforeBalance = sushi.balanceOf(address(this));\n\nbar.leave(requiredShares);\n\nuint256 barAfterBalance = bar.balanceOf(address(this));\nuint256 sushiAfterBalance = sushi.balanceOf(address(this));\n\nuint256 barBalanceDiff = barBeforeBalance.s...
low
```\nfunction functionCallWithValue(\n address target,\n bytes memory data,\n uint256 value,\n string memory errorMessage\n) internal returns (bytes memory) {\n require(address(this).balance >= value, "Address: insufficient balance for call");\n require(isContract(target), "Address: call to non-contra...
none
```\n function onUndelegate(address delegator, uint amount) external {\n // limitation only applies to the operator, others can always undelegate\n if (delegator != owner) { return; }\n\n uint actualAmount = amount < balanceOf(owner) ? amount : balanceOf(owner); //@audit amount:DATA, balanceOf:Opera...
high
```\nfunction requestWithdraw(\n Types.State storage state,\n address from,\n uint256 primaryAmount,\n uint256 secondaryAmount\n)\n external\n{\n require(isWithdrawValid(state, msg.sender, from, primaryAmount, secondaryAmount), Errors.WITHDRAW_INVALID);\n state.pendingPrimaryWithdraw[msg.sender] = ...
medium
```\nfunction makeSplitImmutable(address split)\n external\n override\n onlySplitController(split)\n{\n delete splits[split].newPotentialController;\n emit ControlTransfer(split, splits[split].controller, address(0));\n splits[split].controller = address(0);\n}\n```\n
none
```\n IERC20 weth = IERC20(address(0xc778417E063141139Fce010982780140Aa0cD5Ab)); // rinkeby weth\n```\n
low
```\ncontract TokenBridge is ITokenBridge, PausableUpgradeable, OwnableUpgradeable {\n```\n
low
```\n if (isLong) {\n uint swapFeeBP = getSwapFeeBP(isLong, true, collateralDelta);\n collateralDelta = (collateralDelta * (BASIS_POINTS_DIVISOR + swapFeeBP)) / BASIS_POINTS_DIVISOR;\n }\n // add margin fee\n // when we increase position, fee always got deducted from collateral\n ...
high
```\nfunction convertToPeUSD(address user, uint256 eusdAmount) public {\n require(\_msgSender() == user || \_msgSender() == address(this), "MDM");\n require(eusdAmount != 0, "ZA");\n require(EUSD.balanceOf(address(this)) + eusdAmount <= configurator.getEUSDMaxLocked(),"ESL");\n```\n
medium
```\nfunction _claimRewards(\n address gauge,\n address defaultToken,\n address sendTo\n) internal returns (uint256[] memory amounts, address[] memory tokens) {\n // rest of code \n\n // Record balances before claiming\n for (uint256 i = 0; i < totalLength; ++i) {\n // The totalSupply check is ...
medium
```\n// If the funding timeout has elapsed, punish the funder too!\nif (block.timestamp > \_d.fundingProofTimerStart + TBTCConstants.getFundingTimeout()) {\n address(0).transfer(address(this).balance); // Burn it all down (fire emoji)\n \_d.setFailedSetup();\n```\n
medium
```\nuint256 currentSharePrice = ethStEthPool.get\_virtual\_price();\nif (currentSharePrice > prevSharePrice) {\n // claim any gain on lp token yields\n uint256 contractLpTokenBalance = lpToken.balanceOf(address(this));\n uint256 totalLpBalance = contractLpTokenBalance +\n baseRewardPool.balanceOf(addre...
high
```\nfunction liquidateSecondary(\n address asset,\n MTypes.BatchMC[] memory batches,\n uint88 liquidateAmount,\n bool isWallet\n ) external onlyValidAsset(asset) isNotFrozen(asset) nonReentrant {\n // Initial code\n\n emit Events.LiquidateSecondary(asset, batches, msg.sende...
low
```\n function increaseLiquidity(IncreaseLiquidityParams calldata params)\n external payable override checkDeadline(params.deadline)\n returns (\n uint128 liquidity, uint256 amount0, uint256 amount1)\n {\n Position storage position ...
high
```\nfunction submitNewGuardianSet(bytes memory _vm) public {\n // rest of code\n\n // Trigger a time-based expiry of current guardianSet\n expireGuardianSet(getCurrentGuardianSetIndex());\n\n // Add the new guardianSet to guardianSets\n storeGuardianSet(upgrade.newGuardianSet, upgrade.newGuardianSetInde...
low
```\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
```\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 setMaxGauges(uint256 newMax) external requiresAuth {\n uint256 oldMax = maxGauges;\n maxGauges = newMax;\n\n emit MaxGaugesUpdate(oldMax, newMax);\n}\n```\n
low
```\nabstract contract ERC721PausableUpgradeable is Initializable, ERC721Upgradeable, PausableUpgradeable {\n function \_\_ERC721Pausable\_init() internal initializer {\n \_\_Context\_init\_unchained(); \n \_\_ERC165\_init\_unchained();\n \_\_Pausable\_init\_unchained();\n \_\_ERC721Pausa...
low
```\nfunction transferFrom(\n address sender,\n address recipient,\n uint256 amount\n) external override returns (bool) {\n address spender = msg.sender;\n //check allowance requirement\n _spendAllowance(sender, spender, amount);\n return _transferFrom(sender, recipient, amount);\n}\n```\n
none
```\nfunction excludeFromFee(address account) public onlyOwner {\n _isExcludedFromFee[account] = true;\n emit ExcludeFromFeeUpdated(account);\n}\n```\n
none
```\nRunning 1 test for test/scenario/BorrowAndRepay.scenario.t.sol:BorrowAndRepay_Scenario_Test\n[PASS] testScenario_Poc() (gas: 799155)\nLogs:\n 100 initial pool balance. This is also the amount deposited into tranche\n warp 2 minutes into future\n mint was used rather than deposit to ensure no rounding error. Thi...
medium
```\nfunction updatePillMintMerkleRoot(bytes32 hash)\n external\n onlyOwner\n returns (bool)\n{\n merkleRootOfPillMintWhitelistAddresses = hash;\n emit UpdatedMerkleRootOfPillMint(hash, msg.sender);\n\n return true;\n}\n```\n
none
```\npoolInfo.accTidalPerShare = poolInfo.accTidalPerShare.add(\n amount\_.mul(SHARE\_UNITS)).div(poolInfo.totalShare);\n```\n
high
```\nfunction byteLength(ShortString sstr) internal pure returns (uint256) {\n uint256 result = uint256(ShortString.unwrap(sstr)) & 0xFF;\n if (result > 31) {\n revert InvalidShortString();\n }\n return result;\n}\n```\n
none
```\nfunction plunder(\n address erc721,\n uint256 tokenId,\n IERC20[] calldata erc20s,\n LootBox.WithdrawERC721[] calldata erc721s,\n LootBox.WithdrawERC1155[] calldata erc1155s\n) external {\n address payable owner = payable(IERC721(erc721).ownerOf(tokenId));\n```\n
medium
```\nfunction getTellorCurrentValue(bytes32 _queryId)\n ..SNIP..\n // retrieve most recent 20+ minute old value for a queryId. the time buffer allows time for a bad value to be disputed\n (, bytes memory data, uint256 timestamp) = tellor.getDataBefore(_queryId, block.timestamp - 20 minutes);\n uint256 _value =...
medium
```\nFile: wfCashLogic.sol\n function _lendLegacy(\nFile: wfCashLogic.sol\n // If deposit amount external is in excess of the cost to purchase fCash amount (often the case),\n // then we need to return the difference between postTradeCash - preTradeCash. This is done because\n // the encoded tra...
high
```\nfunction getAccountDividendsInfoAtIndex(uint256 index) external view returns (address, int256, int256,\n uint256, uint256, uint256) {\n return dividendTracker.getAccountAtIndex(index);\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
```\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 require(s.ss[token].milestoneSeason == 0, "Whitelist: Token already whitelisted");\n```\n
medium
```\nfunction _takeLiquidity(uint256 tLiquidity) private {\n uint256 currentRate = _getRate();\n uint256 rLiquidity = tLiquidity.mul(currentRate);\n _rOwned[address(this)] = _rOwned[address(this)].add(rLiquidity);\n if (_isExcluded[address(this)])\n _tOwned[address(this)] = _tOwned[address(this)].add...
none
```\nfunction isContract(address account) internal view returns (bool) {\n // This method relies on extcodesize, which returns 0 for contracts in\n // construction, since the code is only stored at the end of the\n // constructor execution.\n\n uint256 size;\n assembly {\n size := extcodesize(acco...
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
```\ncontract WFTMUnwrapper {\n address constant wftm = 0x21be370D5312f44cB42ce377BC9b8a0cEF1A4C83;\n\n receive() external payable {}\n\n /\*\*\n \* @notice Convert WFTM to FTM and transfer to msg.sender\n \* @dev msg.sender needs to send WFTM before calling this withdraw\n \* @param \_amount amount to withdraw.\n \*/\...
low
```\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