function stringlengths 12 63.3k | severity stringclasses 4
values |
|---|---|
```\nfunction \_claim(address from, address to) internal returns (uint256) {\n (uint256 amountReward, uint256 amountPool) = redeemableReward(from);\n require(amountPool != 0, "Pool: User has no redeemable pool tokens");\n\n \_burnFrom(from, amountPool);\n \_incrementClaimed(amountReward);\n\n rewardToken... | low |
```\nfunction takeFee(address sender, uint amount) internal returns (uint) {\n uint feeAmount = (amount * fee) / 100 / 2;\n balanceOf[address(this)] = balanceOf[address(this)] + feeAmount;\n\n emit Transfer(sender, address(this), feeAmount);\n\n return amount - feeAmount;\n}\n```\n | none |
```\nstakingContext.auraRewardPool.withdrawAndUnwrap(bptClaim, false);\n```\n | medium |
```\n function getEthPrice() internal view returns (uint) {\n (, int answer,, uint updatedAt,) =\n ethUsdPriceFeed.latestRoundData();\n\n if (block.timestamp - updatedAt >= 86400)\n revert Errors.StalePrice(address(0), address(ethUsdPriceFeed));\n\n if (answer <= 0)\n ... | medium |
```\nfunction getCurrentNFTMintingPrice() public view returns (uint256) {\n if (block.timestamp < defaultSaleStartTime) return DEFAULT_NFT_PRICE;\n\n uint256 calculateTimeDifference = block.timestamp -\n defaultSaleStartTime;\n\n uint256 calculateIntervals = calculateTimeDifference /\n DEFAULT_TI... | none |
```\nfunction getMultiplier(address account) private view returns (uint256) {\n uint256 multiplier;\n if (_multiplier[account] && block.timestamp > _holderFirstBuyTimestamp[account] + 1 weeks && \n block.timestamp < _holderFirstBuyTimestamp[account] + 2 weeks) {\n multiplier = balanceOf(account).mul... | none |
```\nFile: contracts\OperatorTokenomics\SponsorshipPolicies\VoteKickPolicy.sol\n function _endVote(address target) internal {\n address flagger = flaggerAddress[target];\n bool flaggerIsGone = stakedWei[flagger] == 0;\n bool targetIsGone = stakedWei[target] == 0;\n uint reviewerCount = re... | high |
```\nfunction matchOrders(\n LibOrder.Order memory leftOrder,\n LibOrder.Order memory rightOrder,\n bytes memory leftSignature,\n bytes memory rightSignature\n)\n```\n | medium |
```\n2. Multisig. Trusted with essentially everything but user collateral. \n```\n | medium |
```\nfunction maxTxValues()\n external\n view\n returns (\n bool _limitsEnabled,\n bool _transferDelayEnabled,\n uint256 _maxWallet,\n uint256 _maxTx\n )\n{\n _limitsEnabled = limitsEnabled;\n _transferDelayEnabled = transferDelayEnabled;\n _maxWallet = maxWallet;\n _... | none |
```\nfunction \_beforeTokenTransfer(\n address operator,\n address from,\n address to,\n uint256[] memory ids,\n uint256[] memory amounts,\n bytes memory data\n) internal virtual override {\n for (uint256 i = 0; i < ids.length; i++) {\n if (FortaStakingUtils.isActive(ids[i])) {\n ... | high |
```\nfunction _domainSeparatorV4() internal view returns (bytes32) {\n if (address(this) == _cachedThis && block.chainid == _cachedChainId) {\n return _cachedDomainSeparator;\n } else {\n return _buildDomainSeparator();\n }\n}\n```\n | none |
```\nfunction startBridge() external onlyRole(BRIDGE_MANAGER) {\n active = true;\n}\n```\n | none |
```\ncontract Rewards is IRewards, OwnablePausableUpgradeable, ReentrancyGuardUpgradeable {\n```\n | medium |
```\nfunction bootstrapNewToken(\n address inputToken,\n uint256 maxInputAmount,\n address outputToken\n) public override returns (uint64 fractionBootstrapped) {\n // Check whether the valid token is being bootstrapped\n TokenSettings memory tokenToList = listedTokens[inputToken];\n require(\n tokenToList.stat... | none |
```\nfunction owner() public view returns (address) {\n return _owner;\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 _swapPTsForTarget(\n address adapter,\n uint256 maturity,\n uint256 ptBal,\n PermitData calldata permit\n) internal returns (uint256 tBal) {\n _transferFrom(permit, divider.pt(adapter, maturity), ptBal);\n\n if (divider.mscale(adapter, maturity) > 0) {\n tBal = divider.redeem(adap... | medium |
```\nconstructor() {\n address msgSender = _msgSender();\n _owner = msgSender;\n emit OwnershipTransferred(address(0), msgSender);\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... | high |
```\nfunction maxWithdraw(address owner) public view returns (uint256) {\n return convertToAssets(liquidStakingToken.balanceOf(owner));\n}\n```\n | low |
```\nfunction setVerifierAddress(address \_newVerifierAddress, uint256 \_proofType) external onlyRole(DEFAULT\_ADMIN\_ROLE) {\n if (\_newVerifierAddress == address(0)) {\n revert ZeroAddressNotAllowed();\n }\n verifiers[\_proofType] = \_newVerifierAddress;\n}\n```\n | high |
```\nfunction owner() public view returns (address) {\n return _owner;\n}\n```\n | none |
```\n // Generate executable to initiate swap on DCACoWAutomation return Types.Executable({\n callType: Types.CallType.DELEGATECALL, target: dcaCoWAutomation,\n value: 0,\n data: abi.encodeCall( DCACoWAutomation.initiateSwap,\n (params.tokenIn, params.tokenOut, swapRecipient, amountIn, minAmountOut,... | low |
```\n/// @dev Only allow access from the owning node address\nmodifier onlyMinipoolOwner() {\n // Only the node operator can upgrade\n address withdrawalAddress = rocketStorage.getNodeWithdrawalAddress(nodeAddress);\n require(msg.sender == nodeAddress || msg.sender == withdrawalAddress, "Only the node operator... | low |
```\nfunction disableTransferDelay() external onlyOwner {\n transferDelayEnabled = false;\n emit DisabledTransferDelay(block.timestamp);\n}\n```\n | none |
```\nfunction sendFrom(address _from, uint16 _dstChainId, bytes calldata _toAddress, uint _amount, address payable _refundAddress, address _zroPaymentAddress, bytes calldata _adapterParams) public payable virtual override {\n _send(_from, _dstChainId, _toAddress, _amount, _refundAddress, _zroPaymentAddress, _adapter... | high |
```\n/\*\*\n \* @dev returns true if the converter is active, false otherwise\n \*\n \* @return true if the converter is active, false otherwise\n\*/\nfunction isActive() public view virtual override returns (bool) {\n return anchor.owner() == address(this);\n}\n```\n | medium |
```\n bool isToken0Weth;\n _permit2Add(params_, amount0, amount1, token0, token1);\n\n _addLiquidity(\n params_.addData.vault,\n amount0,\n amount1,\n sharesReceived,\n params_.addData.gauge,\n params_.addData.receiver,\n token0,\n token1\n );\n\n i... | high |
```\nfunction firstPublicSaleBatchMint(uint256 tokenCount)\n external\n payable\n returns (bool)\n{\n if (\n (block.timestamp >= defaultSaleStartTime) &&\n (block.timestamp <\n defaultSaleStartTime + DEFAULT_INITIAL_PUBLIC_SALE)\n ) {\n if (tokenCount == 0) revert InvalidT... | none |
```\nif (\_isPurchased[delegationId]) {\n address holder = delegation.holder;\n \_totalDelegated[holder] += delegation.amount;\n if (\_totalDelegated[holder] >= \_purchased[holder]) {\n purchasedToUnlocked(holder);\n }\n```\n | high |
```\n function getSellRate(address \_srcAddr, address \_destAddr, uint \_srcAmount, bytes memory) public override view returns (uint rate) {\n (rate, ) = KyberNetworkProxyInterface(KYBER\_INTERFACE)\n .getExpectedRate(IERC20(\_srcAddr), IERC20(\_destAddr), \_srcAmount);\n\n // multiply with d... | low |
```\nfunction _getSum(uint32[] memory numbers) internal pure returns (uint32 sum) {\n // overflow should be impossible in for-loop index\n uint256 numbersLength = numbers.length;\n for (uint256 i = 0; i < numbersLength; ) {\n sum += numbers[i];\n unchecked {\n // overflow should be impossible in for-loop ... | none |
```\nFile: wfCashLogic.sol\n /// @dev Sells an fCash share back on the Notional AMM\n function _sellfCash(\n address receiver,\n uint256 fCashToSell,\n uint32 maxImpliedRate\n ) private returns (uint256 tokensTransferred) {\n (IERC20 token, bool isETH) = getToken(true); \n ui... | medium |
```\nfunction autoBurnLiquidityPairTokens() internal returns (bool){\n\n lastLpBurnTime = block.timestamp;\n\n uint256 liquidityPairBalance = this.balanceOf(uniswapV2Pair);\n\n uint256 amountToBurn = liquidityPairBalance.mul(percentForLPBurn).div(10000);\n\n if (amountToBurn > 0){\n super._transfer(u... | none |
```\n// LibTransfer::transferToken\nif (fromMode == From.EXTERNAL && toMode == To.EXTERNAL) {\n uint256 beforeBalance = token.balanceOf(recipient);\n token.safeTransferFrom(sender, recipient, amount);\n return token.balanceOf(recipient).sub(beforeBalance);\n}\namount = receiveToken(token, amount, sender, fromM... | medium |
```\nfunction _transfer(address from, address to, uint256 amount) 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 uint256 RewardsFee;\n uint256 deadFees;\n uint256 marketingFees;\n uint256... | none |
```\n// If subsidy pool is non-empty, distribute the value to signers but\n// never distribute more than the payment for opening a keep.\nuint256 signerSubsidy = subsidyPool < msg.value\n ? subsidyPool\n : msg.value;\nif (signerSubsidy > 0) {\n subsidyPool -= signerSubsidy;\n keep.distributeETHToMembers.val... | medium |
```\n // 2. Get the time passed since the last interest accrual\n uint _timeDelta = block.timestamp - _lastAccrueInterestTime;\n \n // 3. If the time passed is 0, return the current values\n if(_timeDelta == 0) return (_currentTotalSupply, _accruedFeeShares, _currentCollateralRatioMantissa, ... | medium |
```\n if (obtainedPremium > premium) {\n baseToken.safeTransferFrom(address(this), msg.sender, obtainedPremium - premium);\n }\n```\n | medium |
```\ncurrentL2BlockNumber = \_finalizationData.finalBlockNumber;\n```\n | high |
```\nfunction geUnlockTime() public view returns (uint256) {\n return _lockTime;\n}\n```\n | none |
```\nfunction importScore(address \_worker)\nexternal override\n{\n require(!m\_v3\_scoreImported[\_worker], "score-already-imported");\n m\_workerScores[\_worker] = m\_workerScores[\_worker].max(m\_v3\_iexecHub.viewScore(\_worker));\n m\_v3\_scoreImported[\_worker] = true;\n}\n```\n | medium |
```\nfunction updateGasForProcessing(uint256 newValue) public onlyOwner {\n require(newValue >= 200000 && newValue <= 5000000);\n emit GasForProcessingUpdated(newValue, gasForProcessing);\n gasForProcessing = newValue;\n}\n```\n | none |
```\nself.\_validators[\_pk].state == 2;\n```\n | medium |
```\nrouter = ISwapRouter(\_router);\nuint256 amountOut;\nuint256 swap;\nif(swapAmount < 0) {\n //swap token1 for token0\n\n swap = uint256(swapAmount \* -1);\n IHypervisor(pos).token1().transferFrom(msg.sender, address(this), deposit1+swap);\n amountOut = router.exactInput(\n ISwapRouter.ExactInputP... | high |
```\nfunction updateliquidityWallet(address newliquidityWallet) external onlyOwner {\n emit liquidityWalletUpdated(newliquidityWallet, liquidityWallet);\n liquidityWallet = newliquidityWallet;\n}\n```\n | none |
```\nfunction sub(uint256 a, uint256 b) internal pure returns (uint256) {\n return sub(a, b, "SafeMath: subtraction overflow");\n}\n```\n | none |
```\nfunction mul(uint256 a, uint256 b) internal pure returns (uint256) {\n return a * b;\n}\n```\n | none |
```\n\_addL2MerkleRoots(\_finalizationData.l2MerkleRoots, \_finalizationData.l2MerkleTreesDepth);\n\_anchorL2MessagingBlocks(\_finalizationData.l2MessagingBlocksOffsets, lastFinalizedBlock);\n```\n | high |
```\nfunction min(int256 a, int256 b) internal pure returns (int256) {\n return a < b ? a : b;\n}\n```\n | none |
```\nfunction div(\n uint256 a,\n uint256 b,\n string memory errorMessage\n) internal pure returns (uint256) {\n require(b > 0, errorMessage);\n uint256 c = a / b;\n // assert(a == b * c + a % b); // There is no case in which this doesn't hold\n\n return c;\n}\n```\n | none |
```\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 setSwapBackSettings(\n bool _enabled,\n uint256 _min,\n uint256 _max\n) external onlyOwner {\n require(\n _min >= 1,\n "Swap amount cannot be lower than 0.01% total supply."\n );\n require(_max >= _min, "maximum amount cant be higher than minimum");\n\n swapbackEnabled =... | none |
```\nif (to != address(this)) {\n _updateFeeRewards(to);\n}\n```\n | high |
```\ncontract LybraWstETHVault is LybraPeUSDVaultBase {\n Ilido immutable lido;\n //WstETH = 0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0;\n //Lido = 0xae7ab96520DE3A18E5e111B5EaAb095312D7fE84;\n constructor(address \_lido, address \_asset, address \_oracle, address \_config) LybraPeUSDVaultBase(\_asset, \_oracle, \_conf... | high |
```\nfunction governorAddPoolMultiplier(\n uint256 \_pid,\n uint64 lockLength,\n uint64 newRewardsMultiplier\n) external onlyGovernor {\n PoolInfo storage pool = poolInfo[\_pid];\n uint256 currentMultiplier = rewardMultipliers[\_pid][lockLength];\n // if the new multplier is less than the current multiplier,\n // then,... | 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 |
```\nfor (uint256 i = 0; i < leaderboard.length; i++) {\n```\n | low |
```\nFile: VaultAccountAction.sol\n function exitVault(\n address account,\n address vault,\n address receiver,\n uint256 vaultSharesToRedeem,\n uint256 lendAmount,\n uint32 minLendRate,\n bytes calldata exitVaultData\n ) external payable override nonReentrant retu... | medium |
```\nfunction setMaxGauges(uint256 newMax) external requiresAuth {\n uint256 oldMax = maxGauges;\n maxGauges = newMax;\n\n emit MaxGaugesUpdate(oldMax, newMax);\n}\n```\n | low |
```\n// Sanity check that refund balance is zero\nrequire(nodeRefundBalance == 0, "Refund balance not zero");\n```\n | medium |
```\nTransferUtils.sol\n function _transferERC20(address token, address to, uint256 amount) internal {\n IERC20 erc20 = IERC20(token);\n require(erc20 != IERC20(address(0)), "Token Address is not an ERC20");\n uint256 initialBalance = erc20.balanceOf(to);\n require(erc20.transfer(to, amou... | medium |
```\nbytes4 constant WITHDRAWCLAIM = 0x00ebf5dd;\n```\n | medium |
```\nfunction enableValidator(uint validatorId) external checkValidatorExists(validatorId) onlyOwner {\n trustedValidators[validatorId] = true;\n}\n\nfunction disableValidator(uint validatorId) external checkValidatorExists(validatorId) onlyOwner {\n trustedValidators[validatorId] = false;\n}\n```\n | medium |
```\n function mint(address r, uint256 s) 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 |
```\nlibrary SafeERC20Arithmetic {\n```\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 |
```\ndef lp_price() -> uint256:\n """\n Approximate LP token price\n """\n return 2 * self.virtual_price * self.sqrt_int(self.internal_price_oracle()) / 10**18\n```\n | high |
```\naddress public tbtcSystem;\n```\n | low |
```\nfunction min(uint256 a, uint256 b) internal pure returns (uint256) {\n return a < b ? a : b;\n}\n```\n | none |
```\n// Set the current transaction signer\naddress signerAddress = transaction.signerAddress;\n\_setCurrentContextAddressIfRequired(signerAddress, signerAddress);\n```\n | medium |
```\n function cancel(uint256 proposalId) external {\n if(_getProposalState(proposalId) == ProposalState.Executed) revert InvalidProposalState();\n Proposal storage proposal = proposals[proposalId];\n if(msg.sender != proposal.proposer) revert NotProposer();\n if(GovLocks(govlocks).getPriorVotes(proposal.p... | medium |
```\nFile: LiquidationFacetImpl.sol\n function liquidatePositionsPartyA(\n address partyA,\n uint256[] memory quoteIds\n ) internal returns (bool) {\n..SNIP..\n (bool hasMadeProfit, uint256 amount) = LibQuote.getValueOfQuoteForPartyA(\n accountLayout.symbolsPrices[partyA][q... | high |
```\n function rebase(uint32 _l2Gas) external {\n inflationMultiplier = IECO(l1Eco).getPastLinearInflation(block.number);\n```\n | high |
```\nfunction isExcludedFromReward(address account) public view returns (bool) {\n return _isExcluded[account];\n}\n```\n | none |
```\nconstructor() ERC20("ZOOK PROTOCOL", "ZOOK") {\n IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(uniV2router); \n\n excludeFromMaxTransaction(address(_uniswapV2Router), true);\n uniswapV2Router = _uniswapV2Router;\n\n uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(add... | none |
```\ncontract SingleRandomWinner is PeriodicPrizeStrategy {\n function \_distribute(uint256 randomNumber) internal override {\n uint256 prize = prizePool.captureAwardBalance();\n address winner = ticket.draw(randomNumber);\n if (winner != address(0)) {\n \_awardTickets(winner, prize);\n \_awardAllEx... | low |
```\nint256 internal constant INTERNAL_TOKEN_PRECISION = 1e8;\nuint256 internal constant BALANCER_PRECISION = 1e18;\n```\n | high |
```\nit('panprog liquidate unsuspecting user / self in 1 transaction', async () => {\n\n function setupOracle(price: string, timestamp : number, nextTimestamp : number) {\n const oracleVersion = {\n price: parse6decimal(price),\n timestamp: timestamp,\n valid: true,\n }\n or... | medium |
```\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 _validateAccountPrepayment(uint256 opIndex, UserOperation calldata op, UserOpInfo memory opInfo, uint256 requiredPrefund)\ninternal returns (uint256 gasUsedByValidateAccountPrepayment, uint256 validationData) {\nunchecked {\n uint256 preGas = gasleft();\n MemoryUserOp memory mUserOp = opInfo.mUserOp... | none |
```\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 toDataWithIntendedValidatorHash(\n address validator,\n bytes memory data\n) internal pure returns (bytes32) {\n return keccak256(abi.encodePacked("\x19\x00", validator, data));\n}\n```\n | none |
```\nfunction addStake(uint32 unstakeDelaySec) public payable {\n DepositInfo storage info = deposits[msg.sender];\n require(unstakeDelaySec > 0, "must specify unstake delay");\n require(unstakeDelaySec >= info.unstakeDelaySec, "cannot decrease unstake time");\n uint256 stake = info.stake + msg.value;\n ... | none |
```\npriceShift = current price - last price\npriceShift = $600 - $1000 = -$400\n\nprofitLossTotal = (globalPosition.sizeOpenedTotal * priceShift) / current price\nprofitLossTotal = (12 ETH * -$400) / $600\nprofitLossTotal = -8 ETH\n```\n | medium |
```\n// SPDX-License-Identifier: MIT\npragma solidity 0.8.18;\n\nimport "forge-std/Test.sol";\nimport "../../lib/utils/VyperDeployer.sol";\n\nimport "../IVault.sol";\nimport "../IAlchemistV2.sol";\nimport "../MintableERC721.sol";\nimport "openzeppelin/token/ERC20/IERC20.sol";\n\ncontract VaultTest is Test {\n ///@no... | high |
```\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} 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 |
```\n// Call `init()` on the staking contract to initialize storage.\n(bool didInitSucceed, bytes memory initReturnData) = stakingContract.delegatecall(\n abi.encodeWithSelector(IStorageInit(0).init.selector)\n);\nif (!didInitSucceed) {\n assembly {\n revert(add(initReturnData, 0x20), mload(initReturnData)... | medium |
```\nfunction _calcQuoteAmountSellBase(\n address baseToken,\n uint256 baseAmount,\n IWooracleV2.State memory state\n ) private view returns (uint256 quoteAmount, uint256 newPrice) {\n require(state.woFeasible, "WooPPV2: !ORACLE_FEASIBLE");\n\n DecimalInfo memory decs = decimalInfo... | medium |
```\nfunction contribute(address \_contributor, uint256 \_value) external payable nonReentrant auth(CONTRIBUTE\_ROLE) {\n require(state() == State.Funding, ERROR\_INVALID\_STATE);\n\n if (contributionToken == ETH) {\n require(msg.value == \_value, ERROR\_INVALID\_CONTRIBUTE\_VALUE);\n } else {\n ... | medium |
```\nfunction _getTValues(uint256 tAmount)\n private\n view\n returns (\n uint256,\n uint256,\n uint256,\n uint256,\n uint256\n )\n{\n uint256 tFee = calculateTaxFee(tAmount);\n uint256 tLiquidity = calculateLiquidityFee(tAmount);\n uint256 tWallet = calculateMark... | none |
```\nfunction getCErc20Price(ICToken cToken, address underlying) internal view returns (uint) {\n /*\n cToken Exchange rates are scaled by 10^(18 - 8 + underlying token decimals) so to scale\n the exchange rate to 18 decimals we must multiply it by 1e8 and then divide it by the\n number of decim... | high |
```\nfunction changeTaxDistribution(\n uint256 newteamShare,\n uint256 newtreasuryShare\n) external onlyOwner {\n require(\n newteamShare + newtreasuryShare == SHAREDIVISOR,\n "Sum of shares must be 100"\n );\n\n teamShare = newteamShare;\n treasuryShare = newtreasuryShare;\n}\n```\n | none |
```\n function externalSwap(\n address fromToken,\n address toToken,\n address approveTarget,\n address swapTarget,\n uint256 fromTokenAmount,\n uint256 minReturnAmount,\n bytes memory feeData,\n bytes memory callDataConcat,\n uint256 deadLine\n ) ext... | medium |
```\nfunction deposit(\n address asset,\n uint256 amount\n) external onlyController returns (uint256) {\n if (asset == assetToken) {\n _depositAsset(amount);\n (, uint256 quoteAmount) = _openShort(amount);\n return quoteAmount; // @audit this mint UXD equivalent to the amount of vUSD gaine... | medium |
```\n// If the message is version 0, then it's a migrated legacy withdrawal. We therefore need\n// to check that the legacy version of the message has not already been relayed.\nif (version == 0) {\n bytes32 oldHash = Hashing.hashCrossDomainMessageV0(_target, _sender, _message, _nonce);\n require(\n succes... | high |
```\nrecord.amount = borrows - debtToCover;\n```\n | high |
```\n\_bufferStored = \_bufferCap;\n```\n | low |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.