nameid
stringlengths
9
36
content
stringlengths
2.12k
40.5k
tokens
float64
511
10.1k
LoC
float64
60
990
Centain
int64
0
128
Security issue
stringlengths
204
2.89k
VulnNumber
int64
1
376
35_ConcentratedLiquidityPosition.sol
// SPDX-License-Identifier: GPL-3.0-or-later pragma solidity >=0.8.0; import "../../interfaces/IBentoBoxMinimal.sol"; import "../../interfaces/IConcentratedLiquidityPool.sol"; import "../../interfaces/IMasterDeployer.sol"; import "../../interfaces/ITridentRouter.sol"; import "../../libraries/concentratedPool/FullMath...
1,188
140
0
1. H-06: ConcentratedLiquidityPosition.sol#collect() Users may get double the amount of yield when they call collect() before burn() (Double Bonus)
When a user calls ConcentratedLiquidityPosition.sol#collect() to collect their yield, it calcuates the yield based on position.pool.rangeFeeGrowth() and position.feeGrowthI...
3
44_Swap.sol
pragma solidity ^0.8.0; import "../governance/EmergencyPausable.sol"; import "../utils/Math.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import "@openzeppelin/contracts/utils/math/SafeMath.sol"; contract Swap is EmergencyPausabl...
2,733
264
1
1. H-01 Arbitrary contract call allows attackers to steal ERC20 from users' wallets (Unchecked external calls)
Swap.sol L220-L212 A call to an arbitrary contract with custom calldata is made in fillZrxQuote(), which means the contract can be an ERC20 token, and the calldata can be `transferFrom` a previously approved u...
5
3_MarginRouter.sol
// SPDX-License-Identifier: BUSL-1.1 pragma solidity ^0.8.0; import "@uniswap/v2-core/contracts/interfaces/IUniswapV2Factory.sol"; import "../libraries/UniswapStyleLib.sol"; import "./RoleAware.sol"; import "./Fund.sol"; import "../interfaces/IMarginTrading.sol"; import "./Lending.sol"; import "./Admin.sol"; import "...
2,888
403
1
1. [H-01]: Re-entrancy bug allows inflating balance (Reentrancy, Lack of Input Validation)
One can call the MarginRouter.crossSwapExactTokensForTokens function first with a fake contract disguised as a token pair: crossSwapExactTokensForTokens(0.0001 WETH, 0, [ATTACKER_CONTRACT], [WETH, WBTC]). When the amounts are com...
3
70_LiquidityBasedTWAP.sol
// SPDX-License-Identifier: Unlicense pragma solidity =0.8.9; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol"; import "../external/libraries/UniswapV2OracleLibrary.sol"; import "../interfaces/external/chainlink/IAggregatorV3.sol"; impor...
3,695
493
0
1. H-03 Oracle doesn't calculate USDV/VADER price correctly in `_calculateVaderPrice`
Invalid values returned from oracle for USDV and VADER prices in situations where the oracle uses more than one foreign asset.

2. H-04 Vader TWAP averages wrong
The vader price in LiquidityBasedTWAP.getVaderPrice is computed using th...
6
20_Pool.sol
// SPDX-License-Identifier: UNLICENSED pragma solidity 0.8.3; import "./interfaces/iBEP20.sol"; import "./interfaces/iUTILS.sol"; import "./interfaces/iDAO.sol"; import "./interfaces/iBASE.sol"; import "./interfaces/iDAOVAULT.sol"; import "./interfaces/iROUTER.sol"; import "./interfaces/iSYNTH.sol"; import "./interfac...
4,067
418
0
1. [H-02]: Pool.sol & Synth.sol: Failing Max Value Allowance (Lack of input validation)
In the _approve function and `approveAndCall`, if the allowance passed in is type(uint256).max, nothing happens (ie. allowance will still remain at previous value). Contract integrations (DEXes for example) tend to hardcode this val...
1
20_Synth.sol
// SPDX-License-Identifier: UNLICENSED pragma solidity 0.8.3; import "./Pool.sol"; import "./interfaces/iPOOLFACTORY.sol"; contract Synth is iBEP20 { address public BASE; address public LayerONE; // Underlying relevant layer1 token uint public genesis; address public DEPLOYER; string _name;...
2,248
255
0
1. H-02: Pool.sol & Synth.sol: Failing Max Value Allowance (Lack of input validation)
In the `_approve` function, if the allowance passed in is `type(uint256).max`, nothing happens (ie. allowance will still remain at previous value). Contract integrations (DEXes for example) tend to hardcode this value to set maximum a...
2
83_Shelter.sol
// SPDX-License-Identifier: MIT pragma solidity ^0.8.11; import { IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import { SafeERC20 } from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import { IShelter } from "./interfaces/IShelter.sol"; import { IShelterClient } from "./interfaces/IShe...
511
60
1
1. [H-03] Repeated Calls to Shelter.withdraw Can Drain All Funds in Shelter (L52-L57) (Reentrancy)
Anyone who can call `withdraw` to withdraw their own funds can call it repeatedly to withdraw the funds of others. withdraw should only succeed if the user hasn't withdrawn the token already.

2. [H-07] Shelter claimed ma...
5
107_yVault.sol
// SPDX-License-Identifier: GPL-3.0 pragma solidity ^0.8.0; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import "@openzeppelin/contracts/utils/Address.sol"; import "../../interfaces/IContr...
1,617
204
1
1. [H-01] yVault: First depositor can break minting of shares L148-L153 in `deposit` function
The attack vector and impact is the same as TOB-YEARN-003, where users may not receive shares in exchange for their deposits if the total asset amount has been manipulated through a large “donation”.

2. [H-04] Reentrancy issu...
5
66_sYETIToken.sol
//SPDX-License-Identifier: MIT pragma solidity 0.6.12; import "./BoringCrypto/BoringMath.sol"; import "./BoringCrypto/BoringERC20.sol"; import "./BoringCrypto/Domain.sol"; import "./BoringCrypto/ERC20.sol"; import "./BoringCrypto/IERC20.sol"; import "./BoringCrypto/BoringOwnable.sol"; import "./IsYETIRouter.sol"; in...
3,607
345
1
1. [H-02] Yeti token rebase checks the additional token amount incorrectly (Timestamp manipulation)
The condition isn't checked now as the whole balance is used instead of the Yeti tokens bought back from the market. As it's not checked, the amount added to `effectiveYetiTokenBalance` during rebase can exceed the actua...
2
20_synthVault.sol
// SPDX-License-Identifier: UNLICENSED pragma solidity 0.8.3; import "./interfaces/iBEP20.sol"; import "./interfaces/iDAO.sol"; import "./interfaces/iBASE.sol"; import "./interfaces/iPOOL.sol"; import "./interfaces/iSYNTH.sol"; import "./interfaces/iUTILS.sol"; import "./interfaces/iRESERVE.sol"; import "./interfaces/i...
3,059
313
1
1. [H-01] SynthVault withdraw forfeits rewards
The `SynthVault.withdraw` function does not claim the user's rewards. It decreases the user's weight and therefore they are forfeiting their accumulated rewards. The synthReward variable in `_processWithdraw` is also never used - it was probably intended that this variable...
4
28_SushiToken.sol
pragma solidity 0.6.12; import "./ERC20.sol"; import "../interfaces/IMisoToken.sol"; import "../OpenZeppelin/access/AccessControl.sol"; // --------------------------------------------------------------------- // // SushiToken with Governance. // // From the MISO Token Factory // Made for Sushi.com // // Enjoy. (c) ...
2,538
317
1
1. H-02: SushiToken transfers are broken due to wrong delegates accounting on transfers (Delegatecall)
When minting / transferring / burning tokens, the SushiToken._beforeTokenTransfer function is called and supposed to correctly shift the voting power due to the increase/decrease in tokens for the from and to accounts...
1
8_NFTXFeeDistributor.sol
// SPDX-License-Identifier: MIT pragma solidity ^0.6.8; import "./interface/INFTXLPStaking.sol"; import "./interface/INFTXFeeDistributor.sol"; import "./interface/INFTXVaultFactory.sol"; import "./token/IERC20Upgradeable.sol"; import "./util/SafeERC20Upgradeable.sol"; import "./util/SafeMathUpgradeable.sol"; import "...
1,766
173
3
1. [M-05] Unbounded iteration in NFTXEligiblityManager.distribute over _feeReceivers (Gas Limit)
NFTXEligiblityManager.`distribute` iterates over all _feeReceivers. If the number of _feeReceivers gets too big, the transaction's gas cost could exceed the block gas limit and make it impossible to call distribute at all.
...
3
29_IndexPool.sol
// SPDX-License-Identifier: GPL-3.0-or-later pragma solidity >=0.8.0; import "../interfaces/IBentoBoxMinimal.sol"; import "../interfaces/IMasterDeployer.sol"; import "../interfaces/IPool.sol"; import "../interfaces/ITridentCallee.sol"; import "./TridentERC20.sol"; /// @notice Trident exchange pool template with cons...
3,822
387
2
1. [H-01] Flash swap call back prior to transferring tokens in indexPool
IndexPool.sol#L196-L223
In the IndexPool contract, `flashSwap` does not work. The callback function is called prior to token transfer. The sender won't receive tokens in the callBack function. ITridentCallee(msg.sender).tridentSwapCallback(context...
11
16_Trader.sol
// SPDX-License-Identifier: GPL-3.0-or-later pragma solidity ^0.8.0; import "./Interfaces/ITracerPerpetualSwaps.sol"; import "./Interfaces/Types.sol"; import "./Interfaces/ITrader.sol"; import "./lib/LibPerpetuals.sol"; import "./lib/LibBalances.sol"; import {ECDSA} from "@openzeppelin/contracts/utils/cryptography/ECD...
2,063
250
2
1. [M-05] Add reentrancy protections on function executeTrade (reentrancy)
As written in the to-do comments, reentrancy could happen in the `executeTrade` function of Trader since the makeOrder.market can be a user-controlled external contract.

