function stringlengths 12 7.23k | severity stringclasses 4
values |
|---|---|
```\n function _registerRecipient(bytes memory _data, address _sender)\n internal\n override\n onlyActiveRegistration\n returns (address recipientId)\n {\n …\n\n uint8 currentStatus = _getUintRecipientStatus(recipientId);\n\n if (currentStatus == uint8(Status.None)... | high |
```\nFile: LimitOrderRegistry.sol\n function setFastGasFeed(address feed) external onlyOwner {\n fastGasFeed = feed;\n }\n```\n | high |
```\nconstructor (address payable marketingWalletAddress) {\n \n _marketingWallet = marketingWalletAddress;\n\n _rOwned[_msgSender()] = _rTotal;\n \n IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); \n // Create a uniswap pair for this new token\n ... | none |
```\n uint256 intermediate = inWei.div(10**(token1.decimals() -\n token0.decimals()));\n```\n | medium |
```\n mapping(address => address) public nativeToBridgedToken;\n mapping(address => address) public bridgedToNativeToken;\n```\n | high |
```\nfunction _burn(address account, uint256 value) internal override {\n super._burn(account, value);\n\n magnifiedDividendCorrections[account] = magnifiedDividendCorrections[account]\n .add((magnifiedDividendPerShare.mul(value)).toInt256Safe());\n}\n```\n | none |
```\nmodifier onlyAuthorized() {\n require(\n ((msg.sender == L2CrossDomainMessenger &&\n OptimismL2Wrapper.messageSender() == positionHandlerL1) ||\n msg.sender == keeper),\n "ONLY\_AUTHORIZED"\n );\n \_;\n}\n```\n | medium |
```\n function getPriceUSD() external view override returns (uint256) {\n address[] memory pools = new address[](1);\n pools[0] = 0x60594a405d53811d3BC4766596EFD80fd545A270;\n uint256 DAIWethPrice = DAIEthOracle.quoteSpecificPoolsWithTimePeriod(\n 1000000000000000000, // 1 Eth\n ... | high |
```\nfunction \_beforeTokenTransfer(address from, address to, uint256 amount) internal override {\n uint256 balanceFrom = (from != address(0)) ? balanceOf(from) : 0;\n uint256 balanceTo = (from != address(0)) ? balanceOf(to) : 0;\n uint256 newTotalSupply = totalSupply()\n .add(from == address(0) ? amoun... | medium |
```\nFile: LiquidationModule.sol\n function liquidate(\n uint256 tokenID,\n bytes[] calldata priceUpdateData\n ) external payable whenNotPaused updatePythPrice(vault, msg.sender, priceUpdateData) {\n liquidate(tokenID);\n }\n\n /// @notice Function to liquidate a position.\n /// @dev... | medium |
```\n require(\_validityStatus, "CollateralizationOracleWrapper: CollateralizationOracle is invalid");\n\n // set cache variables\n cachedProtocolControlledValue = \_protocolControlledValue;\n cachedUserCirculatingFei = \_userCirculatingFei;\n cachedProtocolEquity = \_protocolEquity;\n\n // reset time... | medium |
```\nfunction tokenFromReflection(uint256 rAmount)\n public\n view\n returns (uint256)\n{\n require(\n rAmount <= _rTotal,\n "Amount must be less than total reflections"\n );\n uint256 currentRate = _getRate();\n return rAmount.div(currentRate);\n}\n```\n | none |
```\n //check swap value of 100tokens to USDC to protect against flash loan attacks\n uint256 amountOut; //amount received by trade\n bool stablePool; //if the traded pool is stable or volatile.\n (amountOut, stablePool) = router.getAmountOut(HUNDRED_TOKENS, token1, USDC);\n```\n | high |
```\nfunction registerClaimer(address \_claimerAddress, bool \_enabled) override external onlyClaimContract {\n // The name of the claiming contract\n string memory contractName = getContractName(msg.sender);\n // Record the block they are registering at\n uint256 registeredBlock = 0;\n // How many users... | low |
```\ncontract LiquidityMining is ILiquidityMining, ERC1155Receiver, Ownable {\n```\n | high |
```\nfunction getLiquidity() public view returns (uint256) {\n return liquidity;\n}\n```\n | none |
```\nconstructor(string memory _name, string memory _symbol)\n ERC20(_name, _symbol)\n{}\n```\n | none |
```\n// whitelist proposal\nif (proposal.flags[4]) {\n require(!tokenWhitelist[address(proposal.tributeToken)], "cannot already have whitelisted the token");\n require(!proposedToWhitelist[address(proposal.tributeToken)], 'already proposed to whitelist');\n proposedToWhitelist[address(proposal.tributeToken)] =... | low |
```\n function submitProposal(uint8 _actionType, bytes memory _payload) public onlyCouncil {\n uint256 proposalId = proposalCount;\n proposals[proposalId] = Proposal(msg.sender,_actionType, \n _payload, 0, false);\n proposalCount += 1;\n emit... | medium |
```\nif (removeParams.bucketCollateral == 0 && unscaledRemaining == 0 && lpsRemaining != 0) {\n emit BucketBankruptcy(params_.index, lpsRemaining);\n bucket.lps = 0;\n bucket.bankruptcyTime = block.timestamp;\n} else {\n bucket.lps = lpsRemaining;\n}\n```\n | high |
```\n // Cut withdraw fee if it is in withdrawVaultFee Window (2 months)\n if (\n block.timestamp <\n config.withdrawVaultFeeWindowStartTime() +\n config.withdrawVaultFeeWindow()\n ) {\n uint256 fee = (withdrawAmount * config.withdrawVaultFee()) /\n DENOMINATOR;\n ... | high |
```\nrequire(currencies[0] != 0 && currencies[1] != 0);\n```\n | low |
```\nfunction _addTokenToAllTokensEnumeration(uint256 tokenId) private {\n _allTokensIndex[tokenId] = _allTokens.length;\n _allTokens.push(tokenId);\n}\n```\n | none |
```\nfunction isExcludedFromAutoClaim(address account) external view onlyOwner returns (bool) {\n return excludedFromAutoClaim[account];\n}\n```\n | none |
```\nfunction _getRequiredPrefund(MemoryUserOp memory mUserOp) internal pure returns (uint256 requiredPrefund) {\nunchecked {\n //when using a Paymaster, the verificationGasLimit is used also to as a limit for the postOp call.\n // our security model might call postOp eventually twice\n uint256 mul = mUserOp.p... | none |
```\nfunction allowance(address owner, address spender) public view override returns (uint256) {\n return _allowances[owner][spender];\n}\n```\n | none |
```\nif (assetFrom[i - 1] == address(this)) {\n uint256 curAmount = curTotalAmount * curPoolInfo.weight / curTotalWeight;\n\n\n if (curPoolInfo.poolEdition == 1) {\n //For using transferFrom pool (like dodoV1, Curve), pool call transferFrom function to get tokens from adapter\n IERC20(midToken[i]).t... | medium |
```\nfunction liquidation(address provider, address onBehalfOf, uint256 assetAmount) external virtual {\n uint256 assetPrice = getAssetPrice();\n uint256 onBehalfOfCollateralRatio = (depositedAsset[onBehalfOf] \* assetPrice \* 100) / borrowed[onBehalfOf];\n require(onBehalfOfCollateralRatio < badCollateralRatio, "Borro... | medium |
```\nSLeverageSwapData memory swapData = abi.decode(data, (SLeverageSwapData));\nuint256 daiAmount =\n _swapAndTransferToSender(false, assetAddress, daiAddress, assetAmountIn, swapData.swapperData);\n```\n | medium |
```\nfunction set(uint256 \_pid, uint128 \_allocPoint, IRewarder \_rewarder, bool overwrite) public onlyGovernor {\n totalAllocPoint = (totalAllocPoint - poolInfo[\_pid].allocPoint) + \_allocPoint;\n poolInfo[\_pid].allocPoint = \_allocPoint.toUint64();\n\n if (overwrite) {\n rewarder[\_pid] = \_rewarde... | low |
```\n\n```\n | medium |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.