Hunt prep
Before you test Swaylend
What 25 disclosed reports say about Swaylend: 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 | 15 | 0 | – | – | $0 |
| Smart contracts lesson | 4 | 0 | – | – | $0 |
| DoS 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.
-
Market.update_collateral_asset should reuse old configuration's asset_id
The update function should reuse the old configuration's asset_id, as update_market_configuration does with base_token.
Disclosed
-
Absorb_internal might be DOSed
The function should return or skip an account that is not liquidatable instead of reverting the whole transaction.
Disclosed
-
Permanent freezing of tokens when user sends extra tokens as update fee
The contract should either refund any excess payment to the caller or require the sent amount to exactly equal the update fee.
Disclosed
-
Recipient with a NULL address will lead to permanent loss of minted coins
The mint function should be fixed by adding a check at the start that rejects a null recipient identity.
Disclosed
-
Truncation in the present_value_borrow() can lead to loss of accrued borrow interests.
The present value should be rounded up to account for the lost interest.
Disclosed
-
If the collateral token''s decimal is <= the base token decimal in a market, collateral_value_to_sell() will always revert & available_to_borrow() will return a wrong amount tha
The code should use an if-else block to check which decimal is greater and compute the scale correctly, avoiding division when the scale is zero.
Disclosed
-
Permissonless constructor always for front-running owner initialization.
The owner should be set as a configurable value at deployment rather than through a permissionless constructor.
Disclosed
-
Market.present_value_borrow should be roundUp
The calculation should round up instead of down.
Disclosed
-
Market.set_pyth_contract_id should emit an event
The setter should emit an event recording the new Pyth contract identifier whenever it is changed.
Disclosed
-
Constanct value is used to check price.confidence
The check should use a per-feed confidence threshold rather than one shared constant.
Disclosed
-
Loss of yield to the protocol due to incorrect interest rate applied
The present value should be calculated as in is_borrow_collateralized(), by passing the principal without negation and adjusting the borrow amount calculation accordingly.
Disclosed
-
Users can withdraw collateral even when the admin pauses the contract.
The withdraw_collateral function should apply the same pause checks used in supply_collateral.
Disclosed
-
Adding too many collaterals will halt the protocol operation
The contract should allow removing collateral configurations or track per-user collateral lists to avoid looping over all configurations.
Disclosed