Hunt prep
Before you test Notional Update #4
What 101 disclosed reports say about Notional Update #4: what was found and paid, what was fixed, and where it may be worth looking next.
- with a public bounty
- 0
- median public bounty
- –
- highest public bounty
- –
Gaps worth testing 15
Ideas drawn from this program's disclosed reports and our class lessons. None of them is a known bug: each is a place to look, and the reports linked under it are why. Check the current scope before testing anything.
-
1
Slippage bounds on proportional and single-sided redemption paths
Business logic Read the lesson
Several reports show slippage controls that are ineffective or missing during redemption and settlement. Test the vault redeem and settlement paths with imbalanced pools and compare the enforced bound against the real output, since the same weakness may persist on paths not covered by the earlier fixes.
Backed byIneffective slippage mechanism when redeeming proportionally (2023) Slippage/Minimum amount does not work during single-side redempt... (2023) Existing Slippage Control Can Be Bypassed During Vault Settlemen... (2022)+1 more report
- Inadequate slippage control (2023)
From the lessons: Check whether every swap, deposit or mint path enforces a user-supplie...; Compare the protocol's computed slippage bound against the true expect...; Withdraw or redeem from a vault and check whether a slippage bound is...; Set the slippage parameter to a value that passes the check but still...
-
2
Rounding direction in share and debt conversions
Business logic Read the lesson
Rounding differences recur across invariant, storage conversion and oracle price calculations. Test every conversion between stored balances, strategy tokens and debt shares for the direction of rounding, especially where negative or signed values are involved, because a wrong direction can favour the user.
Backed byRounding differences when computing the invariant (2023) Rounding differences when computing the invariant (2023) convertFromStorage() fails to use rounding-up when converting a... (2023)+1 more report
From the lessons: Mint or redeem shares and check whether the function enforces a minimu...; Vault deposit, withdraw and redeem functions across yield and staking...
-
3
Decimal scaling for tokens with differing decimals
Business logic Read the lesson
Reports repeatedly show scaling errors when pool tokens have different decimals or wrapped tokens have their own scaling factor. Test vault deployment and accounting with mixed-decimal pools and wrapped tokens to see whether amounts are scaled once or twice and whether the invariant stays consistent.
Backed byTwo token vault will be broken if it comprises tokens with diffe... (2023) Scaling factor of the wrapped token is incorrect (2023) Token amounts are scaled up twice causing the amounts to be infl... (2023)From the lessons: Test the protocol with several ERC20 variants (different decimals, no...; Price feeds, pool share weights and Curve or Balancer pool oracles use...
-
4
Native ETH representation across deposit and exit paths
Business logic Read the lesson
Native ETH is represented inconsistently and msgValue is not populated in some paths. Test deposit, reinvest and exit flows where ETH is the primary or secondary token, including the zero address versus the sentinel address, to check whether value is forwarded and returned correctly.
Backed byLogic Error due to different representation of Native ETH (0x0 &... (2023) `msgValue` will not be populated if ETH is the secondary token (2023) `depositFromNotional` function is payable, which means that it s... (2023)+1 more report
From the lessons: Functions that make external calls to tokens, native currency or NFTs...; Any contract that calls transfer or transferFrom directly on an arbitr...
-
5
Oracle staleness and sequencer checks on L2 deployments
Business logic Read the lesson
Oracle manipulation and stale price reports appear alongside a missing L2 sequencer check. Test price consumption in the trading module and vault oracles on sidechains for staleness handling, deprecated pool oracles and sequencer uptime, since these checks may be absent on newer deployments.
Backed byNo check for active L2 Sequencer (2023) Price oracle could get a stale price (2022) Deprecated Balancer Price Oracles could lead to locked funds in... (2022)+1 more report
From the lessons: Check whether the oracle can return a stale price or a deprecated pool...; Price feeds, pool share weights and Curve or Balancer pool oracles use...
-
6
Reward token equal to a pool token during reinvestment
Business logic Read the lesson
Reinvestment breaks or misbehaves when the reward token matches a pool token, and reward swaps lack slippage bounds. Test reinvest and reward claim paths with overlapping tokens and imbalanced pools to check whether swaps are skipped, reverted or sandwiched.
Backed byUnable to reinvest if the reward token equals one of the pool to... (2023) Risk of reward tokens being sold by malicious users under certai... (2023) Reinvest will return sub-optimal return if the pool is imbalance... (2023)+1 more report
From the lessons: Trigger a reward token swap with no slippage bound and check whether i...; Reward accumulation updates in staking and vault contracts.
-
7
Liquidation eligibility and partial liquidation edge cases
Business logic Read the lesson
Reports show vaults avoiding settlement and liquidation, and partial liquidations being impossible. Test liquidation and settlement flows for accounts with excess cash, secondary debt dust and minimum borrow thresholds to see whether positions can be made ineligible or liquidated past the outstanding debt.
Backed byPossible to create vault positions ineligible for liquidation (2023) Vaults can avoid liquidations by not letting their vault account... (2023) Partial liquidations are not possible (2023)From the lessons: Liquidation and force repay paths.; Liquidation, repayment and debt takeover flows where front-running can...; Front-run a liquidation with a minimal repayment of the outstanding de...
-
8
Front-running liquidations around unpause and settlement
Business logic Read the lesson
Liquidation front-running can block debt repayment, and settlement can be prevented by blacklisted accounts. Test the ordering of unpause, settlement and liquidation calls to see whether a third party can delay or block repayment, and whether permissionless settlement fails for restricted accounts.
Backed byLiquidation frontrunning can prevent debt repayment upon unpausi... (2023) Cannot permissionless settle the vault account if the user use a... (2023) Vault accounts with excess cash can avoid being settled (2023)+1 more report
From the lessons: Liquidation, repayment and debt takeover flows where front-running can...; Front-run a liquidation with a minimal repayment of the outstanding de...
-
9
External call return values and approvals to money markets
Business logic Read the lesson
Return data from external calls is not verified and approvals to Compound V2 are missing in places. Test deposit and redemption paths into external money markets for unchecked boolean returns and approval handling, including tokens that reject non-zero-to-non-zero approvals.
Backed byReturn data from the external call not verified during deposit a... (2023) Lack of ERC20 approval on depositing to external money markets C... (2023) stakingContext.auraBooster.deposit boolean return value not hand... (2022)From the lessons: Call every transfer and transferFrom path with a token that returns fa...; Use a token whose approve and transfer do not return a boolean and che...; Deposit a USDT-like token that rejects non-zero-to-non-zero approvals...
-
10
Fee-on-transfer and non-standard token accounting
Business logic Read the lesson
Fee-on-transfer tokens break withdrawal and accounting paths. Test deposits, withdrawals and reinvestment with fee-on-transfer and no-return-value tokens to check whether the contract credits the amount actually received and handles missing return values.
Backed byFee on transfer tokens will break the withdrawing process (2023) No Validation Check Against Decimal Of Secondary Token (2022) Users redeem strategy tokens but receives no assets in return (2023)From the lessons: Use a fee-on-transfer token as the asset or collateral and check wheth...; Use a token that returns false or no value from transfer and check whe...; Test the protocol with several ERC20 variants (different decimals, no...
-
11
First depositor share inflation on new vaults
Business logic Read the lesson
Vault share calculation can be broken by the first user, and total supply counters can drift out of sync. Test fresh vault deployments for share inflation and counter desynchronisation after internal outflows, since the earlier fixes may not cover every vault type.
Backed byVault Share/Strategy Token Calculation Can Be Broken By First Us... (2022) Vault's `totalStrategyTokenGlobal` will not be in sync (2023) `totalBPTSupply` will be excessively inflated (2023)+1 more report
From the lessons: Trigger an internal outflow and check whether deposited share counters...; Mint or redeem shares and check whether the function enforces a minimu...
-
12
Curve pool selection and registry assumptions
Business logic Read the lesson
Users are forced onto the first pool returned by the registry, and newer or MetaStable pools fail to deploy. Test vault deployment and pool selection for pools with unusual coin counts, native ETH and nested pools to see whether the registry assumptions still hold.
Backed byUsers are forced to use the first pool returned by the Curve Reg... (2023) Vault cannot be deployed properly for newer Curve pools (2023) Unable to deploy new leverage vault for certain MetaStable Pool (2023)From the lessons: Stableswap and AMM provide-liquidity, withdraw-liquidity and single-si...; Price feeds, pool share weights and Curve or Balancer pool oracles use...
-
13
Emergency exit proportionality and nested pool handling
Business logic Read the lesson
Emergency exit performs a single-sided exit and may not be enough for nested pools. Test emergency withdrawal on nested and imbalanced pools to check whether the exit is proportional and whether the resulting assets cover the debt.
Backed bySingle-sided instead of proportional exit is performed during em... (2023) Emergency withdraw might not be enough if the underlying pool is... (2023) Native ETH not received when removing liquidity from Curve V2 po... (2023)From the lessons: Strategy allocation and deallocation functions in vaults.; Stableswap and AMM provide-liquidity, withdraw-liquidity and single-si...
-
14
Rebalance robustness with multiple holdings and interest accrual
Business logic Read the lesson
Rebalance fails when holdings are added, on zero amounts and on treasury interest accrual. Test rebalance and treasury flows with several holdings and accrued interest to see whether the process reverts or leaves the vault in an inconsistent state.
Backed byRebalance stops working when more holdings are added (2023) Rebalance process reverts due to zero amount deposit and redempt... (2023) Treasury rebalance will fail due to interest accrual (2023)+1 more report
From the lessons: Strategy allocation and deallocation functions in vaults.; Yield distribution and reward treasury contracts.
-
15
Access control on deleverage and vault entry
Access control Read the lesson
Deleverage can be called while paused and can bypass account restrictions. Test deleverage and vault entry paths for missing pause checks and account validation, since the same authorisation gaps may remain on related functions.
What was found and what it paid
Public bounties only; many reports disclose without the amount.
| Class | Reports | Paid | Median | Highest | In all |
|---|---|---|---|---|---|
| Business logic lesson | 72 | 0 | – | – | $0 |
| Smart contracts lesson | 7 | 0 | – | – | $0 |
| DoS lesson | 6 | 0 | – | – | $0 |
| Access control lesson | 4 | 0 | – | – | $0 |
| Race condition lesson | 1 | 0 | – | – | $0 |
What was fixed
All reportsThe newest fixes, in our words. A fixed bug is not worth re-reporting, but a sibling feature, an older API version or a regression may be.
-
`depositFromNotional` function is payable, which means that it should accept Ether, but in reality will revert 100% when msg.value > 0
The executeTrade function in TradingModule.sol should be made payable, or the payable keyword should be removed from depositFromNotional if Ether is not intended to be used.
Disclosed
-
Fewer than expected LP tokens if the pool is imbalanced during vault restoration
The function should allow the caller to deposit in a non-proportional manner, for example by swapping tokens externally to achieve the optimal proportion, similar to the vault's reinvest function.
Disclosed
-
Single-sided instead of proportional exit is performed during emergency exit
The isSingleSided parameter should be set to false to perform a proportional exit.
Disclosed
-
Incorrect invariant used for Balancer's composable pools
The code should be changed to use the balances of all tokens (except the pool token) when computing the invariant, and additional tests should be added to ensure the spot price matches the market price.
Disclosed
-
ETH can be sold during reinvestment
The blocklist should also reject the actual ETH addresses used in trades, namely the zero address and WETH.
Disclosed
-
Unable to reinvest if the reward token equals one of the pool tokens
The report recommends tracking how many pool tokens were received during an emergency exit and separating those from reward tokens, so the vault can still sell the genuine reward portion.
Disclosed
-
Incorrect Spot Price
The report recommends consulting Balancer's team and using the current Composable Pool's StableMath method, such as `_calcOutGivenIn` with fees excluded, to compute the spot price.
Disclosed
-
Rounding differences when computing the invariant
The StableMath library used by Notional and Balancer's Composable Pool should be aligned so that the invariant is computed identically.
Disclosed
-
Incorrect scaling of the spot price
The spot price should be scaled down by dividing by the scaling factor instead of multiplying, to return the native spot price.
Disclosed
-
Native ETH not received when removing liquidity from Curve V2 pools
The recommendation is to set the is_eth flag to true when calling remove_liquidity_one_coin and remove_liquidity if one of the pool tokens is ETH, and a pull request was referenced in the discussion.
Disclosed
-
Some curve pools can not be used as a single sided strategy
The LP token address should be provided as an input parameter instead of being fetched from the pool.
Disclosed
-
`BalancerWeightedAuraVault.sol` wrongly assumes that all of the weighted pools uses `totalSupply`
The contract should check whether the pool is a newer one that uses getActualSupply and call that instead of totalSupply; a pull request addressing this was linked.
Disclosed
-
No check for active L2 Sequencer
The protocol was fixed by adding a check for the sequencer status, as shown in the linked pull request.
Disclosed
-
Different spot prices used during the comparison
The fix was included in a pull request, and the recommendation is to verify the spot price orientation and use the current Composable Pool's method such as _calcOutGivenIn (excluding fees) to compute the spot price.
Disclosed
-
Leverage Vault on sidechains that support Curve V2 pools is broken
The IS_CURVE_V2 variable should be initialised on Arbitrum and Optimism according to the Curve pool's version, for example by checking for a gamma() function.
Disclosed