Hunt prep
Before you test Sushi Trident contest phase 1
What 26 disclosed reports say about Sushi Trident contest phase 1: 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
Not written yet for this program. The numbers below are up to date.
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 | 16 | 0 | – | – | $0 |
| Smart contracts lesson | 7 | 0 | – | – | $0 |
| DoS 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.
-
IndexPool pow overflows when weightRatio > 10.
The weight ratio should be divided by the base raised to the exponent to keep scales consistent, and all scales and decimals should be checked.
Disclosed
-
Flash swap call back prior to transferring tokens in indexPool
The outbound token transfer should be moved before the callback invocation.
Disclosed
-
Index Pool always swap to Zero
The missing brackets around the for loop body should be added so that the output is updated inside the loop.
Disclosed
-
HybridPool ’s reserve is converted to “amount” twice
The reserves should be stored and used consistently in the correct amounts, avoiding double conversion.
Disclosed
-
absolute difference is not calculated properly when a > b in MathUtils
The fix is to add an else branch that computes b - a when a is not greater than b.
Disclosed
-
Incorrect usage of _pow in _computeSingleOutGivenPoolIn of IndexPool
The _pow call should be replaced with the _compute function, which supports WAD-scaled exponents.
Disclosed
-
Unsafe cast in IndexPool mint leads to attack
Use a SafeCast library for all type casts, even with Solidity 0.8.x, to prevent silent truncation.
Disclosed
-
withdrawFromWETH always reverts
Remove the data.length >= 32 check and only require success to be true.
Disclosed
-
Approximations may finish with inaccurate values
The transactions should be reverted if convergence does not occur, as suggested by the recommended mitigation steps.
Disclosed
-
Users are susceptible to back-running when depositing ETH to TridenRouter
The remaining ETH should be directly pushed to the sender to prevent any ETH left in the router.
Disclosed
-
IndexPool.mint The first liquidity provider is forced to supply assets in the same amount, which may cause a significant amount of fund loss
The first liquidity provider should be allowed to set a custom amount for each token, or the pool should always take the minimum balance of each token.
Disclosed
-
IndexPool initial LP supply computation is wrong
The constructor should not mint initial LP supply to the zero address; instead, the first liquidity provider should provide arbitrary token amounts and receive the initial pool supply, with a small fraction sent to the zero address after minting to prevent the Uniswap attack.
Disclosed
-
ConstantProductPool.burnSingle swap amount computations should use balance
Call _getAmountOut with the balances instead of the reserves.
Disclosed
-
Incorrect multiplication in _computeSingleOutGivenPoolIn of IndexPool
The multiplication should be changed to use the `_mul` function to correctly handle fixed-point arithmetic.
Disclosed
-
IndexPool’s INIT_POOL_SUPPLY is not fair.
INIT_POOL_SUPPLY should be handled the way Uniswap v2 does it, and an optimised parameter should be chosen for the user.
Disclosed