Hunt prep
Before you test Timeswap contest
What 31 disclosed reports say about Timeswap 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 | 16 | 0 | – | – | $0 |
| DoS lesson | 5 | 0 | – | – | $0 |
| Smart contracts lesson | 4 | 0 | – | – | $0 |
| RCE lesson | 1 | 0 | – | – | $0 |
| XSS 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.
-
Burning a ERC1155Enumerable token doesn’t remove it from the enumeration
The amount should be decreased before checking if the supply is zero.
Disclosed
-
_ownedTokensIndex is SHARED by different owners, as a result, _removeTokenFromAllTokensEnumeration might remove the wrong tokenId.
The index mapping should be redefined to be per-owner, and the project confirmed it updated the implementation to resolve the issue.
Disclosed
-
Mint function does not update LiquidityPosition state of caller before minting LP tokens. This
The liquidity position state should be updated right before minting, by calling the update function with the current global fee growth values.
Disclosed
-
TimeswapV2LiquidityToken should not use totalSupply()+1 as tokenId
The issue was fixed by using a separate counter that only increases for new token IDs.
Disclosed
-
Rebalance logic is wrong and this distorts the pool’s important states
The code was fixed by changing the parameter from `pool.long0Balance` to `pool.long1Balance` in the fee removal call.
Disclosed
-
The collect() function will always TRANSFER ZERO fees, losing _feesPositions without receiving fees!
The transferFees call should be moved after the fee amounts are calculated.
Disclosed
-
sqrtDiscriminant can be calculated wrong
The team should not use the `true` flag for the `Math.sqrt` function.
Disclosed
-
Fee on transfer tokens will not behave as expected
The team acknowledged the issue but stated it is not supported by design, so no fix was implemented.
Disclosed
-
NPM Dependency confusion. Unclaimed NPM Package and Scope/Org
The project registered the npm scope, which prevents others from claiming it.
Disclosed
-
The pay() function can still be DOSed
The DOS protection should be moved into TimeswapPair.pay() rather than relying on a separate Convenience contract.
Disclosed
-
Underflown variable in borrowGivenDebtETHCollateral function
The code was fixed by initialising excess with maxCollateral before the unchecked subtraction.
Disclosed
-
Convenience contract fails to function if asset or collateral is an ERC20 token with fees
The project should document the behaviour for fee-on-transfer tokens and users can create their own convenience contract to interact with Timeswap V1 Core.
Disclosed
-
Important state updates are made after the callback in the mint() function
The callback should be moved to the end of the mint() function after all state updates have taken place.
Disclosed
-
TimeswapPair.sol#borrow() Improper implementation allows attacker to increase pool.state.z to a large value
The borrow function should be restricted to onlyConvenience so that zIncrease is computed internally from xDecrease and the current state, rather than being a user-supplied value.
Disclosed
-
burn() doesn’t call ERC721 _burn()
The burn() function should be modified to include a call to _burn(id) to destroy the ERC721 token.
Disclosed