function stringlengths 12 63.3k | severity stringclasses 4
values |
|---|---|
```\n function _openQueuedTrade(uint256 queueId, uint256 price) internal {\n// rest of code\n if (revisedFee < queuedTrade.totalFee) {\n tokenX.transfer( //***@audit call transfer , if ERC777 , can re-enter ***/\n queuedTrade.user,\n queuedTrade.totalFee - revisedFee\n... | medium |
```\nfunction setContractAddress(bytes32 name, address addr) public returns (bool) {\n require(name > 0x0000000000000000000000000000000000000000000000000000000000000000, "Contract name must not be empty.");\n require(isAuthorized(msg.sender), "Not authorized to update contract registry.");\n\n ContractDetails ... | 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 |
```\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 toBytes32(bytes memory \_source) pure internal returns (bytes32 result) {\n bytes memory tempEmptyStringTest = bytes(\_source);\n if (tempEmptyStringTest.length == 0) {\n return 0x0;\n }\n\n assembly {\n result := mload(add(\_source, 32))\n }\n}\n```\n | low |
```\nfunction freeze (bool \_freeze) public onlyOwner {\n frozen = \_freeze;\n}\n```\n | low |
```\n function isAdminOfHat(address _user, uint256 _hatId) public view returns (bool isAdmin) {\n uint256 linkedTreeAdmin;\n uint32 adminLocalHatLevel;\n if (isLocalTopHat(_hatId)) {\n linkedTreeAdmin = linkedTreeAdmins[getTopHatDomain(_hatId)];\n if (linkedTreeAdmin == 0) ... | medium |
```\nconstructor() {\n _transferOwnership(_msgSender());\n}\n```\n | none |
```\nfunction getOperatorUtilizationHeapForETH(RioLRTOperatorRegistryStorageV1.StorageV1 storage s)\n internal\n view\n returns (OperatorUtilizationHeap.Data memory heap)\n {\n uint8 numActiveOperators = s.activeOperatorCount;\n if (numActiveOperators == 0) return OperatorUtilizati... | high |
```\nfunction priceCollateralToUSD(bytes32 _currencyKey, uint256 _amount) public view override returns(uint256){\n //The LiquidityPool associated with the LP Token is used for pricing\n ILiquidityPoolAvalon LiquidityPool = ILiquidityPoolAvalon(collateralBook.liquidityPoolOf(_currencyKey));\n //we have already... | medium |
```\nFile: VaultAccount.sol\n function repayAccountPrimeDebtAtSettlement(\n PrimeRate memory pr,\n VaultStateStorage storage primeVaultState,\n uint16 currencyId,\n address vault,\n address account,\n int256 accountPrimeCash,\n int256 accountPrimeStorageValue\n ) i... | high |
```\n uint256 balanceBefore = getVaultBalance() - reservedFunds;\n vaultCurrency.safeTransferFrom(msg.sender, address(this), _amount);\n uint256 balanceAfter = getVaultBalance() - reservedFunds;\n uint256 amount = balanceAfter - balanceBefore;\n```\n | medium |
```\nfunction \_updateInterest() internal virtual override {\n InterestLocalVars memory \_vars;\n \_vars.currentCash = \_getCurrentCash();\n \_vars.totalBorrows = totalBorrows;\n \_vars.totalReserves = totalReserves;\n\n // Gets the current borrow interest rate.\n \_vars.borrowRate = interestRateModel... | medium |
```\nFile: VaultLiquidationAction.sol\n function _authenticateDeleverage(\n address account,\n address vault,\n address liquidator\n ) private returns (\n VaultConfig memory vaultConfig,\n VaultAccount memory vaultAccount,\n VaultState memory vaultState\n ) {\n ... | medium |
```\nFile: factory/PoolFactory.sol\n\n return keccak256(abi.encodePacked(deployer, poolName));\n```\n | low |
```\nfunction bridge(\n uint32 routeId,\n bytes memory data\n) external payable returns (bytes memory);\n```\n | low |
```\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 |
```\n// UsdoOptionReceiverModule.sol\n\nfunction exerciseOptionsReceiver(address srcChainSender, bytes memory _data) public payable {\n \n // rest of code \n \n ITapiocaOptionBroker(_options.target).exerciseOption(\n _options.oTAPTokenID,\n address(this), //payment toke... | medium |
```\nbytes32 tempHash = keccak256(\n abi.encodePacked(\n \_url,\n \_props,\n \_timeout,\n \_weight,\n msg.sender\n )\n);\n```\n | medium |
```\nfunction approveDomainBid(\n uint256 parentId,\n string memory bidIPFSHash,\n bytes memory signature\n) external authorizedOwner(parentId) {\n bytes32 hashOfSig = keccak256(abi.encode(signature));\n approvedBids[hashOfSig] = true;\n emit DomainBidApproved(bidIPFSHash);\n}\n```\n | high |
```\n function addToTotalRewards(uint256 _basketId) internal onlyBasketOwner(_basketId) {\n if (baskets[_basketId].nrOfAllocatedTokens == 0) return;\n\n\n uint256 vaultNum = baskets[_basketId].vaultNumber;\n uint256 currentRebalancingPeriod = vaults[vaultNum].rebalancingPeriod;\n uint256 lastRebalancingPer... | medium |
```\nfunction _transfer(address from, address to, uint256 amount) private {\n require(from != address(0), "ERC20: transfer from the zero address");\n require(to != address(0), "ERC20: transfer to the zero address");\n require(amount > 0, "Transfer amount must be greater than zero");\n bool takeFee;\n uin... | none |
```\nstring private s_password;\n```\n | high |
```\n function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) {\n _transfer(sender, recipient, amount);\n _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));\n return true;\n }... | medium |
```\nFile: ConvexStakingMixin.sol\n function _isInvalidRewardToken(address token) internal override view returns (bool) {\n return (\n token == TOKEN_1 ||\n token == TOKEN_2 ||\n token == address(CURVE_POOL_TOKEN) ||\n token == address(CONVEX_REWARD_POOL) ||\n ... | medium |
```\nFile: LiquidationFacetImpl.sol\n function liquidatePartyA(address partyA, SingleUpnlSig memory upnlSig) internal {\n MAStorage.Layout storage maLayout = MAStorage.layout();\n\n LibMuon.verifyPartyAUpnl(upnlSig, partyA);\n int256 availableBalance = LibAccount.partyAAvailableBalanceForLiquida... | high |
```\nFile: StableMath.sol\n function _calculateInvariant(\n uint256 amplificationParameter,\n uint256[] memory balances,\n bool roundUp\n ) internal pure returns (uint256) {\n /**********************************************************************************************\n // in... | high |
```\nfunction _withdrawERC20(address account, ERC20 token)\n internal\n returns (uint256 withdrawn)\n{\n // leave balance of 1 for gas efficiency\n // underflow if erc20Balance is 0\n withdrawn = erc20Balances[token][account] - 1;\n erc20Balances[token][account] = 1;\n token.safeTransfer(account, withdrawn);\n}\... | none |
```\n /// @notice Identifies the level a given hat in its hat tree\n /// @param _hatId the id of the hat in question\n /// @return level (0 to type(uint8).max)\n function getHatLevel(uint256 _hatId) public view returns (uint8) {\n```\n | medium |
```\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 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 |
```\n/// @notice Get the votes against count of this proposal\n/// @param _proposalID The ID of the proposal to query\n```\n | low |
```\nfunction removeAllFee() private {\n _taxFee = 0;\n _liquidityFee = 0;\n _marketingFee = 0;\n _donationFee = 0;\n _devFee = 0;\n}\n```\n | none |
```\n// UsdoOptionReceiverModule.sol\n\nfunction exerciseOptionsReceiver(address srcChainSender, bytes memory _data) public payable {\n // Decode received message.\n ExerciseOptionsMsg memory msg_ = UsdoMsgCodec.decodeExerciseOptionsMsg(_data);\n \n _checkWhitelistStatus(msg_.optionsData.target);\... | medium |
```\nfunction mint(uint256 shares, address receiver) public isOpen returns (uint256 assets) {\n if(shares == 0) revert InvalidParams();\n // These transfers need to happen before the mint, and this is forcing a higher degree of coupling than is ideal\n assets = previewMint(shares);\n asset.transferFrom(msg.sender, addr... | low |
```\n/* snip */\nfor (uint256 i = 0; i < instructionsLength; i++) {\n TransceiverInstruction memory instruction;\n (instruction, offset) = parseTransceiverInstructionUnchecked(encoded, offset);\n\n uint8 instructionIndex = instruction.index;\n\n // The instructions passed in have to be strictly increasing i... | high |
```\nfunction setAllowAutoReinvest(bool allow) public onlyOwner {\n dividendTracker.setAllowAutoReinvest(allow);\n}\n```\n | none |
```\n function claim() external {\n address sender = msg.sender;\n\n UserDetails storage s = userdetails[sender];\n require(s.userDeposit != 0, "No Deposit");\n require(s.index != vestingPoints.length, "already claimed");\n uint256 pctAmount;\n uint256 i = s.index;\n ... | medium |
```\nfunction functionDelegateCall(\n address target,\n bytes memory data,\n string memory errorMessage\n) internal returns (bytes memory) {\n require(isContract(target), "Address: delegate call to non-contract");\n\n (bool success, bytes memory returndata) = target.delegatecall(data);\n return verify... | none |
```\nfunction mod(uint256 a, uint256 b) internal pure returns (uint256) {\n return mod(a, b, "SafeMath: modulo by zero");\n}\n```\n | 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 |
```\n function _sqrtPriceX96ToUint(uint160 sqrtPriceX96) private pure returns (uint256)\n {\n uint256 numerator1 = uint256(sqrtPriceX96) * \n uint256(sqrtPriceX96);\n return FullMath.mulDiv(numerator1, 1, 1 << 192);\n }\n```\n | medium |
```\nfunction setMinimumWeight(uint32 \_minimumWeight)\n public\n ownerOnly\n inactive\n{\n //require(\_minimumWeight > 0, "Min weight 0");\n //\_validReserveWeight(\_minimumWeight);\n minimumWeight = \_minimumWeight;\n emit MinimumWeightUpdated(\_minimumWeight);\n}\n```\n | medium |
```\n for (uint256 i = 0; i < tokenList.length; i++) {\n address _token = tokenList[i];\n (address assetDToken,,,,,,,,,,) = d3Vault.getAssetInfo(_token);\n uint256 tokenBalance = IERC20(assetDToken).balanceOf(user);\n if (tokenBalance > 0) {\n tokenBalance = tokenBalance.mul(d3... | medium |
```\n function handleBadDebt(Types.State storage state, address liquidatedTrader)\n external\n {\n if (\n state.openPositions[liquidatedTrader].length == 0 &&\n !Liquidation._isSafe(state, liquidatedTrader)\n ) {\n int256 primaryCredit = state.primaryCredit[li... | medium |
```\nfunction withdrawnDividendOf(address _owner) public view override returns (uint256) {\n return withdrawnDividends[_owner];\n}\n```\n | none |
```\nmodifier onlyGovernance() {\n \_checkGovernance();\n \_;\n}\n```\n | low |
```\n uint256 intermediate = inWei.div(10**(token1.decimals() -\n token0.decimals()));\n```\n | medium |
```\nfunction canRemoveLiquidity(address target, bytes calldata data)\n internal\n view\n returns (bool, address[] memory, address[] memory)\n{\n (,uint256[2] memory amounts) = abi.decode(\n data[4:],\n (uint256, uint256[2])\n );\n\n address[] memory tokensOut = new address[](1);\n to... | high |
```\n function claimBids(uint96 lotId_, uint64[] calldata bidIds_) external override nonReentrant {\n \n // rest of code.\n\n for (uint256 i = 0; i < bidClaimsLen; i++) {\n Auction.BidClaim memory bidClaim = bidClaims[i];\n\n if (bidClaim.payout > 0) {\n \n=> ... | medium |
```\nfunction _transfer(\n address from,\n address to,\n uint256 amount\n) private {\n require(from != address(0), "ERC20: transfer from the zero address");\n require(to != address(0), "ERC20: transfer to the zero address");\n require(amount > 0, "Transfer amount must be greater than zero");\n requ... | none |
```\nfunction createTier(\n mapping(uint256 => ITokenSaleProposal.Tier) storage tiers,\n uint256 newTierId,\n ITokenSaleProposal.TierInitParams memory _tierInitParams\n ) external {\n\n // rest of code.\n /// @dev return value is not checked intentionally\n > tierInitParams.s... | high |
```\nfunction _callOptionalReturn(IERC20 token, bytes memory data) private {\n // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since\n // we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that\n // the targ... | none |
```\nfunction _updateVirtualPrice(uint256 _currentBlockTime, address _collateralAddress) internal { \n ( ,\n ,\n ,\n uint256 interestPer3Min,\n uint256 lastUpdateTime,\n uint256 virtualPrice,\n\n ) = _getCollateral(_collateralAddress);\n uint256 timeDelta = _currentBlockTim... | medium |
```\nfunction forceSwapAndSendDividends(uint256 tokens) public onlyOwner {\n tokens = tokens * (10**18);\n uint256 totalAmount = buyAmount.add(sellAmount);\n uint256 fromBuy = tokens.mul(buyAmount).div(totalAmount);\n uint256 fromSell = tokens.mul(sellAmount).div(totalAmount);\n\n swapAndSendDividends(to... | none |
```\n} else {\n // Check the votes, was it defeated?\n // if (votesFor <= votesAgainst || votesFor < getVotesRequired(\_proposalID))\n return ProposalState.Defeated;\n}\n```\n | low |
```\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(!_blacklist[to] && !_blacklist[from], "You have been blac... | none |
```\nfunction min(int256 x, int256 y) internal pure returns (int256 z) {\n return x <= y ? x : y;\n}\n\nfunction max(int256 x, int256 y) internal pure returns (int256 z) {\n return x >= y ? x : y;\n}\n```\n | low |
```\nfunction init(IWeightedPool \_pool) external {\n require(address(pool) == address(0), "BalancerLBPSwapper: initialized");\n\n pool = \_pool;\n IVault \_vault = \_pool.getVault();\n\n vault = \_vault;\n\n // Check ownership\n require(\_pool.getOwner() == address(this), "BalancerLBPSwapper: contrac... | medium |
```\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 |
```\nconstructor(string memory name_, string memory symbol_) {\n _name = name_;\n _symbol = symbol_;\n}\n```\n | none |
```\nFeeData.sol\n function setFeeValue(uint256 feeValue) external onlyOwner {\n require(feeValue < _feeDenominator, "Fee percentage must be less than 1");\n _feeValue = feeValue;\n }\n\n function setFixedFee(uint256 fixedFee) external onlyOwner {//@audit-issue validate min/max\n _fixedFee... | medium |
```\n function _addLiquidity(\n address token,\n uint256 tokenDesired,\n uint256 wethDesired,\n uint256 tokenMin,\n uint256 wethMin,\n GoatTypes.InitParams memory initParams\n ) internal returns (uint256, uint256, bool) {\n GoatTypes.LocalVariables_AddLiquidity mem... | medium |
```\nfunction totalSupply() public pure override returns (uint256) {\n return _tTotal;\n}\n```\n | none |
```\nfunction getPrice(address token) external view override returns (uint256) {\n IICHIVault vault = IICHIVault(token);\n uint256 totalSupply = vault.totalSupply();\n if (totalSupply == 0) return 0;\n\n address token0 = vault.token0();\n address token1 = vault.token1();\n\n (uint256 r0, uint256 r1) =... | medium |
```\n/// @notice Returns the total balance (in asset tokens). This includes the deposits and interest.\n/// @return The underlying balance of asset tokens\nfunction balanceOfToken(address addr) public override returns (uint256) {\n if (balances[addr] == 0) return 0;\n ISushiBar bar = ISushiBar(sushiBar);\n\n u... | medium |
```\nfunction _handlePostOp(uint256 opIndex, IPaymaster.PostOpMode mode, UserOpInfo memory opInfo, bytes memory context, uint256 actualGas) private returns (uint256 actualGasCost) {\n uint256 preGas = gasleft();\nunchecked {\n address refundAddress;\n MemoryUserOp memory mUserOp = opInfo.mUserOp;\n uint256 ... | none |
```\nFile: LiquidationFacetImpl.sol\n function setSymbolsPrice(address partyA, PriceSig memory priceSig) internal {\n..SNIP..\n if (accountLayout.liquidationDetails[partyA].liquidationType == LiquidationType.NONE) {\n accountLayout.liquidationDetails[partyA] = LiquidationDetail({\n l... | medium |
```\nfunction isReinvest(address account) external view returns (bool) {\n return dividendTracker.isReinvest(account);\n}\n```\n | none |
```\n function sendPacket(LZSendParam calldata _lzSendParam, bytes calldata _composeMsg)\n public\n payable\n whenNotPaused // @audit Pausing is not implemented yet.\n returns (MessagingReceipt memory msgReceipt, OFTReceipt memory oftReceipt)\n {\n (msgReceipt, oftReceipt) = abi... | medium |
```\nfunction calculateDonationFee(uint256 _amount)\n private\n view\n returns (uint256)\n{\n return _amount.mul(_donationFee).div(10**2);\n}\n```\n | none |
```\nfunction getTokenAmountOut(uint256 amountBNBIn)\n external\n view\n returns (uint256)\n{\n uint256 amountAfter = liqConst / (liquidity - amountBNBIn);\n uint256 amountBefore = liqConst / liquidity;\n return amountAfter - amountBefore;\n}\n```\n | none |
```\n function _mintVaultShares(uint256 lpTokens) internal returns (uint256 vaultShares) {\n StrategyVaultState memory state = VaultStorage.getStrategyVaultState();\n if (state.totalPoolClaim == 0) {\n // Vault Shares are in 8 decimal precision\n vaultShares = (lpTokens * uint256(Co... | medium |
```\n require(\n _commitment.principalTokenAddress ==\n commitments[_commitmentId].principalTokenAddress,\n "Principal token address cannot be updated."\n );\n require(\n _commitment.marketId == commitments[_commitmentId].marketId,\n "Market Id cannot be updated."\n );... | medium |
```\nfunction _removeTokenFromAllTokensEnumeration(uint256 tokenId) private {\n // To prevent a gap in the tokens array, we store the last token in the index of the token to delete, and\n // then delete the last slot (swap and pop).\n\n uint256 lastTokenIndex = _allTokens.length - 1;\n uint256 tokenIndex = ... | none |
```\n function rebalanceNeeded() public view returns (bool) {\n return (block.timestamp - lastTimeStamp) > rebalanceInterval || msg.sender == guardian;\n }\n```\n | medium |
```\nfunction isExcludedFromFees(address account) public view returns(bool) {\n return _isExcludedFromFees[account];\n}\n```\n | none |
```\nfunction \_afterMint() internal override {\n IPCVSwapper(target).swap();\n}\n```\n | medium |
```\nfunction setDividendsPaused(bool value) external onlyOwner {\n dividendTracker.setDividendsPaused(value);\n}\n```\n | none |
```\n if (self.delta == GMXTypes.Delta.Neutral) {\n (uint256 _tokenAWeight, ) = tokenWeights(self);\n\n\n uint256 _maxTokenALending = convertToUsdValue(\n self,\n address(self.tokenA),\n self.tokenALendingVault.totalAvailableAsset()\n ) * SAFE_MULTIPLIER\n / (self.leverage ... | medium |
```\nfunction safeIncreaseAllowance(\n IERC20 token,\n address spender,\n uint256 value\n) internal {\n uint256 newAllowance = token.allowance(address(this), spender) + value;\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\n}\n```\n | none |
```\nLien storage lien = lienData[lienId];\nlien.amount = _getOwed(lien); // @audit current debt, including accrued interest; saved to storage!\n```\n | high |
```\nfunction _setAutomatedMarketMakerPair(address pair, bool value) private {\n automatedMarketMakerPairs[pair] = value;\n\n if (value) {\n dividendTracker.excludeFromDividends(pair);\n }\n\n emit SetAutomatedMarketMakerPair(pair, value);\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 setLiquidityFeePercent(uint256 liquidityFee) external onlyOwner() {\n require(liquidityFee <= _maxLiquidityFee, "Liquidity fee must be less than or equal to _maxLiquidityFee");\n _liquidityFee = liquidityFee;\n emit LiquidityFeeUpdated(liquidityFee);\n}\n```\n | none |
```\nfunction renounceOwnership() external onlyOwner {\n _transferOwnership(address(0));\n}\n```\n | none |
```\n // This is called by the base ERC20 contract before all transfer, mint, and burns\n function _beforeTokenTransfer(address from, address, uint256) internal override {\n // Don't run check if this is a mint transaction\n if (from != address(0)) {\n // Check which block the user's last d... | medium |
```\nif (ownerCount >= maxSigs) {\n bool swapped = _swapSigner(owners, ownerCount, maxSigs, currentSignerCount, msg.sender);\n if (!swapped) {\n // if there are no invalid owners, we can't add a new signer, so we revert\n revert NoInvalidSignersToReplace();\n }\n}\n```\n | medium |
```\nfunction getTokenVotingPower(uint _tokenId) public override view returns (uint) {\n if (ownerOf(_tokenId) == address(0)) revert NonExistentToken();\n\n // If tokenId < 10000, it's a FrankenPunk, so 100/100 = a multiplier of 1\n uint multiplier = _tokenId < 10_000 ? PERCENT : monsterMultiplier;\n ... | medium |
```\nfunction withdrawFromGauge(uint256 _NFTId, address[] memory _tokens) public {\n uint256 amount = depositReceipt.pooledTokens(_NFTId);\n depositReceipt.burn(_NFTId);\n gauge.getReward(address(this), _tokens);\n gauge.withdraw(amount);\n //AMMToken adheres to ERC20 spec meaning it reverts on failure... | high |
```\nrequire(\n msg.sender == address(_getPool(tokenIn, tokenOut, fee)),\n 'Router: invalid callback sender'\n);\n```\n | medium |
```\nfunction adminMint(address to, uint256 _tokenId)\n external\n whenNotPaused\n ownerOrMinter\n requireState(DrawState.Closed)\n{\n require(to != address(0), "DCBW721: Address cannot be 0");\n\n validateTokenId(_tokenId);\n\n _safeMint(to, _tokenId);\n\n emit AdminMinted(to, _tokenId);\n}\n``... | none |
```\nfunction _createSenderIfNeeded(uint256 opIndex, UserOpInfo memory opInfo, bytes calldata initCode) internal {\n if (initCode.length != 0) {\n address sender = opInfo.mUserOp.sender;\n if (sender.code.length != 0) revert FailedOp(opIndex, "AA10 sender already constructed");\n address sender1... | none |
```\nfunction tryRecover(\n bytes32 hash,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) internal pure returns (address, RecoverError) {\n // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature\n // unique. Appendix F in the Ethereum Y... | none |
```\nFile: SecondaryRewarder.sol\n function _claimRewards(address account, uint256 nTokenBalanceBefore, uint256 nTokenBalanceAfter) private { \n uint256 rewardToClaim = _calculateRewardToClaim(account, nTokenBalanceBefore, accumulatedRewardPerNToken); \n\n // Precision here is:\n // nTokenBalan... | medium |
```\nfunction _canLiquidate(MTypes.MarginCallPrimary memory m)\n private\n view\n returns (bool)\n{\n// rest of code // [// rest of code]\n uint256 timeDiff = LibOrders.getOffsetTimeHours() - m.short.updatedAt;\n uint256 resetLiquidationTime = LibAsset.resetLiquidationTime(m.asset);\n❌ if (timeDiff... | medium |
```\n modifier onlyEOAEx() {\n if (!allowContractCalls && !whitelistedContracts[msg.sender]) {\n if (msg.sender != tx.origin) revert NOT_EOA(msg.sender);\n }\n _;\n }\n```\n | medium |
```\nrequire(block.timestamp >= \_d.withdrawalRequestTime + TBTCConstants.getIncreaseFeeTimer(), "Fee increase not yet permitted");\n```\n | low |
```\nfunction mulDiv(uint256 x, uint256 y, uint256 denominator, Rounding rounding) internal pure returns (uint256) {\n uint256 result = mulDiv(x, y, denominator);\n if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) {\n result += 1;\n }\n return result;\n}\n```\n | none |
```\nfunction getZethTotal(uint256 vault) internal view returns (uint256 zethTotal) {\n AppStorage storage s = appStorage();\n address[] storage bridges = s.vaultBridges[vault];\n uint256 bridgeCount = bridges.length;\n\n for (uint256 i; i < bridgeCount;) {\n zethTotal += IBridge(bridges[i]).getZethV... | low |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.