2. [M-13] Trader orders can be front-run and users can be denied from trad...
2
78_FlashGovernanceArbiter.sol
// SPDX-License-Identifier: MIT pragma solidity 0.8.4; import "./Governable.sol"; import "hardhat/console.sol"; import "../facades/Burnable.sol"; ///@title Flash Governance Arbiter ///@author Justin Goro /**@notice LimboDAO offers two forms of governance: flash and proposal. Proposals are contracts that have authoriza...
1,932
191
3
1. H-01: Lack of access control on `assertGovernanceApproved` can cause funds to be locked (Lack of Access Control)
Lack of access control on the `assertGovernanceApproved` function of FlashGovernanceArbiter allows anyone to lock other users' funds in the contract as long as the users have approved the contract to tran...
6
12_Witch.sol
// SPDX-License-Identifier: BUSL-1.1 pragma solidity ^0.8.0; import "./utils/access/AccessControl.sol"; import "./interfaces/vault/ILadle.sol"; import "./interfaces/vault/ICauldron.sol"; import "./interfaces/vault/DataTypes.sol"; import "./math/WMul.sol"; import "./math/WDiv.sol"; import "./math/WDivUp.sol"; import "....
867
87
1
1. [M-03] Witch can't give back vault after 2x grab (Reentrancy)
The witch.sol contract gets access to a vault via the grab function in case of liquidation. If the witch.sol contract can't sell the debt within a certain amount of time, a second grab can occur.
1
19_TransactionManager.sol
pragma solidity 0.8.4; import "./interfaces/IFulfillHelper.sol"; import "./interfaces/ITransactionManager.sol"; import "./lib/LibAsset.sol"; import "./lib/LibERC20.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; contract TransactionMana...
2,943
278
2
1. [H-01] Anyone can arbitrarily add router liquidity. L88-L98. (Access control)
The `addLiquidity()` function takes a router address parameter, whose liquidity is increased (instead of assuming that router == msg.sender like is done on removeLiquidity()) on this contract/chain, by transferring the fund amount from rou...
3
23_CompoundToNotionalV2.sol
// SPDX-License-Identifier: GPL-3.0-only pragma solidity >0.7.0; pragma experimental ABIEncoderV2; import "interfaces/compound/CTokenInterface.sol"; import "interfaces/compound/CErc20Interface.sol"; import "interfaces/notional/NotionalProxy.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; contract Compo...
924
99
3
1. H-03: CompoundToNotionalV2.notionalCallback ERC20 return values not checked (Unchecked external calls)
Some tokens (like USDT) don't correctly implement the EIP20 standard and their `transfer/transferFrom` functions return `void`, instead of a success boolean. Calling these functions with the correct EIP20 function ...
3
8_NFTXVaultUpgradeable.sol
// SPDX-License-Identifier: MIT pragma solidity 0.6.8; import "./interface/INFTXVaultFactory.sol"; import "./interface/INFTXEligibility.sol"; import "./interface/INFTXEligibilityManager.sol"; import "./interface/INFTXLPStaking.sol"; import "./interface/INFTXFeeDistributor.sol"; import "./interface/IPrevNftxContract.s...
3,228
440
2
1. [H-03] getRandomTokenIdFromFund yields wrong probabilities for ERC1155 (Predictable randomness)
NFTXVaultUpgradeable.`getRandomTokenIdFromFund` does not work with ERC1155 as it does not take the deposited quantity1155 into account.

2. [H-04] NFTXLPStaking Is Subject To A Flash Loan Attack That Can Steal Nearly All ...
4
83_ConvexStakingWrapper.sol
// SPDX-License-Identifier: MIT pragma solidity ^0.8.11; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "@openzeppelin/...
2,485
298
1
1. H-04: ConvexStakingWrapper, StakingRewards Wrong implementation will send concur rewards to the wrong receiver. L246
In `deposit` function, (Lack of Input Validation)

