Hunt prep
Before you test Trader Joe v2 contest
What 12 disclosed reports say about Trader Joe v2 contest: 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 | 8 | 0 | – | – | $0 |
| Smart contracts lesson | 3 | 0 | – | – | $0 |
| Access control 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.
-
Transfering funds to yourself increases your balance
The transfer function should update storage directly with subtraction and addition, and should also reject transfers where sender and recipient are the same address.
Disclosed
-
Wrong implementation of function LBPair.setFeeParameter can break the funcionality of LBPair and make user’s tokens locked
The function should be fixed by shifting the variable parameters left by 144 bits before combining them with the new fee parameters.
Disclosed
-
Attacker can keep fees max at no cost
The issue was acknowledged and the team now resets the indexRef in the forceDecay function.
Disclosed
-
Flashloan fee collection mechanism can be easily manipulated
The report suggests a global per-pair fee structure or distributing fees across nearby bins, but the sponsor chose to keep the current behaviour.
Disclosed
-
Calling swapAVAXForExactTokens function while sending excess amount cannot refund such excess amount
The refund calculation should be corrected to subtract the required amount from the sent amount.
Disclosed
-
Very critical Owner privileges can cause complete destruction of the project in a possible privateKey exploit
The owner should be a multisignature wallet and a timelock should be added for owner privileges, as the project later stated the owner will be their multisig.
Disclosed
-
beforeTokenTransfer called with wrong parameters in LBToken._burn
The hook should be called with the correct arguments: _beforeTokenTransfer(_account, address(0), _id, _amount).
Disclosed
-
Attacker can steal entire reserves by abusing fee calculation
The code should not exempt any address from _cacheFees(), including address(0), so that fee debts are always updated.
Disclosed
-
Wrong calculation in function LBRouter._getAmountsIn make user lose a lot of tokens when swap through JoePair (most of them will gifted to JoePair freely)
The formula should be corrected by adding parentheses around the subtraction before multiplying by 997, as shown in the recommended mitigation.
Disclosed
-
Incorrect output amount calculation for Trader Joe V1 pools
The fix is to use the JoeLibrary.getAmountOut function in _swapSupportingFeeOnTransferTokens when computing output amounts for V1 pools.
Disclosed