Hunt prep
Before you test SecondSwap
What 23 disclosed reports say about SecondSwap: 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 | 17 | 0 | – | – | $0 |
| DoS lesson | 2 | 0 | – | – | $0 |
| Smart contracts lesson | 2 | 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.
-
SecondSwap_Marketplace vesting listing order affects how much the vesting buyers can claim at a given step
The report recommends adding a virtual total amount to the manager contract for each vesting plan deployed, and the project confirmed the finding.
Disclosed
-
transferVesting creates an incorrect vesting for new users when they purchase a vesting, because stepsClaimed is the same for all sales, allowing an attacker to prematurely unlock too many tokens
The project should store stepsClaimed per listing in a mapping so the correct value is transferred to each buyer.
Disclosed
-
Incorrect listing type validation bypasses enforcement of minimum purchase amount
The comparison should be changed to equality against the SINGLE listing type so the range check applies to partial listings.
Disclosed
-
MarketPlace Change In Vesting Manager, Leads To Loss Of Previous MarketPlace Listing
The report recommends allowing users to remove their vested listings and transfer them back after a marketplace change.
Disclosed
-
Tokens that have already been vested can be transferred from a user.
The transfer function should account for tokens that have already vested but remain unclaimed when checking the available balance.
Disclosed
-
maxSellPercent will be broken when a vesting is delisted after a seller has claimed additional steps
The fix should track the steps claimed at listing time and adjust the refunded amount so that tokens corresponding to steps claimed since listing become immediately claimable, with the remainder deducted from sold.
Disclosed
-
maxSellPercent can be buypassed by selling previously bought vestings at a later time
The Allocation struct should track steps bought and adjust the bought amount based on claimed steps, and bought allocations should be sold first.
Disclosed
-
Underflow in claimable DOSing claim Function
The claimable function should be fixed to handle the case where stepsClaimed exceeds currentStep, for example by returning zero claimable steps instead of underflowing.
Disclosed
-
Unauthorized increase of maxSellPercent
A new variable should track whether the vesting has been initialised, and setSellable should only update maxSellPercent when it has not been initialised.
Disclosed
-
buyFee And sellFee Should Be Known Before Purchase
The listing should record the buyer and seller fees at creation time and the purchase should use those stored values.
Disclosed
-
Outdated penalty fee gets charged if the penalty fee has changed since listing
The fee should be cached in the listing struct when the listing is created and used at cancellation.
Disclosed
-
Users can prevent being reallocated by listing to marketplace
Consider adding a trusted role to unlist from the marketplace so that reallocation can be handled completely.
Disclosed
-
Unlisting a vesting after seller has claimed additional steps locks tokens which should have been claimable already
The unlist logic should track the steps claimed at listing time and allocate a proportional part of the refunded tokens to an immediately claimable amount, adjusting the release rate only for the rest.
Disclosed
-
Missing option to remove tokens from the isTokenSupport mapping can result in huge financial loss for users and the protocol
Add an admin function to remove currencies from the whitelist and check that a listing's currency is still whitelisted before executing a sale.
Disclosed
-
Incorrect referral fee calculations
The referral fee should be calculated as the buyer fee total multiplied by the referral fee percentage divided by the base, which was the recommended mitigation.
Disclosed