Hunt prep
Before you test Derby
What 56 disclosed reports say about Derby: 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 | 47 | 0 | – | – | $0 |
| Access control lesson | 3 | 0 | – | – | $0 |
| DoS lesson | 2 | 0 | – | – | $0 |
| Smart contracts lesson | 2 | 0 | – | – | $0 |
| Race condition 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.
-
Rewards per locked token are calculated incorrectly
Rewards should be calculated inside the MainVault.sendRewardsToGame function, which is called at the end of the rebalancing period.
Disclosed
-
Vault.claim should be called before `pushTotalUnderlyingToController`
The vault should call its claim function inside pushTotalUnderlyingToController so reward tokens are collected and converted before the total is reported.
Disclosed
-
Vault.blacklistProtocol can revert in emergency
The blacklistProtocol function should accept a parameter to optionally skip the withdrawal, allowing blacklisting even when withdrawal is unsafe.
Disclosed
-
Rebalancing breaks and can corrupt the accounting if amountToProtocol or amountToChain turn negative
The fix should validate that amounts are positive before conversion, ideally at user entry or processing stage.
Disclosed
-
withdrawal request override
The withdrawal request function should require that the rebalancing period is not zero, or otherwise force users to withdraw directly.
Disclosed
-
Deposited funds are locked in inactive vaults
The withdrawalRequest function should be allowed in inactive vaults, and during rebalancing, inactive vaults with pending withdrawal requests should receive enough funds to process them.
Disclosed
-
`XProvider` forces increased relayer fees when transferring tokens cross-chain
The issue was fixed by passing the calldata of the second call to the token transfer function, so only one cross-chain message is sent.
Disclosed
-
Rebalancing can be indefinitely blocked due to ever-increasing `totalWithdrawalRequests`, causing locking of funds in vaults
The recommendation is to set vaults[_vaultNumber].totalWithdrawalRequests to 0 inside XChainController.resetVaultUnderlying so it tracks only the current period; a fix pull request is linked in the discussion.
Disclosed
-
User should not receive rewards for the rebalance period, when protocol was blacklisted, because of unpredicted behaviour of protocol price
The reward per locked token should be set to zero for blacklisted protocols inside the storePriceAndRewards function.
Disclosed
-
There is no price conversion between vault token and provider underlying token amounts in withdrawFromProtocol
The withdrawal amount should be converted from the vault currency to the provider's underlying token using current exchange rates before calling calcShares.
Disclosed
-
exchangeRate is not up to date in case if vault that is off is changed to on
When a vault is set to the on state, the current exchange rate should also be sent to it.
Disclosed
-
IdleProvider's balanceUnderlying and calcShares outputs are misscaled by up to 10^12
The code should be fixed by dividing by 1e18 instead of 10^underlyingDecimals in both functions.
Disclosed
-
Deposit allows for stealing underlying tokens from TruefiProvider, IdleProvider, YearnProvider, BetaProvider, CompoundProvider and AaveProvider balances
The deposit functions should maintain a whitelist mapping of allowed underlying token to yield-bearing token pairs, and optionally check that the contract's balance of the token sent to the user does not decrease.
Disclosed
-
Vault's savedTotalUnderlying tracks withdrawn funds incorrectly
The fix is to have withdrawFromProtocol() return the actual amount received and update savedTotalUnderlying with that amount after the withdrawal, and to only update when a withdrawal actually occurs.
Disclosed
-
Incorrect chainId comparison in xProvider
The condition should compare the provider's home chain with the controller or game chain instead of the parameter chain ID.
Disclosed