The IndexPool contract's price calculation uses a pow function that overflows when the weight ratio between tokens is large (e.g., 10). This causes all swap transactions to revert, making the pool unusable for trading even though liquidity can still be provided.
The flashSwap function in the IndexPool contract calls the callback before transferring tokens, so the sender does not receive tokens during the callback. This breaks the expected flash swap behaviour and could require redeploying all index pools if found after mainnet launch.
The _pow function in IndexPool.sol has a missing bracket for the for loop, causing the exponentiation by squaring to be incorrect. As a result, when a pool is initialised with a weight ratio of 1:2, no user can buy token A with token B because the swap always returns zero.
The HybridPool contract stored reserves as Bento 'amounts' but then converted them again when reading, causing incorrect reserve values. This led to wrong swap outputs, allowing attackers to receive more tokens than they should and causing losses for liquidity providers.
The difference function in MathUtils.sol incorrectly computes the absolute difference when a > b, causing within1 to return wrong results. An attacker could manipulate pool calculations to make within1 fail, potentially affecting the HybridPool.
The IndexPool contract's _computeSingleOutGivenPoolIn function passes an exponent in WAD (18-decimal fixed point) to the _pow function, which expects a plain integer exponent. This causes an integer overflow that prevents the function from being called, blocking the associated pool operation.
The IndexPool.mint function casts a user-controlled ratio to uint120 without checking for overflow, so an attacker can choose a ratio that truncates to zero and mint LP tokens for free. The attacker can then burn these inflated LP tokens to withdraw the entire pool reserves.
The IndexPool contract does not collect fees for the barFeeTo address, despite having an updateBarFee method. This could cause liquidity providers to favour IndexPool over ConstantProductPool, harming the ecosystem.
The TridentRouter does not calculate optimal liquidity parameters for index pools, so users may transfer extra tokens or have transactions fail if the pool price changes before confirmation. An attacker could exploit this by front-running to cause failures or force users to deposit at unfavourable rates.
The withdrawFromWETH function incorrectly checks that the return data length is at least 32 bytes, but WETH.withdraw returns nothing, so the check always fails and the function reverts. This breaks unwrapWETH, causing all transactions that try to unwrap WETH through the router to revert.
The flashSwap function in HybridPool sends the entire trade fee to the barFeeTo address instead of only the barFee portion. This means liquidity providers receive no fees when flashSwap is used, removing the incentive to provide liquidity.
The HybridPool contract's approximation functions may stop before converging due to a loop limit, and the inaccurate result is still used as correct. This could lead to incorrect liquidity calculations, potentially causing financial loss.
The router's deposit functions accept ETH but do not use the actual amount deposited, so users must pre-calculate and send extra ETH. If the exchange rate changes before execution, leftover ETH remains in the router and anyone can back-run to claim it via refundETH.
When an IndexPool has no reserves yet, the mint function forces the first liquidity provider to deposit the same raw amount of every token, ignoring each token's weight, decimals and price. An attacker could then swap cheap tokens for the valuable ones and take most of the first provider's value.
The IndexPool contract mints initial LP tokens to the zero address, causing the first mint to require an amount of each token that is independent of its decimals and value. This makes initial liquidity provision economically unjustifiable for pools with tokens of different values or decimals, and allows a second LP to pay less for the same LP tokens.
The burnSingle function in ConstantProductPool computes swap amounts using reserves instead of balances, which can lead to incorrect swap amounts and potential loss of funds from the pool.
The mint function in IndexPool allowed an attacker to overflow the balance check by supplying a very large amountIn, letting them mint a huge number of LP tokens without providing liquidity. The attacker could then burn those tokens to steal other liquidity providers' funds.
The `_computeSingleOutGivenPoolIn` function in `IndexPool` used raw multiplication instead of the `_mul` helper for fixed-point arithmetic, causing `zaz` to be 10^18 times too large and leading to an integer underflow when computing `amountOut`. This prevented anyone from successfully calling the function.
The IndexPool contract mints a fixed initial supply of LP tokens to the zero address in its constructor, and the amount of value effectively burned depends on the size of the first liquidity provider's deposit. A first depositor choosing a non-optimal initial amount causes a large number of tokens to be burned, reducing the profit available to all liquidity providers in the pool.
The mint fee for unbalanced liquidity is also given to the minter, effectively acting as a rebate. This makes adding and removing liquidity slightly more profitable than swapping directly.
The complexPath function recalculates the token balance after each swap iteration, so percentages are applied to the remaining balance rather than the original total. This can cause users to lose funds if they specify percentages that sum to 100%.
The TridentRouter contract's deposit function only uses the contract's ETH balance if it is at least the required underlying amount; otherwise it ignores the ETH and pulls WETH from the user. If the required amount increases between transaction submission and inclusion, the user's ETH is ignored and WETH is also taken, causing loss of the ETH deposit.
The HybridPool contract uses the same non-optimal mint fee calculation as the constant product pool, but because the two pools use different AMM curves, the ideal balance differs. This could lead to incorrect fees being charged when liquidity providers deposit imbalanced amounts.
The HybridPool contract used the BentoBox toAmount function to track reserves, which can change when anyone calls harvest to realise strategy profits. An attacker could call harvest during a flash swap callback to reduce the amount of tokens they owed, thereby stealing unrealised yield from the pool.
Several mathematical functions in the IndexPool contract were incorrectly converted from Balancer V1, leading to wrong calculations. This could cause incorrect pool token pricing and potentially allow attackers to exploit the pool for profit.
The constant product pool's output calculation rounds down, causing significant precision loss for tokens with zero decimals. An attacker swapping small amounts of such tokens could lose a large percentage of their trade to rounding.
ST
Sushi Trident contest phase 1
Medium
Instant results are busy. Press Enter to search every report.
No direct matches. Search every report above, or try a bug class like IDOR or SSRF.