2. H-06: ConvexStakingWrapper.sol#_calcRewardIntegral Wrong implementation can disrupt rewards calculation and distribution. L175-L204
In `_calcRewar...
11
18_LendingPair.sol
// SPDX-License-Identifier: UNLICENSED // Copyright (c) 2021 0xdev0 - All rights reserved // https://twitter.com/0xdev0 pragma solidity ^0.8.0; import './interfaces/IERC20.sol'; import './interfaces/ILPTokenMaster.sol'; import './interfaces/ILendingPair.sol'; import './interfaces/IController.sol'; import './interfac...
4,587
578
0
1. H-01: Reward computation is wrong (Precision Control)
The LendingPair.`accrueAccount` function distributes rewards before updating the cumulative supply / borrow indexes as well as the index + balance for the user (by minting supply tokens / debt). This means the percentage of the user's balance to the total is not ...
3
25_CompositeMultiOracle.sol
// SPDX-License-Identifier: BUSL-1.1 pragma solidity 0.8.1; import "../../utils/access/AccessControl.sol"; import "../../interfaces/vault/IOracle.sol"; import "../../math/CastBytes32Bytes6.sol"; /** * @title CompositeMultiOracle */ contract CompositeMultiOracle is IOracle, AccessControl { using CastBytes32Byte...
1,354
157
1
H-01: CompositeMultiOracle returns wrong decimals for prices? (Unchecked return values)
The CompositeMultiOracle.peek/get functions seem to return wrong prices. It's unclear what decimals source.decimals refers to in this case. Does it refer to source.source token decimals? `_peek` function
1
14_SushiYieldSource.sol
// SPDX-License-Identifier: GPL-3.0 pragma solidity 0.6.12; import { IYieldSource } from "@pooltogether/yield-source-interface/contracts/IYieldSource.sol"; import "@openzeppelin/contracts/math/SafeMath.sol"; import "./ISushiBar.sol"; import "./ISushi.sol"; /// @title A pooltogether yield source for sushi token /// ...
818
94
2
1. [M-02] Return values of ERC20 transfer and transferFrom are unchecked (Unchecked external calls)
In the contracts BadgerYieldSource and SushiYieldSource, the return values of ERC20 transfer and transferFrom are not checked to be true, which could be false if the transferred tokens are not ERC20-compliant (e.g., BADG...
2
69_NFTXStakingZap.sol
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "./interface/INFTXVault.sol"; import "./interface/INFTXVaultFactory.sol"; import "./interface/INFTXSimpleFeeDistributor.sol"; import "./interface/INFTXLPStaking.sol"; import "./interface/INFTXInventoryStaking.sol"; import "./interface/ITimelockRewardDistr...
4,834
481
4
1. [H-03] A vault can be locked from MarketplaceZap and StakingZap
Function `_addLiquidity721WETH` and `_addLiquidity1155WETH`
` require(balance == IERC20Upgradeable(vault).balanceOf(address(this)), "Did not receive expected balance");`

2. [M-01] Missing non reentrancy modifier (Reentrancy)

3. [M-04] NFTXStakingZap...
6
5_Pools.sol
// SPDX-License-Identifier: UNLICENSED pragma solidity 0.8.3; // Interfaces import "./interfaces/iERC20.sol"; import "./interfaces/iUTILS.sol"; import "./interfaces/iVADER.sol"; import "./interfaces/iFACTORY.sol"; contract Pools { // Parameters bool private inited; uint public pooledVADER; uint publi...
2,783
248
3
1. [H-01] Unhandled return value of transfer in transferOut() of Pools.sol (Unchecked return values)
ERC20 implementations are not always consistent. Some implementations of `transfer` and `transferFrom` could return ‘false’ on failure instead of reverting. It is safer to wrap such calls into require() statements to ha...
8
6_Beebots.sol
pragma solidity 0.7.6; interface IERC165 { function supportsInterface(bytes4 interfaceId) external view returns (bool); } interface IERC721 is IERC165 { event Transfer(address indexed from, address indexed to, uint256 indexed tokenId); event Approval(address indexed owner, address indexed approved, uint25...
5,567
662
0
1. H-03: Beebots.TradeValid() Will Erroneously Return True When Maker Is Set To Address(0) and makerIds Are Set To The TokenIds of Unminted Beebot NFTs (Lack of input valiadation)
when TradeValid() function, when input `maker` is address(0)
1
12_AccessControl.sol
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @dev Contract module that allows children to implement role-based access * control mechanisms. * * Roles are referred to by their `bytes4` identifier. These are expected to be the * signatures for all the functions in the contract. Special roles sho...
2,019
257
0
1. [H-02] auth collision possible (Auth issue)
The `auth` mechanism of AccessControl.sol uses function selectors (msg.sig) as a (unique) role definition. Also the _moduleCall allows the code to be extended.

2. [M-09] auth only works well with external functions (Unused modifiers, Insufficient Access Control)
The `auth...
2
78_FlanBackstop.sol
// SPDX-License-Identifier: MIT pragma solidity 0.8.4; import "./facades/FlanLike.sol"; import "./facades/PyroTokenLike.sol"; import "./DAO/Governable.sol"; import "./ERC677/ERC20Burnable.sol"; import "./facades/UniPairLike.sol"; import "hardhat/console.sol"; ///@title FlanBackstop (placeholder name) ///@author Justin...
1,684
129
0
1. H-05: Flash loan price manipulation in `purchasePyroFlan()`. L54
The comment on line 54 of FlanBackstop.sol states "the opportunity for price manipulation through flash loans exists", and I agree that this is a serious risk.
1
123_ConvexMasterChef.sol
// SPDX-License-Identifier: MIT pragma solidity 0.6.12; import "@openzeppelin/contracts-0.6/math/SafeMath.sol"; import "@openzeppelin/contracts-0.6/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts-0.6/token/ERC20/SafeERC20.sol"; import "@openzeppelin/contracts-0.6/utils/Context.sol"; import "@openzeppelin/con...
2,679
314
2
1. M-13: ConvexMasterChef: When `_lpToken` is cvx, reward calculation is incorrect (Reward calculation)

