function stringlengths 12 63.3k | severity stringclasses 4
values |
|---|---|
```\n function _accumulateExternalRewards() internal override returns (uint256[] memory) {\n uint256 numExternalRewards = externalRewardTokens.length;\n\n auraPool.rewardsPool.getReward(address(this), true);\n\n uint256[] memory rewards = new uint256[](numExternalRewards);\n for (uint256 ... | medium |
```\nif (block.timestamp >= lien.start + lien.duration) {\n delta_t = uint256(lien.start + lien.duration - lien.last);\n} \n```\n | medium |
```\nfunction addLiquidity(uint256 tokenAmount, uint256 ethAmount) private {\n _approve(address(this), address(uniswapV2Router), tokenAmount);\n\n uniswapV2Router.addLiquidityETH{value: ethAmount}(\n address(this),\n tokenAmount,\n 0, // slippage is unavoidable\n 0, // slippage is unav... | none |
```\n/// @param \_preimage The sha256 preimage of the digest\nfunction provideECDSAFraudProof(\n DepositUtils.Deposit storage \_d,\n uint8 \_v,\n bytes32 \_r,\n bytes32 \_s,\n bytes32 \_signedDigest,\n bytes memory \_preimage\n) public {\n require(\n !\_d.inFunding() && !\_d.inFundingFailure... | high |
```\nconstructor() ERC20("Andy", "ANDY") {\n IDexRouter _dexRouter = IDexRouter(\n 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D\n );\n\n exemptFromLimits(address(_dexRouter), true);\n dexRouter = _dexRouter;\n\n dexPair = IDexFactory(_dexRouter.factory()).createPair(\n address(this),\n ... | none |
```\nfunction updateYield(uint256 vault) internal {\n AppStorage storage s = appStorage();\n STypes.Vault storage Vault = s.vault[vault];\n STypes.VaultUser storage TAPP = s.vaultUser[vault][address(this)];\n // Retrieve vault variables\n uint88 zethTotalNew = uint88(getZethTotal(vault)); // @dev(safe-ca... | low |
```\n// If a user is delegating back to themselves, they regain their community voting power, so adjust totals up\nif (_delegator == _delegatee) {\n _updateTotalCommunityVotingPower(_delegator, true);\n\n// If a user delegates away their votes, they forfeit their community voting power, so adjust totals down\n} else i... | medium |
```\n function getTradingFee(uint256 quoteId) internal view returns (uint256 fee) {\n QuoteStorage.Layout storage quoteLayout = QuoteStorage.layout();\n Quote storage quote = quoteLayout.quotes[quoteId];\n Symbol storage symbol = SymbolStorage.layout().symbols[quote.symbolId];\n if (quote... | medium |
```\nfunction transfer(address recipient, uint256 amount) public override returns (bool) {\n _transfer(_msgSender(), recipient, amount);\n return true;\n}\n```\n | none |
```\nfunction refund(\n uint256 policyIndex\_,\n uint256 week\_,\n address who\_\n) external noReenter {\n Coverage storage coverage = coverageMap[policyIndex\_][week\_][who\_];\n\n require(!coverage.refunded, "Already refunded");\n\n uint256 allCovered = coveredMap[policyIndex\_][week\_];\n uint256 amountToRefund = re... | high |
```\n func (evm *EVM) Call(caller ContractRef, addr common.Address, input []byte, gas uint64, value *big.Int) (ret []byte, leftOverGas uint64, err error) { \n if addr == dump.MessagePasserAddress { \n statedumper.WriteMessage(caller.Address(), input) \n } \n```\n | medium |
```\n if (validSignerCount == currentSignerCount) {\n newSignerCount = currentSignerCount;\n } else {\n newSignerCount = currentSignerCount - 1;\n }\n```\n | medium |
```\nfunction toEthSignedMessageHash(\n bytes32 hash\n) internal pure returns (bytes32 message) {\n // 32 is the length in bytes of hash,\n // enforced by the type signature above\n /// @solidity memory-safe-assembly\n assembly {\n mstore(0x00, "\x19Ethereum Signed Message:\n32")\n mstore(0... | none |
```\n uint256 received;\n {\n // Get the starting balance of the principal token\n uint256 starting = token.balanceOf(address(this));\n\n // Swap those tokens for the principal tokens\n ISensePeriphery(x).swapUnderlyingForPTs(adapter, s, lent, r);\n\n // Calculate number of prin... | high |
```\n function createGauge4pool(\n address _4pool,\n address _dai,\n address _usdc,\n address _usdt,\n address _cash\n ) external returns (address) {\n```\n | medium |
```\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 |
```\nfunction claim(address user) external returns (uint256) {\n drop();\n \_captureNewTokensForUser(user);\n uint256 balance = userStates[user].balance;\n userStates[user].balance = 0;\n totalUnclaimed = uint256(totalUnclaimed).sub(balance).toUint112();\n\n // Transfer asset/reward token to user\n ... | high |
```\nrequire(\n amount <= instantMintLimit - currentInstantMintAmount,\n "RateLimit: Mint exceeds rate limit"\n);\n```\n | low |
```\nfunction byteLengthWithFallback(ShortString value, string storage store) internal view returns (uint256) {\n if (ShortString.unwrap(value) != _FALLBACK_SENTINEL) {\n return byteLength(value);\n } else {\n return bytes(store).length;\n }\n}\n```\n | none |
```\nfunction _transferStandard(address sender, address recipient, uint256 tAmount) private {\n (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tLiquidity) = _getValues(tAmount);\n _rOwned[sender] = _rOwned[sender] - rAmount;\n _rOwned[recipient] = _rOwne... | none |
```\n/**\n * @title GeoEmaAndCumSmaPump\n * @author Publius\n * @notice Stores a geometric EMA and cumulative geometric SMA for each reserve.\n * @dev A Pump designed for use in Beanstalk with 2 tokens.\n *\n * This Pump has 3 main features:\n * 1. Multi-block MEV resistence reserves\n * 2. MEV-resistant Geometric EM... | high |
```\n /**\n * @notice @inheritdoc GMXVault\n * @param self GMXTypes.Store\n * @param isNative Boolean as to whether user is depositing native asset (e.g. ETH, AVAX, etc.)\n */\n function deposit(\n GMXTypes.Store storage self,\n GMXTypes.DepositParams memory dp,\n bool isNative\n ) external {\n ... | medium |
```\nfunction getCurrentMintingCount() external view returns (uint256) {\n return _tokenIds;\n}\n```\n | none |
```\nrequire(\_arguments.tokenPrice != 0, "\_tokenPrice needs to be a non-zero amount");\n```\n | low |
```\n // rest of code\n pushFeedbackToVault(_chainId, _vault, _relayerFee);\n xTransfer(_asset, _amount, _vault, _chainId, _slippage, _relayerFee);\n // rest of code\n```\n | medium |
```\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 ) internal returns (int256 ... | high |
```\n function setDefaults(uint32[6] memory defaults_) external override requiresAuth {\n // Restricted to authorized addresses\n defaultTuneInterval = defaults_[0];\n defaultTuneAdjustment = defaults_[1];\n minDebtDecayInterval = defaults_[2];\n minDepositInterval = defaults_[3];\... | medium |
```\nFile: TwoTokenPoolUtils.sol\n function _getTimeWeightedPrimaryBalance(\n TwoTokenPoolContext memory poolContext,\n StrategyContext memory strategyContext,\n uint256 poolClaim,\n uint256 oraclePrice,\n uint256 spotPrice\n ) internal view returns (uint256 primaryAmount) {\n ... | high |
```\nfunction disableTransferDelay() external onlyOwner returns (bool){\n transferDelayEnabled = false;\n return true;\n}\n```\n | none |
```\nfunction unpauseContract() external onlyOwner returns (bool) {\n _unpause();\n return true;\n}\n```\n | none |
```\nFile: StrategyUtils.sol\n /// @notice Converts strategy tokens to BPT\n function _convertStrategyTokensToBPTClaim(StrategyContext memory context, uint256 strategyTokenAmount)\n internal pure returns (uint256 bptClaim) {\n require(strategyTokenAmount <= context.vaultState.totalStrategyTokenGloba... | high |
```\nfunction calculateMarketingFee(uint256 _amount)\n private\n view\n returns (uint256)\n{\n return _amount.mul(_marketingFee).div(10**2);\n}\n```\n | none |
```\nreceive() external payable {\n (bool success,) = address(rewardDistributor()).call{value: msg.value}('');\n require(success);\n}\n```\n | medium |
```\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 |
```\nfunction div(uint256 a, uint256 b) internal pure returns (uint256) {\n return div(a, b, "SafeMath: division by zero");\n}\n```\n | none |
```\nfunction canStartAward() external view returns (bool) {\n return \_isPrizePeriodOver() && !isRngRequested();\n}\n```\n | low |
```\n uint256 amountToSend = _send.amountLD > _options.tapAmount ? _options.tapAmount : _send.amountLD;\n if (_send.minAmountLD > amountToSend) {\n _send.minAmountLD = amountToSend;\n }\n```\n | medium |
```\nif (!ASTARIA_ROUTER.isValidRefinance(lienData[lienId], ld)) {\n revert InvalidRefinance();\n}\n```\n | high |
```\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 isExcludedFromReward(address account) public view returns (bool) {\n return _isExcluded[account];\n}\n```\n | none |
```\nfunction initialize\_1(\n address \_admin,\n address \_treasury,\n address \_depositContract,\n address \_elDispatcher,\n address \_clDispatcher,\n address \_feeRecipientImplementation,\n uint256 \_globalFee,\n uint256 \_operatorFee,\n uint256 globalCommissionLimitBPS,\n uint256 operatorCommissionLimitBPS\n) exter... | medium |
```\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 |
```\nFile: MetaStable2TokenAuraHelper.sol\n function reinvestReward(\n MetaStable2TokenAuraStrategyContext calldata context,\n ReinvestRewardParams calldata params\n ) external {\n```\n | medium |
```\nfunction approve(address spender, uint256 amount)\n public\n override\n returns (bool)\n{\n require(spender != address(0), "SRG20: approve to the zero address");\n require(\n msg.sender != address(0),\n "SRG20: approve from the zero address"\n );\n\n _allowances[msg.sender][spend... | none |
```\nfunction testExploitTransferOut() public {\n uint256 collateralPrice = 1000e8;\n\n vm.startPrank(alice);\n\n uint256 balance = WETH.balanceOf(alice);\n console2.log("alice balance", balance);\n \n (uint256 minFillPrice, ) = oracleModProxy.getPrice();\n\n // Announce order through delayed order... | high |
```\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 |
```\nconstructor() ERC20("Pepe", "PEPE") {\n\n IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);\n\n excludeFromMaxTransaction(address(_uniswapV2Router), true);\n uniswapV2Router = _uniswapV2Router;\n\n uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.fa... | none |
```\nuint256 collateralToLiquidateWithoutDiscount = (_debtToLiquidate * (10 ** decimals)) / price;\ncollateralToLiquidate = (collateralToLiquidateWithoutDiscount * totalLiquidationDiscount) / Constants.PRECISION;\nif (collateralToLiquidate > _accountCollateral) {\n collateralToLiquidate = _accountCollateral;... | medium |
```\nuint24 flaggerIdCounter;\n```\n | low |
```\n// safe for liquidation\nfunction isSafeWithPrice(address guy, uint256 currentMarkPrice) public returns (bool) {\n return\n marginBalanceWithPrice(guy, currentMarkPrice) >=\n maintenanceMarginWithPrice(guy, currentMarkPrice).toInt256();\n}\n```\n | high |
```\n if (_isLever) {\n uint256 netBorrowLimit = _actionInfo.collateralValue\n .preciseMul(maxLtvRaw.mul(10 ** 14))\n .preciseMul(PreciseUnitMath.preciseUnit().sub(execution.unutilizedLeveragePercentage));\n\n return netBorrowLimit\n .sub(_action... | medium |
```\nIUniV2Router2 internal constant UNIV2_ROUTER = IUniV2Router2(0xE592427A0AEce92De3Edee1F18E0157C05861564);\n```\n | medium |
```\n for (uint i = 0; i < tokens.length; i++) {\n //allow vault manager to withdraw tokens\n IERC20(tokens[i]).safeIncreaseAllowance(ownerIn, \n type(uint256).max); \n }\n```\n | low |
```\n/\*\*\n \* @notice Transfers ownership of the contract to a new account (`newOwner`).\n \* Can only be called by the current owner.\n \*/\nfunction acceptProposedOwner() public virtual onlyOwner {\n require((block.timestamp - \_proposedTimestamp) > \_delay, "#APO:030");\n \_setOwner(\_proposed);\n}\n```\n | medium |
```\nfunction innerHandleOp(bytes memory callData, UserOpInfo memory opInfo, bytes calldata context) external returns (uint256 actualGasCost) {\n uint256 preGas = gasleft();\n require(msg.sender == address(this), "AA92 internal call only");\n MemoryUserOp memory mUserOp = opInfo.mUserOp;\n\n uint callGasLim... | none |
```\nfunction bootstrapMember(string memory _id, string memory _url, address _nodeAddress) override external onlyGuardian onlyBootstrapMode onlyRegisteredNode(_nodeAddress) onlyLatestContract("rocketDAONodeTrusted", address(this)) {\n // Ok good to go, lets add them\n RocketDAONodeTrustedProposalsInterface(getCon... | medium |
```\n(1,400,000 + 2 * 604,800) / 604,800 = 4\n\n4 * 604,800 = 2,419,200\n```\n | medium |
```\n/\*\*\n\* @notice Cancel script execution with ID `\_delayedScriptId`\n\* @param \_delayedScriptId The ID of the script execution to cancel\n\*/\nfunction cancelExecution(uint256 \_delayedScriptId) external auth(CANCEL\_EXECUTION\_ROLE) {\n delete delayedScripts[\_delayedScriptId];\n\n emit ExecutionCancelle... | low |
```\nfunction notifyFor(address account) external {\n \_notifyFor(account, balanceOf(msg.sender));\n}\n```\n | high |
```\n// Confirm that the caller is the `mintRecipient` to ensure atomic execution.\nrequire(\n msg.sender.toUniversalAddress() == deposit.mintRecipient, "caller must be mintRecipient"\n);\n```\n | medium |
```\nfunction setAllowCustomTokens(bool allow) external onlyOwner {\n require(allowCustomTokens != allow);\n allowCustomTokens = allow;\n emit SetAllowCustomTokens(allow);\n}\n```\n | none |
```\nfunction setMinimumTokenBalanceForDividends(uint256 value) public onlyOwner {\n dividendTracker.setMinimumTokenBalanceForDividends(value);\n}\n```\n | none |
```\nfunction setAllowAutoReinvest(bool allow) external onlyOwner {\n require(allowAutoReinvest != allow);\n allowAutoReinvest = allow;\n emit SetAllowAutoReinvest(allow);\n}\n```\n | none |
```\n// Mint gold cards\nskyweaverAssets.batchMint(\_order.cardRecipient, \_ids, amounts, "");\n```\n | high |
```\n // Get generic swap parameters\n const basicSwapParams = buildUniswapSwapAdapterData(\n ["0xyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy", "0xzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz"],\n [3000],\n testDepositAmount,\n expectedReturnAmount,\n 0,\n ).swapData;\n```\n | medium |
```\n/\*\*\n \* @notice Update reserve to `\_reserve`\n \* @param \_reserve The address of the new reserve [pool] contract\n\*/\nfunction updateReserve(Vault \_reserve) external auth(UPDATE\_RESERVE\_ROLE) {\n require(isContract(\_reserve), ERROR\_CONTRACT\_IS\_EOA);\n\n \_updateReserve(\_reserve);\n}\n```\n | medium |
```\nFile: SDLPoolCCIPControllerPrimary.sol\n function _ccipReceive(Client.Any2EVMMessage memory _message) internal override {\n uint64 sourceChainSelector = _message.sourceChainSelector;\n\n (uint256 numNewRESDLTokens, int256 totalRESDLSupplyChange) = abi.decode(_message.data, (uint256, int256));\n\n ... | low |
```\nfunction enableTrading() external onlyOwner {\n require(!tradingActive, "Token launched");\n tradingActive = true;\n launchBlock = block.number;\n swapEnabled = true;\n}\n```\n | none |
```\nuint256 balTotalSupply = pool.balancerPool.totalSupply();\nuint256[] memory balances = new uint256[](_vaultTokens.length);\n// Calculate the proportion of the pool balances owned by the polManager\nif (balTotalSupply != 0) {\n // Calculate the amount of OHM in the pool owned by the polManager\n // We have to... | medium |
```\nfunction enableSwapAndLiquify(bool enabled) public onlyOwner {\n require(swapAndLiquifyEnabled != enabled);\n swapAndLiquifyEnabled = enabled;\n emit EnableSwapAndLiquify(enabled);\n}\n```\n | none |
```\nfunction _depositLPIncentive(\n StoredReward memory reward,\n uint256 amount,\n uint256 periodReceived\n) private {\n IERC20(reward.token).safeTransferFrom(\n msg.sender,\n address(this),\n amount\n );\n\n // @audit stored `amount` here will be incorrect since it doesn't acco... | medium |
```\n function testswapExactTokensForETHStuckTokens() public {\n address wrappedTokenA = IChilizWrapperFactory(wrapperFactory).wrappedTokenFor(address(tokenA));\n\n tokenA.approve(address(wrapperFactory), type(uint256).max);\n wrapperFactory.wrap(address(this), address(tokenA), 100);\n\n ... | medium |
```\nuint256 \_tmpIndex = \_currentIndex - 1;\nuint256 \_currentUserAmount = usersTeamInfo[msg.sender].stakedAmount;\n \nwhile (\_currentUserAmount > usersTeamInfo[topUsers[\_tmpIndex]].stakedAmount) {\n address \_tmpAddr = topUsers[\_tmpIndex];\n topUsers[\_tmpIndex] = msg.sender;\n topUsers[\_tmpIndex + 1] =... | medium |
```\nfunction withdraw(int256 \_withdrawAmount) public override nonReentrant {\n updateF1155Balances();\n \_internalWithdraw(\_withdrawAmount);\n}\n```\n | medium |
```\nfunction clone(address implementation) internal returns (address instance) {\n assembly {\n let ptr := mload(0x40)\n mstore(\n ptr,\n 0x3d605d80600a3d3981f336603057343d52307f00000000000000000000000000\n )\n mstore(\n add(ptr, 0x13),\n 0x830d2d700a97af574b186c80d40429385d24241565b08... | none |
```\n tokenVotingPower[currentDelegate] -= amount;\n tokenVotingPower[_delegatee] += amount; \n\n // If a user is delegating back to themselves, they regain their community voting power, so adjust totals up\n if (_delegator == _delegatee) {\n _updateTotalCommunityVotingPower(_delegator, true);\n\n /... | high |
```\nfunction executeCalls(Call[] calldata calls) external returns (bytes[] memory) {\n bytes[] memory response = new bytes[](calls.length);\n for (uint256 i = 0; i < calls.length; i++) {\n response[i] = \_executeCall(calls[i].to, calls[i].value, calls[i].data);\n }\n return response;\n}\n```\n | low |
```\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 |
```\nmodifier onlyPrizePool() {\n require(\_msgSender() == address(prizePool), "PeriodicPrizeStrategy/only-prize-pool");\n \_;\n}\n```\n | high |
```\nconstructor(string memory name_, string memory symbol_) {\n _name = name_;\n _symbol = symbol_;\n}\n```\n | none |
```\nconstructor() {\n address msgSender = _msgSender();\n _owner = msgSender;\n emit OwnershipTransferred(address(0), msgSender);\n}\n```\n | none |
```\nfunction changeListing(\n address tokenToDelist, // Address of token to be delisted\n address tokenToList, // Address of token to be listed\n uint112 listingTarget // Amount of tokens needed to activate listing\n) external onlyListedToken(tokenToDelist) onlyOwner() {\n ... | none |
```\nfunction firstPublicMintingSale() external payable returns (bool) {\n if (\n (block.timestamp >= defaultSaleStartTime) &&\n (block.timestamp <\n defaultSaleStartTime + DEFAULT_INITIAL_PUBLIC_SALE)\n ) {\n _tokenIds++;\n\n if (_tokenIds > DEFAULT_MAX_FIRST_PUBLIC_SUPPLY)... | none |
```\n/\*\*\n\* @notice Execute the script with ID `\_delayedScriptId`\n\* @param \_delayedScriptId The ID of the script to execute\n\*/\nfunction execute(uint256 \_delayedScriptId) external {\n require(canExecute(\_delayedScriptId), ERROR\_CAN\_NOT\_EXECUTE);\n runScript(delayedScripts[\_delayedScriptId].evmCallS... | low |
```\nfunction jumpStartAccount(address receiver, uint256 agentID, uint256 accountPrincipal) external onlyOwner {\n Account memory account = \_getAccount(agentID);\n // if the account is already initialized, revert\n if (account.principal != 0) revert InvalidState();\n // create the account\n account.principal = account... | low |
```\n uint tokenInPrice = _getMinPrice(address(baseAsset));\n uint tokenOutPrice = _getMaxPrice(address(quoteAsset));\n // rest of code\n uint minOut = tokenInPrice\n .multiplyDecimal(marketPricingParams[_optionMarket].minReturnPercent)\n .multiplyDecimal(_amountBase)\n .divideDecim... | medium |
```\nFile: bophades\src\external\governance\GovernorBravoDelegate.sol\n function castVoteInternal(\n address voter,\n uint256 proposalId,\n uint8 support\n ) internal returns (uint256) {\n// rest of code// rest of code\n // Get the user's votes at the start of the proposal and at the t... | medium |
```\nFile: InvariantChecks.sol\n /// @dev Returns the difference between actual total collateral balance in the vault vs tracked collateral\n /// Tracked collateral should be updated when depositing to stable LP (stableCollateralTotal) or\n /// opening leveraged positions (marginDepositedTotal).\n ... | medium |
```\nfunction add(uint256 a, uint256 b) internal pure returns (uint256) {\n return a + b;\n}\n```\n | none |
```\n/// @dev Adds two numbers, reverting on overflow.\nfunction \_add(int256 a, int256 b) private pure returns (int256 c) {\n c = a + b;\n if (c > 0 && a < 0 && b < 0) {\n LibRichErrors.rrevert(LibFixedMathRichErrors.BinOpError(\n LibFixedMathRichErrors.BinOpErrorCodes.SUBTRACTION\_OVERFLOW,\n ... | medium |
```\n function svTokenValue(GMXTypes.Store storage self) public view returns (uint256) {\n uint256 equityValue_ = equityValue(self);\n uint256 totalSupply_ = IERC20(address(self.vault)).totalSupply();\n if (equityValue_ == 0 || totalSupply_ == 0) return SAFE_MULTIPLIER;\n return equityValue_ * SAFE_MULTIPL... | medium |
```\nfunction uniTransferFrom(IERC20 token, address payable from, address to, uint256 amount) internal {\n if (amount > 0) {\n if (isETH(token)) {\n require(msg.value >= amount, "UniERC20: not enough value");\n if (msg.value > amount) {\n // Return remainder if exist\n ... | medium |
```\n// create and grant ADD\_PROTECTED\_TOKEN\_ROLE to this template\nacl.createPermission(this, controller, controller.ADD\_COLLATERAL\_TOKEN\_ROLE(), this);\n```\n | low |
```\nstartLiquidityMiningTime = block.timestamp; \n```\n | low |
```\nfunction mulDiv(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) {\n unchecked {\n // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use\n // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The res... | none |
```\n// SPDX-License-Identifier: UNLICENSED\npragma solidity 0.8.21;\n\nimport { SafeCast } from "@openzeppelin/contracts/utils/math/SafeCast.sol";\n\nerror BrokenTokenPriceFeed();\n\ncontract PassWithNegativePrice {\n\n using SafeCast for int256;\n\n uint256 public maxDeviations;\n int256 public currentRespon... | low |
```\nfunction add(uint256 a, uint256 b) internal pure returns (uint256) {\n uint256 c = a + b;\n require(c >= a, "SafeMath: addition overflow");\n return c;\n}\n```\n | none |
```\n function liquidatePendingPositionsPartyA(address partyA) internal {\n QuoteStorage.Layout storage quoteLayout = QuoteStorage.layout();\n require(\n MAStorage.layout().liquidationStatus[partyA],\n "LiquidationFacet: PartyA is solvent"\n );\n for (uint256 index =... | medium |
```\nif (swapQuantity != 0) {\n pool.swap(\n address(this),\n swapQuantity > 0,\n swapQuantity > 0 ? swapQuantity : -swapQuantity,\n swapQuantity > 0 ? TickMath.MIN\_SQRT\_RATIO + 1 : TickMath.MAX\_SQRT\_RATIO - 1,\n abi.encode(address(this))\n );\n}\n```\n | medium |
```\n function mintNFT(address asset, uint8 shortRecordId)\n external\n isNotFrozen(asset)\n nonReentrant\n onlyValidShortRecord(asset, msg.sender, shortRecordId)\n {\n if (shortRecordId == Constants.SHORT_MAX_ID) {\n revert Errors.CannotMintLastShortRecord();\n ... | low |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.