function stringlengths 12 63.3k | severity stringclasses 4
values |
|---|---|
```\n function _isExternalLendingUnhealthy(\n uint16 currencyId,\n IPrimeCashHoldingsOracle oracle,\n PrimeRate memory pr\n ) internal view returns (bool isExternalLendingUnhealthy, OracleData memory oracleData, uint256 targetAmount) {\n// rest of code\n\n PrimeCashFactors memory factors... | medium |
```\nfunction harvest(bool \_skipRedeem, bool \_skipIncentivesUpdate, bool[] calldata \_skipReward, uint256[] calldata \_minAmount) external {\n require(msg.sender == rebalancer || msg.sender == owner(), "IDLE:!AUTH");\n```\n | medium |
```\n/// @notice Adds an external ERC20 token type 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/// @param \_externalErc20 The address of an ERC20 token to be awarded\nfunction addExternalErc20Awa... | medium |
```\n function getCoinLength() public view returns (uint256 length) { //@audit-info coin vs token\n return tokens.length;\n }\n```\n | low |
```\nFile: wfCashLogic.sol\n function _mintInternal(\n..SNIP..\n if (maxFCash < fCashAmount) {\n // NOTE: lending at zero\n uint256 fCashAmountExternal = fCashAmount * precision / uint256(Constants.INTERNAL_TOKEN_PRECISION); \n require(fCashAmountExternal <= depositAmountExter... | high |
```\nfunction hasRole(bytes32 role, address account) public view override returns (bool) {\n return _roles[role].members[account];\n}\n```\n | none |
```\n/// @dev Set the main Rocket Storage address\nconstructor(RocketStorageInterface \_rocketStorageAddress) {\n // Update the contract address\n rocketStorage = RocketStorageInterface(\_rocketStorageAddress);\n}\n```\n | low |
```\nfunction addValidators(\n uint256 \_operatorIndex,\n uint256 \_keyCount,\n bytes calldata \_publicKeys,\n bytes calldata \_signatures\n) external onlyActiveOperator(\_operatorIndex) {\n if (\_keyCount == 0) {\n revert InvalidArgument();\n }\n\n if (\_publicKeys.length % PUBLIC\_KEY\_LENGTH != 0 || \_publicKeys.len... | medium |
```\nFile: BaseLSTAdapter.sol\n function prefundedDeposit() external nonReentrant returns (uint256, uint256) {\n uint256 bufferEthCache = bufferEth; // cache storage reads\n uint256 queueEthCache = withdrawalQueueEth; // cache storage reads\n uint256 assets = IWETH9(WETH).balanceOf(address(this)... | high |
```\nfunction buyoutLien(ILienToken.LienActionBuyout calldata params) external {\n // rest of code.\n /**** tranfer but not liensOpenForEpoch-- *****/\n _transfer(ownerOf(lienId), address(params.receiver), lienId);\n }\n```\n | high |
```\n/\*\*\n \* @notice receive ETH, used for flashloan repay.\n \*/\nreceive() external payable {\n require(\n msg.sender.isContract(),\n "receive: Only can call from a contract!"\n );\n}\n```\n | low |
```\nfunction div(uint256 a, uint256 b) internal pure returns (uint256) {\n return div(a, b, "SafeMath: division by zero");\n}\n```\n | none |
```\n// Get the current price of the lookup token in terms of the quote token\n(, int24 currentTick, , , , , bool unlocked) = params.pool.slot0();\n\n// Check for re-entrancy\nif (unlocked == false) revert UniswapV3_PoolReentrancy(address(params.pool));\n```\n | medium |
```\nfunction _throwError(RecoverError error) private pure {\n if (error == RecoverError.NoError) {\n return; // no error: do nothing\n } else if (error == RecoverError.InvalidSignature) {\n revert("ECDSA: invalid signature");\n } else if (error == RecoverError.InvalidSignatureLength) {\n ... | none |
```\nmodifier onlyLatestRocketNetworkContract() {\n // The owner and other contracts are only allowed to set the storage upon deployment to register the initial contracts/settings, afterwards their direct access is disabled\n if (boolStorage[keccak256(abi.encodePacked("contract.storage.initialised"))] == true) {\... | high |
```\n// Property of the company SKALE Labs inc.---------------------------------\n uint locked = \_getLockedOf(from);\n if (locked > 0) {\n require(\_balances[from] >= locked + amount, "Token should be unlocked for transferring");\n }\n//--------------------------------------------------... | high |
```\nGEM.\_setSenate(newSenate, block.timestamp + SENATE\_VALIDITY);\n```\n | medium |
```\n function accrueRate() public {\n uint256 currentTimestamp = block.timestamp;\n if (currentTimestamp == lastUpdateTimestamp) {\n return;\n }\n uint256 timeDifference = block.timestamp - uint256(lastUpdateTimestamp);\n tRate = tRate.decimalMul((timeDifference * borr... | medium |
```\n uint256 assetPreBal = _baseAsset.balanceOf(address(this));\n uint256 assetPulled = destVault.withdrawBaseAsset(sharesToBurn, address(this));\n\n // Destination Vault rewards will be transferred to us as part of burning out shares\n // Back into what that... | high |
```\nfunction safeTransferETH(address to, uint256 amount) internal {\n bool callStatus;\n\n assembly {\n // Transfer the ETH and store if it succeeded or not.\n callStatus := call(gas(), to, amount, 0, 0, 0, 0)\n }\n\n require(callStatus, "ETH_TRANSFER_FAILED");\n}\n```\n | none |
```\nfunction enableTrading() external onlyOwner {\n tradingActive = true;\n swapEnabled = true;\n lastLpBurnTime = block.timestamp;\n launchedAt = block.number;\n}\n```\n | none |
```\nfunction didAllocate(\n uint8 subjectType,\n uint256 subject,\n uint256 stakeAmount,\n uint256 sharesAmount,\n address staker\n) external onlyRole(ALLOCATOR\_CONTRACT\_ROLE) {\n bool delegated = getSubjectTypeAgency(subjectType) == SubjectStakeAgency.DELEGATED;\n if (delegated) {\n uint... | high |
```\nfunction _applyFees(uint256 fee0_, uint256 fee1_) internal {\n uint16 mManagerFeeBPS = managerFeeBPS;\n managerBalance0 += (fee0_ * mManagerFeeBPS) / hundredPercent;\n managerBalance1 += (fee1_ * mManagerFeeBPS) / hundredPercent;\n}\n```\n | medium |
```\n/\*\*\n \* @dev Sets '\_priceFeed' address for a '\_asset'.\n \* Can only be called by the contract owner.\n \* Emits a {AssetPriceFeedChanged} event.\n \*/\nfunction setPriceFeed(address \_asset, address \_priceFeed) public onlyOwner {\n require(\_priceFeed != address(0), Errors.VL\_ZERO\_ADDR);\n usdPriceFeeds[\... | low |
```\nuint holderBalance = SkaleToken(contractManager.getContract("SkaleToken")).balanceOf(holder);\nuint lockedToDelegate = tokenState.getLockedCount(holder) - tokenState.getPurchasedAmount(holder);\nrequire(holderBalance >= amount + lockedToDelegate, "Delegator hasn't enough tokens to delegate");\n```\n | high |
```\n function _buildBoost(\n address[] calldata partnerNFTs,\n uint256[] calldata partnerNFTIds\n ) internal returns (Boost memory newUserBoost) {\n uint256 magnitude;\n Boost storage userBoost = boosts[msg.sender];\n if(userBoost.expiry == 0) {\n// rest of code\n }\n else {\n address[] sto... | 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 |
```\nfunction mul(uint256 a, uint256 b) internal pure returns (uint256) {\n return a * b;\n}\n```\n | none |
```\n bytes32 orderId = getOrderIdFromOrderRequest(orderRequest, salt);\n uint256 escrow = getOrderEscrow[orderId];\n if (amount > escrow) revert AmountTooLarge();\n\n\n // Update escrow tracking\n getOrderEscrow[orderId] = escrow - amount;\n // Notify escrow taken\n emi... | medium |
```\nfunction sendETHToFee(uint256 amount) private {\n uint256 baseAmount = amount.div(2);\n _marketingWalletAddress.transfer(baseAmount.div(2));\n _buyBackWalletAddress.transfer(baseAmount.div(2));\n _fairyPotWalletAddress.transfer(baseAmount);\n}\n```\n | none |
```\nfunction mul(uint256 a, uint256 b) internal pure returns (uint256) {\n return a * b;\n}\n```\n | none |
```\nfunction requestWithdrawal(uint256 \_tokensToWithdraw) external override {\n```\n | medium |
```\nFile: BondAggregator.sol\n function registerAuctioneer(IBondAuctioneer auctioneer_) external requiresAuth {\n // Restricted to authorized addresses\n\n // Check that the auctioneer is not already registered\n if (_whitelist[address(auctioneer_)])\n revert Aggregator_AlreadyRegist... | medium |
```\n function deposit(address r, uint256 a) external override returns (uint256) {\n if (block.timestamp > maturity) {\n revert Exception(\n 21,\n block.timestamp,\n maturity,\n address(0),\n address(0)\n );\n ... | medium |
```\nconstructor() {\n address msgSender = _msgSender();\n _owner = msgSender;\n emit OwnershipTransferred(address(0), msgSender);\n}\n```\n | none |
```\ntryToMoveToValidating(\_proposalId);\n```\n | high |
```\n/**\n * @notice Deposit underlying assets on Compound and issue share token\n * @param amount Underlying token amount to deposit\n * @return shareAmount cToken amount\n */\nfunction deposit(address token, uint256 amount) { // rest of code }\n\n/**\n * @notice Withdraw underlying assets from Compound... | medium |
```\naccounts[account].owners[owner].removedAtBlockNumber = block.number;\n\nemit AccountOwnerRemoved(\n account,\n owner\n);\n```\n | high |
```\nfunction includeAsset (address \_numeraire, address \_nAssim, address \_reserve, address \_rAssim, uint256 \_weight) public onlyOwner {\n shell.includeAsset(\_numeraire, \_nAssim, \_reserve, \_rAssim, \_weight);\n}\n```\n | medium |
```\n1) Deposit ERC721\n2) Set creditor to malicious designed creditor\n3) Transfer the account to itself\n4) flashActionByCreditor to transfer ERC721\n 4a) account owns itself so _transferFromOwner allows transfers from account\n 4b) Account is now empty but still thinks is has ERC721\n5) Use malicious designed ... | high |
```\nfunction toEthSignedMessageHash(\n bytes memory s\n) internal pure returns (bytes32) {\n return\n keccak256(\n abi.encodePacked(\n "\x19Ethereum Signed Message:\n",\n Strings.toString(s.length),\n s\n )\n );\n}\n```\n | none |
```\nfunction sub(\n uint256 a,\n uint256 b,\n string memory errorMessage\n) internal pure returns (uint256) {\n require(b <= a, errorMessage);\n uint256 c = a - b;\n\n return c;\n}\n```\n | none |
```\nfunction enableTrading(uint256 initialMaxGwei, uint256 initialMaxWallet, uint256 initialMaxTX,\n uint256 setDelay) external onlyOwner {\n initialMaxWallet = initialMaxWallet * (10**18);\n initialMaxTX = initialMaxTX * (10**18);\n require(!tradingEnabled);\n require(initialMaxWalle... | none |
```\nconstructor(\n bytes4 source_,\n bytes32 sourceAddress_,\n uint8 decimals_,\n string memory name,\n string memory symbol\n) ERC20(name, symbol) {\n source = source_;\n sourceAddress = sourceAddress_;\n _decimals = decimals_;\n}\n```\n | none |
```\n uint256 unhedgedGlp = (state.unhedgedGlpInUsdc + dnUsdcDepositedPos).mulDivDown(\n PRICE_PRECISION,\n _getGlpPrice(state, !maximize)\n );\n\n // calculate current borrow amounts\n (uint256 currentBtc, uint256 currentEth) = _getCurrentBorrows(state);\n uint256 totalCurrentBorrowValue =... | medium |
```\nfunction max(uint256 a, uint256 b) internal pure returns (uint256) {\n return a >= b ? a : b;\n}\n```\n | none |
```\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 |
```\n function compound(GMXTypes.Store storage self, GMXTypes.CompoundParams memory cp) external {lt\n if (self.tokenA.balanceOf(address(self.trove)) > 0) {\n self.tokenA.safeTransferFrom(address(self.trove), address(this), self.tokenA.balanceOf(address(self.trove)));\n }\n if (self.tokenB.bala... | medium |
```\n@external\n@nonreentrant('lock')\ndef remove_liquidity_one_coin(token_amount: uint256, i: uint256, min_amount: uint256,\n use_eth: bool = False, receiver: address = msg.sender) -> uint256:\n A_gamma: uint256[2] = self._A_gamma()\n\n dy: uint256 = 0\n D: uint256 = 0\n p: uin... | high |
```\n /// @notice Settles a matured vault account by transforming it from an fCash maturity into\n /// a prime cash account. This method is not authenticated, anyone can settle a vault account\n /// without permission. Generally speaking, this action is economically equivalent no matter\n /// when it is cal... | medium |
```\nfunction addMultiple(address[] calldata tokens, uint256[] calldata maxAmounts)\n external\n payable\n override\n returns (uint256 actualLP)\n{\n // Perform basic checks\n Config memory _config = DFPconfig;\n require(_config.unlocked, "DFP: Locked");\n require(tokens.length == 16, "DFP: Bad tokens array len... | none |
```\nfunction mul(uint256 a, uint256 b) internal pure returns (uint256) {\n // Gas optimization: this is cheaper than requiring 'a' not being zero, but the\n // benefit is lost if 'b' is also tested.\n // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522\n if (a == 0) {\n return 0;... | none |
```\nfunction testnew_GaugePointAdjustment() public {\n uint256 currentGaugePoints = 1189; \n uint256 optimalPercentDepositedBdv = 64; \n uint256 percentOfDepositedBdv = 64; \n\n uint256 newGaugePoints = gaugePointFacet.defaultGaugePointFunction(\n currentGaugePoints,\n optimalPercentDeposited... | medium |
```\npolicyHolders[\_msgSender()] = PolicyHolder(\_coverTokens, currentEpochNumber,\n \_endEpochNumber, \_totalPrice, \_reinsurancePrice);\n\nepochAmounts[\_endEpochNumber] = epochAmounts[\_endEpochNumber].add(\_coverTokens);\n```\n | high |
```\nconstructor() ERC20("Venom", "VNM") {\n marketingWallet = payable(0xB4ba72b728248Ba8caC7f1A8f560324340a6c239);\n address router = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D;\n\n buyDeadFees = 2;\n sellDeadFees = 2;\n buyMarketingFees = 2;\n sellMarketingFees = 2;\n buyLiquidityFee = 0;\n se... | none |
```\nfunction transfer(address recipient, uint256 amount) public override returns (bool) {\n _transfer(_msgSender(), recipient, amount);\n return true;\n}\n```\n | none |
```\n// can we repoduce leaf hash included in the claim?\nrequire(\_hashLeaf(user\_id, user\_amount, leaf), 'TokenDistributor: Leaf Hash Mismatch.');\n```\n | medium |
```\n// SPDX-License-Identifier: MIT\npragma solidity 0.8.21;\nimport { console, console2 } from "forge-std/Test.sol";\nimport { TestUtils } from "../../helpers/TestUtils.sol";\nimport { IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol";\nimport { GMXMockVaultSetup } from "./GMXMockVaultSetup.t.sol";\nimpo... | high |
```\nint256 internal constant INTERNAL_TOKEN_PRECISION = 1e8;\nuint256 internal constant BALANCER_PRECISION = 1e18;\n```\n | high |
```\nfunction _getTValues(uint256 tAmount) private view returns (uint256, uint256, uint256) {\n uint256 tFee = calculateTaxFee(tAmount);\n uint256 tLiquidity = calculateLiquidityFee(tAmount);\n uint256 tTransferAmount = tAmount - tFee - tLiquidity;\n return (tTransferAmount, tFee, tLiquidity);\n}\n```\n | none |
```\n // uint32 lastTopHatId will overflow in brackets\n topHatId = uint256(++lastTopHatId) << 224;\n```\n | medium |
```\n700/1300 = 0.5384615385 (53%).\n```\n | medium |
```\n function multisigInterestClaim() external {\n if(msg.sender != multisig) revert NotMultisig();\n uint256 interestClaim = multisigClaims;\n multisigClaims = 0;\n SafeTransferLib.safeTransfer(ibgt, multisig, interestClaim);\n }\n\n /// @inheritdoc IGoldilend\n function apdaoInterestClaim() external ... | high |
```\nif addr == dump.MessagePasserAddress {\n statedumper.WriteMessage(caller.Address(), input)\n}\n```\n | medium |
```\n if(proposals[_proposalId].actionType == TYPE_DEL_OWNER) {\n (address _owner) = abi.decode(proposals[_proposalId].payload, (address));\n require(contains(_owner) != 0, "Invalid owner address");\n uint index = contains(_owner);\n for (uint256 i = index; i < cou... | medium |
```\nfunction maxWithdraw(address owner) public view returns (uint256) {\n return convertToAssets(liquidStakingToken.balanceOf(owner));\n}\n```\n | low |
```\nfunction deposit(uint256 _amount) public {\n // Gets the amount of ABR locked in the contract\n uint256 totalABR = ABR.balanceOf(address(this));\n // Gets the amount of xABR in existence\n uint256 totalShares = totalSupply();\n // If no xABR exists, mint it 1:1 to the amount put in\n if (totalSha... | none |
```\n /// @notice Roll into the next Series if there isn't an active series and the cooldown period has elapsed.\n function roll() external {\n if (maturity != MATURITY_NOT_SET) revert RollWindowNotOpen();\n\n if (lastSettle == 0) {\n // If this is the first roll, lock some shares in by minting the... | medium |
```\ncontract FootiumPlayer is\n ERC721Upgradeable,\n AccessControlUpgradeable,\n ERC2981Upgradeable,\n PausableUpgradeable,\n ReentrancyGuardUpgradeable,\n OwnableUpgradeable\n{\n```\n | medium |
```\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 |
```\n function testWithdrawETHfromRocketPool() public{\n string memory MAINNET_RPC_URL = vm.envString("MAINNET_RPC_URL");\n uint256 mainnetFork = vm.createFork(MAINNET_RPC_URL, 15361748);\n\n RocketTokenRETHInterface rEth = RocketTokenRETHInterface(0xae78736Cd615f374D3085123A210448E74Fc6393);\n vm.selectF... | low |
```\n function _killWoundedAgents(\n uint256 roundId,\n uint256 currentRoundAgentsAlive\n ) private returns (uint256 deadAgentsCount) {\n // rest of code\n for (uint256 i; i < woundedAgentIdsCount; ) {\n uint256 woundedAgentId = woundedAgentIdsInRound[i.unsafeAdd(1)];\n\n ... | high |
```\n function checkForInvalidTimestampOrAnswer(\n uint256 timestamp,\n int256 answer,\n uint256 currentTimestamp\n ) private pure returns (bool) {\n // Check for an invalid timeStamp that is 0, or in the future\n if (timestamp == 0 || timestamp > currentTimestamp) return true;\... | medium |
```\nFile: NapierRouter.sol\n function swapUnderlyingForYt(\n address pool,\n uint256 index,\n uint256 ytOutDesired,\n uint256 underlyingInMax,\n address recipient,\n uint256 deadline\n ) external payable override nonReentrant checkDeadline(deadline) returns (uint256) {\n... | medium |
```\nfunction balanceOf(address account) public view returns (uint256) {\n return deposits[account].deposit;\n}\n```\n | none |
```\ndataLen := uint64(len(data))\n// Bump the required gas by the amount of transactional data\nif dataLen > 0 {\n // rest of code\n}\n```\n | medium |
```\n // Revert if caller is not receiver\n if (msg.sender != receiver) revert Teller_NotAuthorized();\n\n // Transfer remaining collateral to receiver\n uint256 amount = optionToken.totalSupply();\n if (call) {\n payoutToken.safeTransfer(receiver, amount);\n } else {... | high |
```\n if ((lockEndTime - weekCursor) > (minLockDurationForReward)) {\n toDistribute +=\n (balanceOf * tokensPerWeek[weekCursor]) / veSupply[weekCursor];\n weekCursor += WEEK;\n }\n```\n | medium |
```\n// Calculate value of all collaterals\n// collateralValuePerToken = underlyingPrice \* exchangeRate \* collateralFactor\n// collateralValue = balance \* collateralValuePerToken\n// sumCollateral += collateralValue\nuint256 \_len = \_accountData.collaterals.length();\nfor (uint256 i = 0; i < \_len; i++) {\n IiTo... | high |
```\nFile: SingleSidedLPVaultBase.sol\n function reinvestReward(\n SingleSidedRewardTradeParams[] calldata trades,\n uint256 minPoolClaim\n ) external whenNotLocked onlyRole(REWARD_REINVESTMENT_ROLE) returns (\n address rewardToken,\n uint256 amountSold,\n uint256 poolClaimAmoun... | high |
```\nfunction setFeeDistributionThresholds(\n uint transactionThreshold,\n uint balanceThreshold,\n uint tokenPriceUpdateTimeThreshold\n) external authorized {\n require(tokenPriceUpdateTimeThreshold > 0, "VoxNET: price update time threshold cannot be zero");\n\n feeDistributionTransactionThreshold = tra... | none |
```\nfunction transferFrom(\n address sender,\n address recipient,\n uint256 amount\n) public override returns (bool) {\n _transfer(sender, recipient, amount);\n _approve(\n sender,\n _msgSender(),\n _allowances[sender][_msgSender()].sub(\n amount,\n "ERC20: tra... | none |
```\nfunction toInt256Safe(uint256 a) internal pure returns (int256) {\n int256 b = int256(a);\n require(b >= 0);\n return b;\n}\n```\n | none |
```\nfunction destroy(uint256 routeId) external onlyDisabler {\n```\n | low |
```\n uint deltaTime;\n // 1.1 check the amount of time since position is marked\n if (pos.startLiqTimestamp > 0) {\n deltaTime = Math.max(deltaTime, block.timestamp - pos.startLiqTimestamp);\n }\n // 1.2 check the amount of time since position is p... | high |
```\nfunction sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\n require(b <= a, errorMessage);\n uint256 c = a - b;\n\n return c;\n}\n```\n | none |
```\nfunction getNewPotentialController(address split)\n external\n view\n returns (address)\n{\n return splits[split].newPotentialController;\n}\n```\n | none |
```\n function getImageURIForHat(uint256 _hatId) public view returns (string memory) {\n // check _hatId first to potentially avoid the `getHatLevel` call\n Hat memory hat = _hats[_hatId];\n string memory imageURI = hat.imageURI; // save 1 SLOAD\n ... | low |
```\n try params.contracts.swapHandler.swap(\n SwapUtils.SwapParams(\n params.contracts.dataStore,\n params.contracts.eventEmitter,\n params.contracts.oracle,\n Bank(payable(order.market())),\n params.key,\n resu... | medium |
```\nfunction getBNBAmountOut(uint256 amountIn) public view returns (uint256) {\n uint256 beansBefore = liqConst / _balances[address(this)];\n uint256 beansAfter = liqConst / (_balances[address(this)] + amountIn);\n return beansBefore - beansAfter;\n}\n```\n | none |
```\n/\*\*\n \* @dev locked status, only applicable before unlock\_date\n \*/\nbool public \_is\_locked = true;\n\n/\*\*\n \* @dev Modifier that only allows function to run if either token is unlocked or time has expired.\n \* Throws if called while token is locked.\n \*/\nmodifier onlyUnlocked() {\n require(!\_is\_... | low |
```\nfunction updatePayoutToken(address token) public onlyOwner {\n dividendTracker.updatePayoutToken(token);\n emit UpdatePayoutToken(token);\n}\n```\n | none |
```\nif (vc.value <= interestOwed) {\n // compute the amount of epochs this payment covers\n // vc.value is not WAD yet, so divWadDown cancels the extra WAD in interestPerEpoch\n uint256 epochsForward = vc.value.divWadDown(interestPerEpoch);\n // update the account's `epochsPaid` cursor\n account.epochsPaid += epochsFo... | low |
```\nmodifier lockedWhileVotesCast() {\n uint[] memory activeProposals = governance.getActiveProposals();\n for (uint i = 0; i < activeProposals.length; i++) {\n if (governance.getReceipt(activeProposals[i], getDelegate(msg.sender)).hasVoted) revert TokenLocked();\n (, address proposer,) = governance.getProposa... | medium |
```\nFile: VaultAccountAction.sol\n if (vaultAccount.accountDebtUnderlying == 0 && vaultAccount.vaultShares == 0) {\n // If the account has no position in the vault at this point, set the maturity to zero as well\n vaultAccount.maturity = 0;\n }\n vaultAccount.setVaultAccount(... | high |
```\n_v3SwapExactInput(\n v3SwapExactInputParams({\n fee: params.fee,\n tokenIn: cache.holdToken,\n tokenOut: cache.saleToken,\n amountIn: holdTokenAmountIn,\n amountOutMinimum: (saleTokenAmountOut * params.slippageBP1000) /\n Constants.BPS\n })\n```\n | high |
```\nfunction approveOperatorContract(address operatorContract) public onlyRegistryKeeper {\n operatorContracts[operatorContract] = 1;\n}\n\nfunction disableOperatorContract(address operatorContract) public onlyPanicButton {\n operatorContracts[operatorContract] = 2;\n}\n```\n | high |
```\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 |
```\nFile: TreasuryAction.sol\n function _executeRebalance(uint16 currencyId) private {\n IPrimeCashHoldingsOracle oracle = PrimeCashExchangeRate.getPrimeCashHoldingsOracle(currencyId);\n uint8[] memory rebalancingTargets = _getRebalancingTargets(currencyId, oracle.holdings());\n (RebalancingDat... | medium |
```\nif (validSignerCount > maxSigners) {\n revert MaxSignersReached();\n}\n```\n | high |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.