2. M-15: ConvexMasterChef: `safeRewardTransfer` can cause loss of funds (Fund Loss)
All calculations are rounded down, since a lack of tokens in the contracts cannot be rounding errors' fault. So the function is red...
6
71_Vault.sol
pragma solidity 0.8.7; /** * @author InsureDAO * @title InsureDAO vault contract * @notice * SPDX-License-Identifier: GPL-3.0 */ import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import "./interfaces/IOwnership.sol"; import "./interfaces/IV...
3,531
513
1
1. [H-01] Tokens can be burned with no access control L382 (Access control)
The Vault.sol contract has two address state variables, the keeper variable and the controller variable, which are both permitted to be the zero address. If both variables are zero simultaneously, any address can burn the available funds (avai...
7
31_veCVXStrategy.sol
// SPDX-License-Identifier: MIT pragma solidity ^0.6.11; pragma experimental ABIEncoderV2; import "../deps/@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol"; import "../deps/@openzeppelin/contracts-upgradeable/math/SafeMathUpgradeable.sol"; import "../deps/@openzeppelin/contracts-upgradeable/math...
4,510
520
0
1. [H-01] veCVXStrategy.manualRebalance has wrong logic
The `veCVXStrategy.manualRebalance` function computes two ratios `currentLockRatio` and `newLockRatio` and compares them. However, these ratios compute different things and are not comparable.
1
14_IdleYieldSource.sol
// SPDX-License-Identifier: GPL-3.0 pragma solidity 0.8.4; import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; import "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol"; import "@openzeppelin/contracts-upgradeable/token/ERC20/utils/SafeERC20Upgradeable.sol"; import "@openze...
1,516
154
1
1. [H-01] User could lose underlying tokens when redeeming from the IdleYieldSource
The `redeemToken` function in IdleYieldSource uses redeemedShare instead of redeemAmount as the input parameter when calling redeemIdleToken of the Idle yield source. As a result, users could get fewer underlying tokens than they should...
3
36_Basket.sol
pragma solidity =0.8.7; import { SafeERC20 } from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import { IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import { ERC20Upgradeable } from "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol"; import { Ownable } from "@openze...
1,741
254
3
1. H-01: Re-entrancy in `settleAuction` allow stealing all funds (Reentrancy)
Note that the `Basket` contract approved the `Auction` contract with all tokens and the `settleAuction` function allows the auction bonder to transfer all funds out of the basket to themselves. 

2. H-02: Basket.sol#auctionBurn() A failed auc...
8
193_Pair.sol
// SPDX-License-Identifier: MIT pragma solidity ^0.8.17; import "solmate/tokens/ERC20.sol"; import "solmate/tokens/ERC721.sol"; import "solmate/utils/MerkleProofLib.sol"; import "solmate/utils/SafeTransferLib.sol"; import "openzeppelin/utils/math/Math.sol"; import "./LpToken.sol"; import "./Caviar.sol"; /// @title P...
4,588
486
2
1. [H-01] Reentrancy in buy function for ERC777 tokens allows buying funds with considerable discount. (Reentrancy)
Current implementation of functions `add`, `remove`, `buy` and `sell` first transfer fractional tokens, and then base tokens.

2. [H-02] Liquidity providers may lose funds when adding liquidity (overflow)...
6
106_NFTLoanFacilitator.sol
// SPDX-License-Identifier: AGPL-3.0-only pragma solidity 0.8.12; import {IERC721} from "@openzeppelin/contracts/token/ERC721/IERC721.sol"; import {SafeTransferLib, ERC20} from "@rari-capital/solmate/src/utils/SafeTransferLib.sol"; import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol"; import {INFTLoanFa...
3,338
389
2
1. [H-01] Can force borrower to pay huge interest. 
The loan amount is used as a min loan amount. It can be matched as high as possible (realistically up to the collateral NFT's worth to remain in profit) and the borrower has to pay interest on the entire amount instead of just on the desired loan amount when the loan ...
9
36_Auction.sol
pragma solidity =0.8.7; import { SafeERC20 } from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import './interfaces/IFactory.sol'; import './interfaces/IBasket.sol'; import "./interfaces/IAuction.sol"; import "hardhat/console.sol"; contract Auction is IAuction { using SafeERC20 for IERC20; uint...
1,101
152
2
1. [H-01] Re-entrancy in settleAuction allow stealing all funds (reentrancy)
Function `settleAuction()`

2. M-01: Use safeTransfer instead of `transfer`.

3. M-03: `onlyOwner` Role Can Unintentionally Influence `settleAuction()`. (Centralization risks)

4. M-07: No minimum rate in the auction may break the protocol und...
9
17_PnL.sol
// SPDX-License-Identifier: AGPLv3 pragma solidity >=0.6.0 <0.7.0; import "@openzeppelin/contracts/math/SafeMath.sol"; import "../interfaces/IPnL.sol"; import "../common/Controllable.sol"; import "../interfaces/IPnL.sol"; import "../common/Constants.sol"; import {FixedGTokens} from "../common/FixedContracts.sol"; ///...
2,827
310
1
1. [H-01] implicit underflows. (underflow)
`function decreaseGTokenLastAmount(bool pwrd, uint256 dollarAmount, uint256 bonus).`

2. [H-03] Incorrect use of operator leads to arbitrary minting of GVT tokens.
function `distributeStrategyGainLoss()`
2
74_TimeswapPair.sol
// SPDX-License-Identifier: MIT pragma solidity =0.8.4; import {IPair} from './interfaces/IPair.sol'; import {IFactory} from './interfaces/IFactory.sol'; import {IERC20} from '@openzeppelin/contracts/token/ERC20/IERC20.sol'; import {MintMath} from './libraries/MintMath.sol'; import {BurnMath} from './libraries/BurnMat...
3,200
379
2
1. [H-01] TimeswapPair.sol#borrow() Improper implementation allows attacker to increase pool.state.z to a large value (overflow)
n the current implementation, borrow() takes a user input value of zIncrease, while the actual collateral asset transferred in is calculated at L319, the state of pool.state.z still increased...
8
14_YieldSourcePrizePool.sol
// SPDX-License-Identifier: GPL-3.0 pragma solidity >=0.6.0 <0.7.0; import "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol"; import "@openzeppelin/contracts-upgradeable/token/ERC20/SafeERC20Upgradeable.sol"; import "@pooltogether/yield-source-interface/contracts/IYieldSource.sol"; import "../P...
799
82
0
1. L-01: no check for _stakeToken!=0. (Unchecked value)
The `initializeYieldSourcePrizePool` function of YieldSourcePrizePool.sol has a check to make sure _yieldSource !=0. However, the initialize function of the comparable StakePrizePool.sol doesn't do this check.
1
68_SingleTokenJoinV2.sol
//SPDX-License-Identifier: Unlicense pragma experimental ABIEncoderV2; pragma solidity ^0.7.5; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/math/SafeMath.sol"; import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol"; import {IPangolinRouter} from "@pangolindex/exchange-co...
1,021
137
3
1. [H-01] Unused ERC20 tokens are not refunded, and can be stolen by attacker. L57-L78
Function `joinTokenSingle`. As a result, the leftover underlying tokens won’t be returned to the user, which constitutes users’ fund loss.

2. [M-01] Function joinTokenSingle in SingleTokenJoin.sol and SingleTokenJoinV2.sol can be ma...
4
83_MasterChef.sol
// SPDX-License-Identifier: MIT pragma solidity ^0.8.11; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import "@openzeppelin...
2,120
227
2
1. [H-01] Wrong reward token calculation in MasterChef contract.
`function add(address _token, uint _allocationPoints, uint16 _depositFee, uint _startBlock)`

2. [H-02] Masterchef: Improper handling of `deposit` fee. L170-172
However, the `deposit` fee is not credited to anyone, leading to permanent lockups of deposit...
12
71_IndexTemplate.sol
pragma solidity 0.8.7; /** * @author InsureDAO * @title InsureDAO market template contract * SPDX-License-Identifier: GPL-3.0 */ import "hardhat/console.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol"; import "./InsureDAOERC...
5,171
670
1
1. [H-08] IndexTemplate.sol#compensate() will most certainly fail. (Precision loss)
Precision loss while converting between `the amount of shares` and `the amount of underlying tokens` back and forth is not handled properly.

2. [H-12] IndexTemplate.sol Wrong implementation allows lp of the index pool to resume a locke...
3
112_StakerVault.sol
// SPDX-License-Identifier: GPL-3.0-or-later pragma solidity 0.8.9; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; import "../libraries/ScaledMath.sol"; import "../li...
3,192
405
1
1. [H-01] User can steal all rewards due to checkpoint after transfer.
In StakerVault.sol, the user checkpoints occur AFTER the balances are updated in the `transfer()` function. The user checkpoints update the amount of rewards claimable by the user. Since their rewards will be updated after transfer, a user can send ...
2
64_TwabRewards.sol
// SPDX-License-Identifier: GPL-3.0 pragma solidity 0.8.6; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import "@pooltogether/v4-core/contracts/interfaces/ITicket.sol"; import "./interfaces/ITwabRewards.sol"; /** * @title PoolTogether V4...
3,942
481
3
1. [H-01] `createPromotion()` Lack of input validation for _epochDuration can potentially freeze promotion creator's funds
(Input validation)

2. [H-04] `cancelPromotion` is too rigorous
When you cancel a promotion with `cancelPromotion()` then the promotion is complete deleted. This means no-one can claim any rewards ...
7
17_Exposure.sol
// SPDX-License-Identifier: AGPLv3 pragma solidity >=0.6.0 <0.7.0; pragma experimental ABIEncoderV2; import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol"; import "@openzeppelin/contracts/math/SafeMath.sol"; import "../common/StructDefinitions.sol"; import "../common/Constants.sol"; import "../common/Controllable...
3,117
319
1
1. [H-01] implicit underflows. (Overflow)
function `sortVaultsByDelta`. There are a few underflows that are converted via a typecast afterwards to the expected value. If solidity 0.8.x would be used, then the code would revert.

2. [H-04] sortVaultsByDelta doesn't work as expected in `sortVaultsByDelta`
Suppose all the...
2
75_XDEFIDistribution.sol
// SPDX-License-Identifier: MIT pragma solidity =0.8.10; import { ERC721, ERC721Enumerable, Strings } from "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol"; import { IERC20, SafeERC20 } from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import { IEIP2612 } from "./interfaces/IEIP26...
3,290
349
1
1. [H-01] Malicious early user/attacker can malfunction the contract and even freeze users' funds in edge cases. (Ether Freeze, Centralization risks)
The function `updateDistribution`, `_pointsPerUnit += ((newXDEFI * _pointsMultiplier) / totalUnitsCached);`

2. [H-02] The reentrancy vulnerability in _safeMint can allow...
2
38_QuickAccManager.sol
// SPDX-License-Identifier: agpl-3.0 pragma solidity ^0.8.7; import "../Identity.sol"; import "../interfaces/IERC20.sol"; contract QuickAccManager { // Note: nonces are scoped by identity rather than by accHash - the reason for this is that there's no reason to scope them by accHash, // we merely need them for repl...
2,281
180
0
1. [H-02] QuickAccManager.sol#cancel() Wrong hashTx makes it impossible to cancel a scheduled transaction
In QuickAccManager.sol#`cancel()`, the hashTx to identify the transaction to be canceled is wrong. The last parameter is missing.

2. [H-03] Signature replay attacks for different identities (nonce on wrong party)
...
3
17_Buoy3Pool.sol
// SPDX-License-Identifier: AGPLv3 pragma solidity >=0.6.0 <0.7.0; import "@openzeppelin/contracts/math/SafeMath.sol"; import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol"; import {FixedStablecoins} from "contracts/common/FixedContracts.sol"; import {ICurv...
2,761
260
1
1. [H-01] implicit underflows (overflow)
function `safetyCheck()`

2. [H-02] Buoy3Pool.safetyCheck is not precise and has some assumptions (Unclear Function)

3. [M-01] Usage of deprecated ChainLink API in Buoy3Pool (Dependence on Chainlink)
The Chainlink API `latestAnswer` used in the Buoy3Pool oracle wrappers is depr...
4
192_Position.sol
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol"; import "@openzeppelin/contracts/utils/Counters.sol"; import "./utils/MetaContext.sol"; import "./interfaces/IPosition.sol"; contract Position is ERC721Enumerable, MetaContext, IPositi...
3,889
331
1
1. [H-07] reentrancy attack during `mint()`function in Position contract which can lead to removing of the other user's limit orders or stealing contract funds because initId is set low value
(Reentrancy)
1
5_USDV.sol
// SPDX-License-Identifier: UNLICENSED pragma solidity 0.8.3; // Interfaces import "./interfaces/iERC20.sol"; import "./interfaces/iVADER.sol"; import "./interfaces/iROUTER.sol"; contract USDV is iERC20 { // ERC-20 Parameters string public override name; string public override symbol; uint public overrid...
1,713
219
2
1. [H-02] Flash attack mitigation does not work as intended in USDV.sol (Flash loan attack prevention)
One of the stated protocol (review) goals is to detect susceptibility to “Any attack vectors using flash loans on Anchor price, synths or lending.” As such, USDV contract aims to protect against flash attacks using `f...
3
58_UniV3Vault.sol
// SPDX-License-Identifier: GPL-2.0-or-later pragma solidity 0.8.9; import "@openzeppelin/contracts/utils/structs/EnumerableSet.sol"; import "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "./interfaces/external/univ3/INonfungiblePositio...
2,299
245
1
1. [H-03] UniV3Vault.sol#collectEarnings() can be front run (Front-running)
For UniV3Vault, it seems that lp fees are collected through `collectEarnings()` callable by the strategy and reinvested (rebalanced).
However, in the current implementation, unharvested yields are not included in `tvl()`, making it vulnerable t...
1
16_Pricing.sol
// SPDX-License-Identifier: GPL-3.0-or-later pragma solidity ^0.8.0; import "./lib/LibMath.sol"; import "./lib/LibPrices.sol"; import "./Interfaces/IPricing.sol"; import "./Interfaces/ITracerPerpetualSwaps.sol"; import "./Interfaces/IInsurance.sol"; import "./Interfaces/IOracle.sol"; import "prb-math/contracts/PRBMath...
2,497
274
0
1. [H-01] Wrong trading pricing calculations (Pricing calculations)
In the Pricing contract, an agent can manipulate the trading prices by spamming a high amount of trades.
now every order calls a `Pricing.recordTrade` using the arbitrary price set by the agent.

2. [H-02] Use of incorrect index leads to incorrect upda...
2
30_Vault.sol
// SPDX-License-Identifier: MIT pragma solidity 0.6.12; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/math/SafeMath.sol"; import "@openzeppelin/contracts/utils/Address.sol"; import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol"; import "@openzeppelin/contracts/GSN/Conte...
2,561
409
0
1. [H-05] Vault treats all tokens exactly the same that creates (huge) arbitrage opportunities.
`_shares = _shares.add(_amount);` in function `depositMultiple`

2. [H-06] earn results in decreasing share price. Function `available()`

3. [H-10] An attacker can steal funds from multi-token vaults Function `balanceOfThi...
3
69_NFTXSimpleFeeDistributor.sol
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "./interface/INFTXLPStaking.sol"; import "./interface/INFTXSimpleFeeDistributor.sol"; import "./interface/INFTXInventoryStaking.sol"; import "./interface/INFTXVaultFactory.sol"; import "./token/IERC20Upgradeable.sol"; import "./util/SafeERC20Upgradeable.s...
1,672
171
3
1. [H-02] The return value of the `_sendForReceiver` function is not set, causing the receiver to receive more fees (Unchecked return values)
In the NFTXSimpleFeeDistributor.sol contract, the `distribute` function is used to distribute the fee, and the distribute function judges whether the fee is sent successfully acc...
5
16_Liquidation.sol
// SPDX-License-Identifier: GPL-3.0-or-later pragma solidity ^0.8.0; import "@openzeppelin/contracts/access/Ownable.sol"; import "./lib/LibMath.sol"; import "./lib/LibLiquidation.sol"; import "./lib/LibBalances.sol"; import "./lib/LibPerpetuals.sol"; import "./Interfaces/ILiquidation.sol"; import "./Interfaces/ITrader....
4,346
474
1
1. [H-05] Insurance slippage reimbursement can be used to steal insurance fund (Front-runnig, ToD)
The Liquidation contract allows the liquidator to submit "bad" trade orders and the insurance reimburses them from the insurance fund, see `Liquidation.claimReceipt`. The function can be called with an orders array, which...
1
70_VaderPoolV2.sol
// SPDX-License-Identifier: MIT AND AGPL-3.0-or-later pragma solidity =0.8.9; import "@openzeppelin/contracts/access/Ownable.sol"; import "./BasePoolV2.sol"; import "../../external/libraries/FixedPoint.sol"; import "../../interfaces/shared/IERC20Extended.sol"; import "../../interfaces/dex-v2/pool/IVaderPoolV2.sol";...
3,319
520
2
1. [H-02] VaderPoolV2 owner can steal all user assets which are approved VaderPoolV2. (Owner action, Centralization risk)
The owner of VaderPoolV2 can call the `setTokenSupport` function which allows the caller to supply any address from which to take the assets to provide the initial liquidity, the owner can also spec...
6
3_IncentiveDistribution.sol
// SPDX-License-Identifier: BUSL-1.1 pragma solidity ^0.8.0; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "./RoleAware.sol"; import "./Fund.sol"; struct Claim { uint256 startingRewardRateFP; uint256 amount; uint256 intraDayGain; uint256 intraDayLoss; } /// @title Manage distributio...
2,215
321
2
1. [H-08] Rewards cannot be withdrawn (Fund locked)
The rewards for a recipient in IncentiveDistribution.sol are stored in the storage mapping indexed by recipient accruedReward[recipient] and the recipient is the actual margin trader account, see function `updateAccruedReward`.

2. [H-09] lastUpdatedDay not initialize...
3
16_TracerPerpetualSwaps.sol
// SPDX-License-Identifier: GPL-3.0-or-later pragma solidity ^0.8.0; import "./lib/SafetyWithdraw.sol"; import "./lib/LibMath.sol"; import {Balances} from "./lib/LibBalances.sol"; import {Types} from "./Interfaces/Types.sol"; import "./lib/LibPrices.sol"; import "./lib/LibPerpetuals.sol"; import "./Interfaces/IOracle....
5,870
599
1
1. [H-04] Logic error in fee subtraction. L272
In `LibBalances.applyTrade()`, we need to collect a fee from the trade. However, the current code subtracts a fee from the short position and adds it to the long. The correct implementation is to subtract a fee to both (see TracerPerpetualSwaps.sol L272). This issue causes...
5
26_RCFactory.sol
pragma solidity 0.8.4; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/proxy/Clones.sol"; import "hardhat/console.sol"; import "./interfaces/IRCFactory.sol"; import "./interfaces/IRCTreasury.sol"; import "./interfaces/IRCMarket.sol"; import "./interfaces/IRCNftHubL2.sol"; import "./...
null
null
1
1. [M-05] RCFactory.createMarket() does not enforce `_timestamps` and `_timestamps` being larger than `_timestamps`, even though proper functioning requires them to be so (Timestamp manipulation, Input Validation and Error Handling)
1
24_SwappableYieldSource.sol
// SPDX-License-Identifier: GPL-3.0 pragma solidity 0.7.6; import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol"; import "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol"; import "@openzeppelin/co...
3,524
330
1
1. [H-01] `onlyOwnerOrAssetManager` can swap Yield Source in SwappableYieldSource at any time, immediately rugging all funds from old yield source. (Owner actions)
The function `swapYieldSource` SwappableYieldSource.sol` L307
Can be called by the owner (deployer / initializer) or Asset Manager. The function will take a...
5
68_BasketFacet.sol
// SPDX-License-Identifier: MIT pragma experimental ABIEncoderV2; pragma solidity ^0.7.5; import "@openzeppelin/contracts/math/SafeMath.sol"; import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol"; import "../../interfaces/IBasketFacet.sol"; import "../ERC20/LibERC20Storage.sol"; import "../ERC20/LibERC20.sol"; im...
2,972
397
1
1. [H-01] Unused ERC20 tokens are not refunded, and can be stolen by attacker. L143-L168
Under certain circumstances, e.g. annualizedFee being minted to feeBeneficiary between the time user sent the transaction and the transaction being packed into the block and causing amounts of underlying tokens for each basketToken...
3
5_Vader.sol
// SPDX-License-Identifier: UNLICENSED pragma solidity 0.8.3; // Interfaces import "./interfaces/iERC20.sol"; import "./interfaces/iUTILS.sol"; import "./interfaces/iUSDV.sol"; import "./interfaces/iROUTER.sol"; contract Vader is iERC20 { // ERC-20 Parameters string public override name; string public overri...
1,960
245
3
1. [H-03] Missing DAO functionality to call changeDAO() function in Vader.sol. (Incorrect Functionality)
`changeDAO()` is authorized to be called only from the DAO (per modifier) but DAO contract has no corresponding functionality to call changeDAO() function. As a result, DAO address cannot be changed

2. [H-06] Inco...
7
16_GasOracle.sol
// SPDX-License-Identifier: GPL-3.0-or-later pragma solidity ^0.8.0; import "../Interfaces/IOracle.sol"; import "../Interfaces/IChainlinkOracle.sol"; import "../lib/LibMath.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "prb-math/contracts/PRBMathUD60x18.sol"; /** * @dev The following is a sample ...
603
68
0
1. [H-06] Wrong price scale for GasOracle (Price manipulation)
The GasOracle uses two chainlink oracles (GAS in ETH with some decimals, USD per ETH with some decimals) and multiplies their raw return values to get the gas price in USD.


1
23_NotionalV1ToNotionalV2.sol
// SPDX-License-Identifier: GPL-3.0-only pragma solidity >0.7.0; pragma experimental ABIEncoderV2; import "../../global/Types.sol"; import "interfaces/notional/NotionalProxy.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; interface WETH9 { function withdraw(uint256 wad) external; function tran...
1,658
204
0
1. [H-05] Access restrictions on NotionalV1ToNotionalV2.notionalCallback can be bypassed (Centralized control)
The NotionalV1ToNotionalV2.notionalCallback is supposed to only be called from the verified contract that calls this callback but the access restrictions can be circumvented by simply providing `sender = this`...
1
14_BadgerYieldSource.sol
// SPDX-License-Identifier: GPL-3.0 pragma solidity 0.6.12; import { IYieldSource } from "@pooltogether/yield-source-interface/contracts/IYieldSource.sol"; import "@openzeppelin/contracts/math/SafeMath.sol"; import "./IBadgerSett.sol"; import "./IBadger.sol"; import "hardhat/console.sol"; /// @title A pooltogether y...
830
82
2
1. [H-03] BadgerYieldSource `balanceOfToken` share calculation seems wrong
The `balanceOfToken` function should then return the redeemable balance in badger for the user's badgerSett balance. It computes it as the pro-rata share of the user balance (compared to the total-supply of badgerSett) on the badger in the vault...
3
22_Staker.sol
// SPDX-License-Identifier: BUSL-1.1 pragma solidity 0.8.3; import "@openzeppelin/contracts-upgradeable/token/ERC20/presets/ERC20PresetMinterPauserUpgradeable.sol"; import "./interfaces/IFloatToken.sol"; import "./interfaces/ILongShort.sol"; import "./interfaces/IStaker.sol"; import "./interfaces/ISyntheticToken.sol...
10,105
990
0
1. [H-02] 2 variables not indexed by marketIndex. L622
in function `pushUpdatedMarketPricesToUpdateFloatIssuanceCalculations()`

2. [H-03] Users could shift tokens on Staker with more than he has staked. (Lack of input validation)
The `shiftTokens` function of Staker checks whether the user has staked at least the numb...
3
8_ERC20FlashMintUpgradeable.sol
// SPDX-License-Identifier: MIT pragma solidity 0.6.8; import "../interface/IERC3156Upgradeable.sol"; import "./ERC20Upgradeable.sol"; import "../proxy/Initializable.sol"; /** * @dev Implementation of the ERC3156 Flash loans extension, as defined in * https://eips.ethereum.org/EIPS/eip-3156[ERC-3156]. * * Adds t...
833
82
1
1. [H-01] Missing overflow check in flashLoan (Overflow)
ERC20FlashMintUpgradeable.`flashLoan` does not check for an overflow when adding the fees to the flashloan amount.
`_burn(address(receiver), amount + fee);`
1
30_Controller.sol
// SPDX-License-Identifier: MIT pragma solidity 0.6.12; import "@openzeppelin/contracts/math/SafeMath.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol"; import "../interfaces/IController.sol"; import "../interfaces/IConverter.sol"; import "../int...
4,847
683
2
1. [H-01] Controller.setCap sets wrong vault balance
The Controller.setCap function sets a cap for a strategy and withdraws any excess amounts (_diff). The vault balance is decreased by the entire strategy balance instead of by this `_diff`: `_vaultDetails[_vault].balance = _vaultDetails[_vault].balance.sub(_balance);`...
7
47_WrappedIbbtcEth.sol
//SPDX-License-Identifier: Unlicense pragma solidity ^0.6.12; import "../deps/@openzeppelin/contracts-upgradeable/proxy/Initializable.sol"; import "../deps/@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol"; import "./ICore.sol"; /*Wrapped Interest-Bearing Bitcoin (Ethereum mainnet variant) */ cont...
1,336
162
2
1. [H-03] WrappedIbbtcEth contract will use stalled price for `mint/burn` if `updatePricePerShare` wasn't run properly. (Price manipulation)
WrappedIbbtcEth updates `pricePerShare` variable by externally run `updatePricePerShare` function. The variable is then used in mint/burn/transfer functions without any additional...
4
23_nTokenAction.sol
// SPDX-License-Identifier: GPL-3.0-only pragma solidity >0.7.0; pragma experimental ABIEncoderV2; import "../../internal/nTokenHandler.sol"; import "../../internal/markets/AssetRate.sol"; import "../../internal/balances/BalanceHandler.sol"; import "../../internal/balances/Incentives.sol"; import "../../math/SafeInt25...
2,311
292
1
1. [H-01] Self transfer can lead to unlimited mint. (Unchecked return values, reentrancy)
The implementation of the `_transfer` function in nTokenAction.sol is different from the usual erc20 token transfer function.
1
67_Vault.sol
// SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.10; import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import {SafeERC20} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import {Context} from "@openzeppelin/contracts/utils/Context.sol"; import {Counters} from "@openzeppe...
4,420
654
5
1. [H-01] forceUnsponsor() may open a window for attackers to manipulate the _totalShares and freeze users' funds at a certain deposit amount (Access control)
In function `forceUnsponsor()`

2. [H-02] Reentrancy, Withdrawers can get more value returned than expected with reentrant call (Reentrancy)
Function `_withdrawD...
9
83_StakingRewards.sol
// SPDX-License-Identifier: MIT pragma solidity ^0.8.11; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "@openzeppelin/contracts/security/Pausable.sol"; import "@openzeppel...
1,501
221
1
1. [H-04] ConvexStakingWrapper, StakingRewards Wrong implementation will send concur rewards to the wrong receiver L99
ConvexStakingWrapper, StakingRewards is using `masterChef.deposit()`, `masterChef.withdraw()`, and these two functions on masterChef will take _msgSender() as the user address, which is actually the a...
8
28_PostAuctionLauncher.sol
pragma solidity 0.6.12; //---------------------------------------------------------------------------------- // I n s t a n t // // .:mmm. .:mmm:. .ii. .:SSSSSSSSSSSSS. .oOOOOOOOOOOOo. // .mMM'':Mm. .:MM'':Mm:. .II: :SSs.......... .oOO'''''''''''OOo. // .:Mm' ':Mm. ...
3,728
463
1
1. [H-01] PostAuctionLauncher.sol#finalize() Adding liquidity to an existing pool may allows the attacker to steal most of the tokens.
PostAuctionLauncher.finalize() can be called by anyone, and it sends tokens directly to the pair pool to mint liquidity, even when the pair pool exists.
(Access control)
1
39_VaultTracker.sol
// SPDX-License-Identifier: UNLICENSED pragma solidity 0.8.4; import "./Abstracts.sol"; contract VaultTracker { struct Vault { uint256 notional; uint256 redeemable; uint256 exchangeRate; } mapping(address => Vault) public vaults; address public immutable admin; address public immutable cToken...
2,192
255
1
1. [H-03] transferNotionalFrom doesn't check `from != to`. (Lack of input validation, Unchecked addresses)
The function `transferNotionalFrom` of VaultTracker.sol uses temporary variables to store the balances. If the "from" and "to" address are the same then the balance of "from" is overwritten by the balance of "to"...
3
104_CoreCollection.sol
//SPDX-License-Identifier: Unlicense pragma solidity ^0.8.0; import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol"; import {ERC721} from "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import {ERC721Enumerable} from "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol"; import {IERC20}...
2,331
311
3
1. [H-04] CoreCollection can be reinitialized. (Initialization)
Reinitialization is possible for CoreCollection as `initialize` function sets `initialized` flag, but doesn't control for it, so the function can be rerun multiple times.

2. [H-07] Duplicate NFTs Can Be Minted if payableToken Has a Callback Attached to it...
8
12_Cauldron.sol
// SPDX-License-Identifier: BUSL-1.1 pragma solidity ^0.8.0; import "./interfaces/vault/IFYToken.sol"; import "./interfaces/vault/IOracle.sol"; import "./interfaces/vault/DataTypes.sol"; import "./utils/access/AccessControl.sol"; import "./math/WMul.sol"; import "./math/WDiv.sol"; import "./math/CastU128I128.sol"; impo...
4,632
480
2
1. [M-01] Potential griefing with DoS by front-running vault creation with same `vaultID`. (DoS, Front-running)
The `vaultID` for a new vault being built is required to be specified by the user building a vault via the build() function (instead of being assigned by the Cauldron/protocol). An attacker can observe a buil...
4
5_Vether.sol
// SPDX-License-Identifier: UNLICENSED pragma solidity 0.8.3; // Interfaces import "./interfaces/iVETHER.sol"; // Token Contract contract Vether is iVETHER { // Coin Defaults string public override name; string public override symbol; ...
862
96
1
1. [H-21] Anyone Can Avoid All Vether Transfer Fees By Adding Their Address to the Vether ExcludedAddresses List (Access control)
Vether.sol implements a fee on every token transfer, unless either the sender or the recipient exists on a list of excluded addresses (mapAddress_Excluded). However, the `addExcluded()` func...
1
5_DAO.sol
// SPDX-License-Identifier: UNLICENSED pragma solidity 0.8.3; // Interfaces import "./interfaces/iERC20.sol"; import "./interfaces/iUTILS.sol"; import "./interfaces/iVADER.sol"; import "./interfaces/iVAULT.sol"; import "./interfaces/iROUTER.sol"; //======================================VADER======================...
1,813
200
2
1. [H-04] Proposals can be cancelled (Access control)
Anyone can cancel any proposals by calling `DAO.cancelProposal(id, id)` with `oldProposalID == newProposalID`. This always passes the minority check as the proposal was approved.

2. [H-05] Flash loans can affect governance voting in DAO.sol (Flash loans)
Function `...
4
38_Identity.sol
// SPDX-License-Identifier: agpl-3.0 pragma solidity ^0.8.7; import "./libs/SignatureValidatorV2.sol"; contract Identity { mapping (address => bytes32) public privileges; // The next allowed nonce uint public nonce = 0; // Events event LogPrivilegeChanged(address indexed addr, bytes32 priv); event LogErr(addre...
1,895
171
0
1. [H-01: Prevent execution with invalid signatures. (Unchecked input in `constructor`)
Suppose one of the supplied addrs[i] to the constructor of Identity.sol happens to be 0 ( by acciden).
`require (addrs[i] !=0,"Zero not allowed");`

2. [H-04] QuickAccManager Smart Contract signature verification can be exploited (...
2
12_CompoundMultiOracle.sol
// SPDX-License-Identifier: BUSL-1.1 pragma solidity 0.8.1; import "../../utils/access/AccessControl.sol"; import "../../interfaces/vault/IOracle.sol"; import "../../constants/Constants.sol"; import "../../math/CastBytes32Bytes6.sol"; import "./CTokenInterface.sol"; contract CompoundMultiOracle is IOracle, AccessCon...
673
83
0
1. [M-04] User can redeem more tokens by artificially increasing the chi accrual. (Steal tokens)
Function `_peek()`. Line `else if (kind == "chi") rawPrice = CTokenInterface(source).exchangeRateStored();`
1
45_CreditLimitByMedian.sol
//SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.4; import "@openzeppelin/contracts/utils/math/Math.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "../interfaces/ICreditLimitModel.sol"; contract CreditLimitByMedian is Ownable, ICreditLimitModel { using Math for uint256; bool pub...
861
123
1
1. [H-02] Wrong implementation of CreditLimitByMedian.sol#getLockedAmount() makes it unable to unlock lockedAmount in CreditLimitByMedian model. (Locked amount)
Function `getLockedAmount() ` and `lockedAmount` variable

2. [M-01] Wrong implementation of CreditLimitByMedian.sol#getLockedAmount() will lock a much bigger...
3
100_SingleStrategyController.sol
pragma solidity =0.8.7; import "./interfaces/IStrategy.sol"; import "./interfaces/IStrategyController.sol"; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; contract SingleStrategyControl...
586
79
0
1. [H-01] Strategy Migration May Leave Tokens in the Old Strategy Impacting Share Calculations #L51-L72 (No checks on strategy migration Calculations)
In function `migrate()`, If a strategy does not have sufficient funds to `withdraw()` for the full amount then it is possible that tokens will be left in this yield cont...
2
100_Collateral.sol
pragma solidity =0.8.7; import "./interfaces/ICollateral.sol"; import "./interfaces/IStrategyController.sol"; import "./interfaces/IHook.sol"; import "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol"; import "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol"; import "@openzeppe...
2,219
276
0
[H-02] First `depositor()` can break minting of shares #L82-L91 (Rounding Errors and Potential Loss of Funds)
The attack vector and impact is the same as TOB-YEARN-003, where users may not receive shares in exchange for their deposits if the total asset amount has been manipulated through a large “donation”.

[H-03] `W...
3
122_Cally
pragma solidity 0.8.13; import "solmate/utils/SafeTransferLib.sol"; import "solmate/utils/ReentrancyGuard.sol"; import "openzeppelin/access/Ownable.sol"; import "./CallyNft.sol"; contract Cally is CallyNft, ReentrancyGuard, Ownable { using SafeTransferLib for ERC20; using SafeTransferLib for address payable; ...
2,481
219
2
1. [H-01] no-revert-on-transfer ERC20 tokens can be drained #L198-L200 (Unchecked Return Values, ERC20/ERC721 token handling)
Some ERC20 tokens don't throw but just return false when a transfer fails. This can be abused to trick the `createVault()` function to initialize the vault without providing any tokens.

2. [H-0...
8
109_AxelarGateway.sol
pragma solidity 0.8.9; import { IAxelarGateway } from './interfaces/IAxelarGateway.sol'; import { IERC20 } from './interfaces/IERC20.sol'; import { IERC20BurnFrom } from './interfaces/IERC20BurnFrom.sol'; import { BurnableMintableCappedERC20 } from './BurnableMintableCappedERC20.sol'; import { DepositHandler } from './...
3,720
477
1
1. [M-01] Low level call returns true if the address doesn't exist (Unchecked Return Values)
#L545-L548
The low-level functions `call` and `delegatecall` are used in some places in the code and it can be problematic. For example, in the `_callERC20Token` of the AxelarGateway contract there is a low level call in order ...
3
114_AaveV3YieldSource.sol
pragma solidity 0.8.10; import { IAToken } from "@aave/core-v3/contracts/interfaces/IAToken.sol"; import { IPool } from "@aave/core-v3/contracts/interfaces/IPool.sol"; import { IPoolAddressesProvider } from "@aave/core-v3/contracts/interfaces/IPoolAddressesProvider.sol"; import { IPoolAddressesProviderRegistry } from "...
1,926
177
2
1. [H-01] A malicious early user/attacker can manipulate the vault's `pricePerShare` to take an unfair share of future users' deposits (Lack of access control, Price manipulation)
#L352-L374
A malicious early user can `supplyTokenTo()` with 1 wei of `_underlyingAssetAddress` token as the first depositor of the AaveV3Yi...
6
115_PARMinerV2.sol
pragma experimental ABIEncoderV2; pragma solidity 0.6.12; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol"; import "@openzeppelin/contracts/math/SafeMath.sol"; import "./interfaces/IGenericMinerV2.sol"; import "../../dex/interfaces/IDexAddressProvider.s...
2,923
256
1
1. [H-01] User can call `liquidate()` and steal all collateral due to arbitrary router call (Lack of input validation)
A malicious user is able to steal all collateral of an unhealthy position in PARMinerV2.sol. The code for the `liquidate()` function is written so that the following steps are followed:
The exploit occ...
2
115_SuperVault.sol
pragma experimental ABIEncoderV2; pragma solidity 0.8.10; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/utils/math/SafeMath.sol"; import "@openzeppelin/contracts/access/AccessControl.sol"; import "@openzeppelin/contracts/proxy/utils/Initializable.sol"; import { IPool } from "@...
2,313
239
0
1. [M-03] SuperVault's leverageSwap and emptyVaultOperation can become stuck (Both functions stuck)
`leverageSwap` and `emptyVaultOperation` can be run repeatedly for the same tokens. If these tokens happen to be an ERC20 that do not allow for approval of positive amount when allowance already positive, both functions ...
2
94_NFTMarketCreators.sol
pragma solidity ^0.8.0; import "./OZ/ERC165Checker.sol"; import "@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol"; import "./Constants.sol"; import "../interfaces/IGetFees.sol"; import "../interfaces/IGetRoyalties.sol"; import "../interfaces/IOwnable.sol"; import "../interfaces/IRoyaltyInfo....
1,528
188
0
1. [H-02] Creators can steal sale revenue from owners' sales (Centralization Risks, Unchecked Length Mismatches)
`_recipients[i] == seller` in `_getCreatorPaymentInfo` function
Using the Royalty Registry an owner can decide to change the royalty information right before the sale is complete, affecting who gets what.

2...
2
94_FETH.sol
pragma solidity ^0.8.0; import "@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol"; import "@openzeppelin/contracts/utils/math/Math.sol"; import "./libraries/LockedBalance.sol"; error FETH_Cannot_Deposit_For_Lockup_With_Address_Zero(); error FETH_Escrow_Expired(); error FETH_Escrow_Not_Found(); error FET...
3,266
385
1
1. [M-03] Approve race condition in FETH (Front-running)
in `approve` function

2. [M-09] Missing receiver validation in `withdrawFrom()` (No check address, Lack of Input Validation)
The FETH.withdrawFrom function does not validate its to parameter.
2
97_LiquidityFarming.sol
pragma solidity 0.8.0; import "@openzeppelin/contracts-upgradeable/interfaces/IERC721ReceiverUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; import "@openzeppelin/contracts-upgradeable/acc...
3,011
276
3
1. [H-04] Deleting nft Info can cause users' `nft.unpaidRewards` to be permanently erased
When `withdraw()` is called, `_sendRewardsForNft(_nftId, _to)` will be called to send the rewards.
In `_sendRewardsForNft()`, when `address(this).balance` is insufficient at the moment, `nft.unpaidRewards = pending - balance` will...
6
97_ LiquidityPool.sol
pragma solidity 0.8.0; pragma abicoder v2; import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol"; import "@openzeppelin/contracts-upgrade...
3,554
347
1
1. [H-01] Can deposit native token for free and steal funds (Unchecked return values)
The `depositErc20` function allows setting tokenAddress = NATIVE and does not throw an error.
No matter the amount chosen, the `SafeERC20Upgradeable.safeTransferFrom(IERC20Upgradeable(tokenAddress), sender, address(this), amount);` ca...
5
76_Sherlock.sol
pragma solidity 0.8.10; import '@openzeppelin/contracts/token/ERC20/IERC20.sol'; import '@openzeppelin/contracts/token/ERC721/ERC721.sol'; import '@openzeppelin/contracts/access/Ownable.sol'; import '@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol'; import '@openzeppelin/contracts/security/Pausable.sol'; import...
3,508
327
1
1. [M-02] tokenBalanceOfAddress of `nftOwner` becomes permanently incorrect after `arbRestake()` (Potential inconsistency in `arbRestake` function)

2. [M-03] `updateYieldStrategy()` will freeze some funds with the old Strategy if `yieldStrategy` fails to withdraw all the funds because of liquidity issues (No checks on...
3
101_LenderPool.sol
pragma solidity 0.7.6; pragma abicoder v2; import '@openzeppelin/contracts-upgradeable/token/ERC1155/ERC1155Upgradeable.sol'; import '@openzeppelin/contracts-upgradeable/utils/ReentrancyGuardUpgradeable.sol'; import '@openzeppelin/contracts/math/SafeMath.sol'; import '@openzeppelin/contracts/token/ERC20/SafeERC20.sol';...
5,347
442
2
1. [H-01] LenderPool: Principal withdrawable is incorrectly calculated if start() is invoked with non-zero start fee
`_withdrawLiquidity` function
The `_principalWithdrawable` calculated will be more than expected if _start() is invoked with a non-zero start fee, because the borrow limit is reduced by the fee, resultin...
4
51_AirdropDistribution.sol
pragma solidity ^0.8.4; import '@openzeppelin/contracts/utils/math/SafeMath.sol'; import '@openzeppelin/contracts/security/ReentrancyGuard.sol'; import '@openzeppelin/contracts/security/Pausable.sol'; import '@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol'; import "./interfaces/IVesting.sol"; contract AirdropD...
8,515
554
1
1. [H-05] Claim airdrop repeatedly
Suppose someone claims the last part of his airdrop via `claimExact()` of AirdropDistribution.sol Then airdrop\[msg.sender].amount will be set to 0.

2. [M-01] Unchecked transfers 
Multiple calls to transferFrom and transfer are frequently done without checking the results. For certai...
3
55_MapleLoan.sol
pragma solidity ^0.8.7; import { IERC20 } from "../modules/erc20/src/interfaces/IERC20.sol"; import { IMapleProxyFactory } from "../modules/maple-proxy-factory/contracts/interfaces/IMapleProxyFactory.sol"; import { ERC20Helper } from "../modules/erc20-helper/src/ERC20Helper.sol"; import { IMapleLoan } from ...
2,616
212
2
1. [H-01] makePayment() Lack of access control allows malicious lender to retrieve a large portion of the funds earlier, making the borrower suffer fund loss (Lack of access control)

2. [M-01] Anyone can call `closeLoan()` to close the loan (Access control)
2
57_Zap.sol
pragma solidity 0.6.11; import {TransparentUpgradeableProxy} from "@openzeppelin/contracts/proxy/TransparentUpgradeableProxy.sol"; import {ProxyAdmin} from "@openzeppelin/contracts/proxy/ProxyAdmin.sol"; import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import {SafeERC20, SafeMath} from "@openzeppe...
2,784
226
0
1. [M-01] Improper implementation of slippage check (Lack of Slippage Protection)
Function `redeem()`

2. [M-03] Zap contract's redeem() function doesn't check which token the user wants to receive
(Lack of input validation)
2
59_UniswapHandler.sol
pragma solidity >=0.6.6; import "@openzeppelin/contracts/math/SafeMath.sol"; import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol"; import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; import "@openzeppelin/upgrades/contracts/Initializable.sol"; import '@uniswap/v2-periphery/contracts/interfaces/IUniswapV2Route...
2,078
241
1
1. [M-09] UniswapHandler.maltMarketPrice() returns wrong decimals (Uncheck return values)
The UniswapHandler.maltMarketPrice function returns a tuple of the price and the decimals of the price. However, the returned decimals do not match the computed price for the else if (rewardDecimals < maltDecimals) branch

2. [M-2...
2
61_SavingsAccountUtil.sol
pragma solidity 0.7.6; import '../interfaces/ISavingsAccount.sol'; import '@openzeppelin/contracts/token/ERC20/SafeERC20.sol'; import '@openzeppelin/contracts/utils/ReentrancyGuard.sol'; library SavingsAccountUtil { using SafeERC20 for IERC20; function depositFromSavingsAccount( ISavingsAccount _savings...
null
null
1
1. [H-02] Wrong returns of `SavingsAccountUtil.depositFromSavingsAccount()` can cause fund loss (Unchecked Return Values)
The function SavingsAccountUtil.depositFromSavingsAccount() is expected to return the number of equivalent shares for given _asset. However, since `savingsAccountTransfer()` does not return the resu...
2
61_SavingsAccount.sol
pragma solidity 0.7.6; import '@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol'; import '@openzeppelin/contracts/utils/ReentrancyGuard.sol'; import '@openzeppelin/contracts/token/ERC20/SafeERC20.sol'; import '@openzeppelin/contracts/math/SafeMath.sol'; import '../interfaces/ISavingsAccount.sol'; impor...
2,996
285
0
1. [H-07] SavingsAccount `withdrawAll()` and `switchStrategy()` can freeze user funds by ignoring possible strategy liquidity issues
Full withdrawal and moving funds between strategies can lead to wrong accounting if the corresponding market has tight liquidity, which can be the case at least for AaveYield. That is, as...
2