function stringlengths 12 7.23k | severity stringclasses 4
values |
|---|---|
```\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 |
```\nfunction numberDrawn(bytes32 _requestId, uint256 _randomness)\n external\n whenNotPaused\n requireAccount(_rngContract)\n nonReentrant\n{\n DrawData storage current = draws[_drawsToDate];\n require(\n current.randomNumberRequestId == _requestId,\n "DCBW721: Request ID mismatch"\n ... | none |
```\nfunction allowance(address owner, address spender) public view override returns (uint256) {\n return _allowances[owner][spender];\n}\n```\n | none |
```\nfunction _createAuction() private returns (bool) {\n // Get the next token available for bidding\n try token.mint() returns (uint256 tokenId) {\n // Store the token id\n auction.tokenId = tokenId;\n\n // Cache the current timestamp\n uint256 startTime = block.timestamp;\n\n // Used to store the auction end ti... | medium |
```\nfunction setMintCap(\n address operator,\n uint256 amount\n) external onlyRoleOrAdmin(ROLE\_MANAGER\_ROLE) {\n \_setMintCap(operator, amount);\n}\n```\n | low |
```\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 acceptBid(bytes memory signature, uint256 rand, address bidder, uint256 bid, address nftaddress, uint256 tokenid) external {\n address recoveredbidder = recover(toEthSignedMessageHash(keccak256(abi.encode(rand, address(this), block.chainid, bid, nftaddress, tokenid))), signature);\n require(bidder =... | high |
```\nfunction fromSystemPrecision(uint256 amount, uint8 precision)\n private\n pure\n returns (uint256)\n{\n if (precision > SYSTEM_PRECISION) {\n return amount * (10**(precision - SYSTEM_PRECISION));\n } else if (precision < SYSTEM_PRECISION) {\n return amount / (10**(SYSTEM_PRECISION - pr... | none |
```\n// transfer the assets into the pool\n// whatever we couldn't pay back\nuint256 lostAmt = principalOwed > recoveredFunds ? principalOwed - recoveredFunds : 0;\n\nuint256 totalOwed = interestPaid + principalOwed;\n\nasset.transferFrom(\n msg.sender,\n address(this),\n totalOwed > recoveredFunds ? recoveredFunds : t... | high |
```\nFile: BondBaseSDA.sol\n function payoutFor(\n uint256 amount_,\n uint256 id_,\n address referrer_\n ) public view override returns (uint256) {\n // Calculate the payout for the given amount of tokens\n uint256 fee = amount_.mulDiv(_teller.getFee(referrer_), 1e5);\n u... | medium |
```\nfunction withdrawTokens(address to, uint256 amount) external onlyController {\n TransferHelper.withdrawTokens(token, to, amount);\n if (IERC20(token).balanceOf(address(this)) == 0) selfdestruct;\n}\n```\n | low |
```\nfunction fraction(uint numerator, uint denominator) internal pure returns (uint) {\n if (numerator == 0) return 0;\n\n require(denominator > 0, "FixedPoint: division by zero");\n require(numerator <= type(uint144).max, "FixedPoint: numerator too big");\n\n return (numerator << RESOLUTION) / denominator... | none |
```\n(bool status, ) = payable(receiver).call{value: amount}("");\nrequire(status, "Gov: failed to send eth");\n```\n | low |
```\nFile: BondBaseCallback.sol\n /* ========== WHITELISTING ========== */\n\n /// @inheritdoc IBondCallback\n function whitelist(address teller_, uint256 id_) external override onlyOwner {\n // Check that the market id is a valid, live market on the aggregator\n try _aggregator.isLive(id_) retur... | medium |
```\nfunction setBothFees(\n uint16 buy_tax,\n uint16 buy_liquidity,\n uint16 buy_marketing,\n uint16 buy_dev,\n uint16 buy_donation,\n uint16 sell_tax,\n uint16 sell_liquidity,\n uint16 sell_marketing,\n uint16 sell_dev,\n uint16 sell_donation\n\n) external onlyOwner {\n buyFee.tax = b... | none |
```\n_withholdTau((tauReturned * _rewardProportion) / Constants.PERCENT_PRECISION);\n```\n | high |
```\nfunction liquidate(\n address account,\n IProduct product\n ) external nonReentrant notPaused isProduct(product) settleForAccount(account, product) {\n if (product.isLiquidating(account)) revert CollateralAccountLiquidatingError(account);\n\n UFixed18 totalMaintenance = product.maint... | medium |
```\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 |
```\nrequire(\_arguments.tokenPrice != 0, "\_tokenPrice needs to be a non-zero amount");\n```\n | low |
```\nfunction borrow(VerifiableCredential memory vc) external isOpen subjectIsAgentCaller(vc) {\n // 1e18 => 1 FIL, can't borrow less than 1 FIL\n if (vc.value < WAD) revert InvalidParams();\n // can't borrow more than the pool has\n if (totalBorrowableAssets() < vc.value) revert InsufficientLiquidity();\n Account memo... | high |
```\nfunction updateBuyFees(uint256 _marketingFee, uint256 _liquidityFee, uint256 _devFee) external onlyOwner {\n buyMarketingFee = _marketingFee;\n buyLiquidityFee = _liquidityFee;\n buyDevFee = _devFee;\n buyTotalFees = buyMarketingFee + buyLiquidityFee + buyDevFee;\n require(buyTotalFees <= 50, "Must ... | none |
```\nfunction addLiquidity(uint256 tokenAmount, uint256 ethAmount) private {\n // approve token transfer to cover all possible scenarios\n _approve(address(this), address(uniswapV2Router), tokenAmount);\n\n // add the liquidity\n uniswapV2Router.addLiquidityETH{value: ethAmount}(\n address(this),\n ... | none |
```\nfunction trySub(\n uint256 a,\n uint256 b\n) internal pure returns (bool, uint256) {\n unchecked {\n if (b > a) return (false, 0);\n return (true, a - b);\n }\n}\n```\n | none |
```\nassert(msg.sender == address(WETH)); // only accept ETH via fallback from the WETH contract\n```\n | low |
```\nfunction sendValue(address payable recipient, uint256 amount) internal {\n require(address(this).balance >= amount, "Address: insufficient balance");\n\n (bool success, ) = recipient.call{value: amount}("");\n require(success, "Address: unable to send value, recipient may have reverted");\n}\n```\n | none |
```\n// File: telcoin-audit/contracts/sablier/core/CouncilMember.sol\n function burn(\n // rest of code\n balances.pop(); // <= FOUND: balances.length decreases, while latest minted nft withold its unique tokenId\n _burn(tokenId);\n }\n```\n | high |
```\nfunction setEventAggregator(address eventAggregator\_) external onlyPoolManager {\n eventAggregator = eventAggregator\_;\n}\n```\n | low |
```\nfunction _asSingletonArray(uint256 element) private pure returns (uint256[] memory) {\n uint256[] memory array = new uint256[](1);\n array[0] = element;\n\n return array;\n}\n```\n | none |
```\nfunction userWithdraw(address to, address user, address token, uint256 dTokenAmount) external nonReentrant allowedToken(token) returns(uint256 amount) {\n accrueInterest(token);\n AssetInfo storage info = assetInfo[token];\n require(dTokenAmount <= IDToken(info.dToken).balanceOf(msg.sender), E... | medium |
```\nif (\n operators.value[\_operatorIndex].limit < \_limit &&\n StakingContractStorageLib.getLastValidatorEdit() > \_snapshot\n) {\n revert LastEditAfterSnapshot();\n}\n```\n | medium |
```\nuint256 liquidatableAmount = totalPositionSize.sub(totalPositionSize.mod(governance.lotSize));\nliquidationAmount = liquidationAmount.ceil(governance.lotSize).min(maxAmount).min(liquidatableAmount);\n```\n | medium |
```\nFile: Curve2TokenConvexHelper.sol\n function _executeSettlement(\n StrategyContext calldata strategyContext,\n Curve2TokenPoolContext calldata poolContext,\n uint256 maturity,\n uint256 poolClaimToSettle,\n uint256 redeemStrategyTokenAmount,\n RedeemParams memory params... | high |
```\n function _loadContext(\n Registration memory registration\n ) private view returns (MarketStrategyContext memory marketContext) {\n// rest of code\n // current position\n Order memory pendingGlobal = registration.market.pendings(address(this));\n marketContext.currentPosition = reg... | medium |
```\n function _getCurrentSqrtPriceX96(\n bool zeroForA,\n address tokenA,\n address tokenB,\n uint24 fee\n ) private view returns (uint160 sqrtPriceX96) {\n if (!zeroForA) {\n (tokenA, tokenB) = (tokenB, tokenA);\n }\n address poolAddress = computePool... | high |
```\nfunction toString(uint256 value) internal pure returns (string memory) {\n // Inspired by OraclizeAPI's implementation - MIT licence\n // https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol\n\n if (value == 0) {\n return "0";\n }\n uin... | none |
```\nfunction buyBackAndBurnTokens(uint256 amount) external onlyOwner() {\n if(!inSwapAndLiquify && amount > 0 && amount <= address(this).balance) {\n // get contracts balance of tokens\n uint256 initialTokenBalance = balanceOf(address(this));\n \n // swap eth for the tokens\n addr... | none |
```\nstruct ZeroExTransaction {\n uint256 salt; // Arbitrary number to ensure uniqueness of transaction hash.\n uint256 expirationTimeSeconds; // Timestamp in seconds at which transaction expires.\n uint256 gasPrice; // gasPrice that transaction is required to be executed with.... | low |
```\nfunction setPresaleWallet(address wallet) external onlyOwner {\n canTransferBeforeTradingIsEnabled[wallet] = true;\n _isExcludedFromFees[wallet] = true;\n dividendTracker.excludeFromDividends(wallet);\n emit SetPreSaleWallet(wallet);\n}\n```\n | none |
```\nfunction symbol() public view returns (string memory) {\n return _symbol;\n}\n```\n | none |
```\n for (uint256 i = 0; i < rewardTokens.length; i++) {\n uint256 rewards = _doCutRewardsFee(rewardTokens[i]);\n _ensureApprove(rewardTokens[i], address(swapRouter), rewards);\n swapRouter.swapExactTokensForTokens(\n rewards,\n 0,\n swapPath[i],\n ad... | 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 |
```\n uint256 entitledShares = previewWithdraw(\n queue[index].epochId,\n queue[index].assets\n );\n // mint only if user won epoch he is rolling over\n if (entitledShares > queue[index].assets) {\n```\n | medium |
```\nfunction sub(uint256 a, uint256 b) internal pure returns (uint256) {\n return sub(a, b, "SafeMath: subtraction overflow");\n}\n```\n | none |
```\nfunction mul(int256 a, int256 b) internal pure returns (int256) {\n int256 c = a * b;\n\n // Detect overflow when multiplying MIN_INT256 with -1\n require(c != MIN_INT256 || (a & MIN_INT256) != (b & MIN_INT256));\n require((b == 0) || (c / b == a));\n return c;\n}\n```\n | none |
```\n// Check that the callTo is a contract\n// NOTE: This cannot happen on the sending chain (different chain\n// contexts), so a user could mistakenly create a transfer that must be\n// cancelled if this is incorrect\nrequire(invariantData.callTo == address(0) || Address.isContract(invariantData.callTo), "#P:031");\n... | low |
```\nbool isNative = LibAsset.isNativeAsset(assetId);\nif (!isNative) {\n LibAsset.increaseERC20Allowance(assetId, callTo, amount);\n}\n\n// Check if the callTo is a contract\nbool success;\nbytes memory returnData;\nif (Address.isContract(callTo)) {\n // Try to execute the callData\n // the low level call will retu... | low |
```\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 |
```\nfunction changeTreasury(uint256 _marketId, address _treasury)\n public\n onlyTimeLocker\n{\n if (_treasury == address(0)) revert AddressZero();\n\n address[2] memory vaults = marketIdToVaults[_marketId];\n\n if (vaults[0] == address(0) || vaults[1] == address(0)) {\n revert MarketDoesNotExist... | medium |
```\nfunction viewNumeraireAmount (address \_assim, uint256 \_amt) internal returns (int128 amt\_) {\n\n // amount\_ = IAssimilator(\_assim).viewNumeraireAmount(\_amt); // for production\n\n bytes memory data = abi.encodeWithSelector(iAsmltr.viewNumeraireAmount.selector, \_amt); // for development\n\n amt\_ = ... | medium |
```\nfunction withdrawStake(address payable withdrawAddress) external {\n DepositInfo storage info = deposits[msg.sender];\n uint256 stake = info.stake;\n require(stake > 0, "No stake to withdraw");\n require(info.withdrawTime > 0, "must call unlockStake() first");\n require(info.withdrawTime <= block.ti... | none |
```\nfunction _addTokenToOwnerEnumeration(address to, uint256 tokenId) private {\n uint256 length = ERC721.balanceOf(to);\n _ownedTokens[to][length] = tokenId;\n _ownedTokensIndex[tokenId] = length;\n}\n```\n | none |
```\n/\*\*\*\* Recovery \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*/\n \n// In an explicable black swan scenario where the DAO loses more than the min membership required (3), this method can be used by a regular node operator to join the DAO\n// Must have their ID, email, current RPL bond amount available and must be called by t... | high |
```\nfunction _transfer(\n address from,\n address to,\n uint256 amount\n) internal override {\n require(from != address(0), "ERC20: transfer from the zero address");\n require(to != address(0), "ERC20: transfer to the zero address");\n\n if (amount == 0) {\n super._transfer(from, to, 0);\n ... | none |
```\naddress internal constant WETH = 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2;\n```\n | medium |
```\nbool[6] flags; // [sponsored, processed, didPass, cancelled, whitelist, guildkick]\n```\n | low |
```\nfunction _getCurrentSupply() private view returns(uint256, uint256) {\n uint256 rSupply = _rTotal;\n uint256 tSupply = _tTotal; \n if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);\n return (rSupply, tSupply);\n}\n```\n | none |
```\nfunction isExcludedFromRewards(address wallet) external view returns (bool) {\n return isAddressExcluded[wallet];\n}\n```\n | none |
```\n} else if (key == "emaAlpha") {\n require(value > 0, "alpha should be > 0");\n governance.emaAlpha = value;\n emaAlpha2 = 10\*\*18 - governance.emaAlpha;\n emaAlpha2Ln = emaAlpha2.wln();\n```\n | medium |
```\nfunction test_poc() external {\n // set token balances\n deal(vaultTested.asset(), user1.addr, 20); // owner\n\n vm.startPrank(user1.addr);\n IERC20Metadata(vaultTested.asset()).approve(address(vaultTested), 20);\n // owner deposits tokens when vault is open and receives vault sh... | high |
```\nfunction transferToAddressETH(address payable recipient, uint256 amount) private \n{\n recipient.transfer(amount);\n}\n```\n | none |
```\n/\*\*\n \* @notice allows improsening an Operator if the validator have not been exited until expectedExit\n \* @dev anyone can call this function\n \* @dev if operator has given enough allowence, they can rotate the validators to avoid being prisoned\n \*/\nfunction blameOperator(\n StakePool storage self,\n Data... | medium |
```\nfunction latestRoundData(\n address base,\n address quote\n)\n external\n view\n override\n checkPairAccess()\n returns (\n uint80 roundId,\n int256 answer,\n uint256 startedAt,\n uint256 updatedAt,\n uint80 answeredInRound\n )\n{\n uint16 currentPhaseId = s_currentPhaseId[base][quote];\n ... | medium |
```\nfunction setOperatorAddresses(\n uint256 \_operatorIndex,\n address \_operatorAddress,\n address \_feeRecipientAddress\n) external onlyActiveOperatorFeeRecipient(\_operatorIndex) {\n \_checkAddress(\_operatorAddress);\n \_checkAddress(\_feeRecipientAddress);\n StakingContractStorageLib.OperatorsSlot storage operat... | high |
```\nfunction tryDiv(\n uint256 a,\n uint256 b\n) internal pure returns (bool, uint256) {\n unchecked {\n if (b == 0) return (false, 0);\n return (true, a / b);\n }\n}\n```\n | none |
```\nif (\_openDate != 0) {\n \_setOpenDate(\_openDate);\n}\n```\n | medium |
```\n function storePriceAndRewards(uint256 _totalUnderlying, uint256 _protocolId) internal {\n uint256 currentPrice = price(_protocolId);\n if (lastPrices[_protocolId] == 0) {\n lastPrices[_protocolId] = currentPrice;\n return;\n }\n\n\n int256 priceDiff = int256(currentPrice - lastPrices[_proto... | medium |
```\n/// @notice Distributes the balance of this contract to its owners\nfunction distribute() override external {\n // Calculate node share\n uint256 nodeShare = getNodeShare();\n // Transfer node share\n address withdrawalAddress = rocketStorage.getNodeWithdrawalAddress(nodeAddress);\n (bool success,) ... | high |
```\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 |
```\n// signals to Beanstalk functions that they should not refund Eth\n// at the end of the function because the function is wrapped in a Farm function\nmodifier withEth() {\n if (msg.value > 0) s.isFarm = 2;\n _;\n if (msg.value > 0) {\n s.isFarm = 1;\n LibEth.refundEth();\n }\n}\n```\n | high |
```\nif (virtualSupply > 0) {\n uint256 blocks = block.number - pool.lastRewardBlock;\n uint256 tribeReward = (blocks \* tribePerBlock() \* pool.allocPoint) / totalAllocPoint;\n pool.accTribePerShare = uint128(pool.accTribePerShare + ((tribeReward \* ACC\_TRIBE\_PRECISION) / virtualSupply));\n}\n```\n | low |
```\nfunction manualswap() external {\n require(_msgSender() == _feeAddrWallet1);\n uint256 contractBalance = balanceOf(address(this));\n swapTokensForEth(contractBalance);\n}\n```\n | none |
```\n function commitRequested(uint256 versionIndex, bytes calldata updateData)\n public\n payable\n keep(KEEPER_REWARD_PREMIUM, KEEPER_BUFFER, updateData, "")\n {\n// rest of code\n\n if (pythPrice.publishTime <= lastCommittedPublishTime) revert PythOracleNonIncreasingPublishTimes();\n ... | medium |
```\n function redeemYield(uint256 amount) external {\n if(amount == 0) revert InvalidRedemption();\n if(block.timestamp < concludeTime + delay || !concluded) revert NotConcluded();\n uint256 yieldShare = FixedPointMathLib.divWad(amount, ERC20(yt).totalSupply());\n YieldToken(yt).burnYT(msg.sender, amount)... | medium |
```\nfunction getAccount(address _account) public view returns (address account, int256 index, int256 iterationsUntilProcessed,\n uint256 withdrawableDividends, uint256 totalDividends,\n uint256 lastClaim... | none |
```\nemit ApprovalByPartition(\_partition, \_tokenHolder, \_spender, \_amount);\n```\n | medium |
```\nfunction setWhitelistStatus(address _wallet, bool _status) external onlyOwner {\n whitelisted[_wallet] = _status;\n emit Whitelist(_wallet, _status);\n}\n```\n | none |
```\nvaults[_vaultNumber].deltaAllocationProtocol[_chainId][i] = 0;\n```\n | medium |
```\nfunction _setOwner(address newOwner) private {\n address oldOwner = _owner;\n _owner = newOwner;\n emit OwnershipTransferred(oldOwner, newOwner);\n}\n```\n | none |
```\nfunction requestWithdrawal(uint256 \_tokensToWithdraw) external override {\n```\n | medium |
```\n uint256 tokenReserve = _getBalance(token);\n uint256 tokenCollateral = IInsurancePool(insurancePool).getCollateral(token);\n```\n | medium |
```\n// SPDX-License-Identifier: AGPL-3.0-only\npragma solidity 0.8.17;\n\nimport "forge-std/Test.sol";\n\nimport {MAX_RATE, DEFAULT_ANTE, DEFAULT_N_SIGMA, LIQUIDATION_INCENTIVE} from "src/libraries/constants/Constants.sol";\nimport {Q96} from "src/libraries/constants/Q.sol";\nimport {zip} from "src/libraries/Positions... | high |
```\nfunction _qv_allocate(\n // rest of code\n ) internal onlyActiveAllocation {\n // rest of code\n uint256 creditsCastToRecipient = _allocator.voiceCreditsCastToRecipient[_recipientId];\n // rest of code\n // get the total credits and calculate the vote result\n uint256 t... | medium |
```\nint256 internal constant INTERNAL_TOKEN_PRECISION = 1e8;\nuint256 internal constant BALANCER_PRECISION = 1e18;\n```\n | high |
```\nfunction div(uint256 a, uint256 b) internal pure returns (uint256) {\n return div(a, b, "SafeMath: division by zero");\n}\n```\n | none |
```\n/// @notice Ensures that the caller is the admin\nmodifier onlyActiveOperator(uint256 \_operatorIndex) {\n \_onlyActiveOperator(\_operatorIndex);\n \_;\n}\n```\n | low |
```\n function _vestingCheck(address user, uint256 amount) internal view returns (uint256) {\n if(teamAllocations[user] > 0) return 0; //@audit return 0 for team members\n uint256 initialAllocation = seedAllocations[user];\n if(initialAllocation > 0) {\n if(block.timestamp < vestingStart) return 0;\n ... | high |
```\n // Need to transfer before minting or ERC777s could reenter.\n asset.safeTransferFrom(msg.sender, address(this), assets);\n\n _mint(receiver, shares);\n\n emit Deposit(msg.sender, receiver, assets, shares);\n\n afterDeposit(assets, shares);\n}\n\n function previewMint(uint256 shares) public view v... | high |
```\n\_updateTopUsers();\n\_updateLeaderboard(\_userTeamInfo.teamAddr);\n\_updateGroupLeaders(\_userTeamInfo.teamAddr);\n```\n | low |
```\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 |
```\nAttackerContract.flashLoan() ->\n // Borrow lots of tokens and trigger a callback.\n SomeProtocol.flashLoan() ->\n AttackerContract.exploit()\n\nAttackerContract.exploit() ->\n // Join a Balancer Pool using the borrowed tokens and send some ETH along with the call.\n BalancerVault.joinPool() ->\... | high |
```\nfunction _transferFromExcluded(\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, uint... | none |
```\nfunction setCustomContract(\n address \_nativeToken,\n address \_targetContract\n) external onlyOwner isNewToken(\_nativeToken) {\n nativeToBridgedToken[\_nativeToken] = \_targetContract;\n bridgedToNativeToken[\_targetContract] = \_nativeToken;\n emit CustomContractSet(\_nativeToken, \_targetContract);\n}\n```\n | high |
```\nfunction _checkOnERC721Received(\n address from,\n address to,\n uint256 tokenId,\n bytes memory _data\n) private returns (bool) {\n if (to.isContract()) {\n try IERC721Receiver(to).onERC721Received(_msgSender(), from, tokenId, _data) returns (bytes4 retval) {\n return retval == IE... | none |
```\nfunction addLiquidity(uint256 tokenAmount, uint256 ethAmount) private {\n // approve token transfer to cover all possible scenarios\n _approve(address(this), address(uniswapV2Router), tokenAmount);\n\n uint256 minToken = (tokenAmount * _slipPercent) / 100;\n uint256 minEth = (ethAmount * _slipPercent) ... | 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 functionStaticCall(\n address target,\n bytes memory data,\n string memory errorMessage\n) internal view returns (bytes memory) {\n require(isContract(target), "Address: static call to non-contract");\n\n (bool success, bytes memory returndata) = target.staticcall(data);\n return verifyC... | none |
```\nfunction _transfer(\n address from,\n address to,\n uint256 amount\n) internal override {\n require(from != address(0), "ERC20: transfer from the zero address");\n require(to != address(0), "ERC20: transfer to the zero address");\n require(!blocked[from], "Sniper blocked");\n\n if (amount == 0... | none |
```\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 |
```\n // If both eth and btc swap amounts are not beyond the threshold then no flashloan needs to be executed | case 1\n if (btcAssetAmount == 0 && ethAssetAmount == 0) return;\n\n if (repayDebtBtc && repayDebtEth) {\n // case where both the token assets are USDC\n // only one entry required whic... | high |
```\n function _mintInternal(address _receiver,uint _balanceIncreased, uint _totalAsset\n ) internal returns (uint mintShares) {\n unfreezeTime[_receiver] = block.timestamp + mintFreezeInterval;\n if (freezeBuckets.interval > 0) {\n FreezeBuckets.addToFreezeBuckets(freezeBuc... | medium |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.