Hunt prep
Before you test Yield Witch v2 contest
What 27 disclosed reports say about Yield Witch 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 | 16 | 0 | – | – | $0 |
| DoS lesson | 3 | 0 | – | – | $0 |
| Smart contracts lesson | 3 | 0 | – | – | $0 |
| Access control lesson | 2 | 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.
-
Incorrect amount of Collateral moves for Auction
The calculation should be revised so that if the proportional debt is below the minimum, the debt is increased to the minimum and the collateral is set to the minimum of the proportional collateral and the increased debt, rather than using the full balances.
Disclosed
-
Someone can create non-liquidatable auction if the collateral asset fails on transferring to address(0)
The auction function should require that the auctioneer address is not address(0).
Disclosed
-
Oracle data feed is insufficiently validated
The contract should be fixed by adding checks for stale price and round completeness using the round ID and timestamp from the price feed.
Disclosed
-
Rewards distribution can be disrupted by a early user
The project resolved the issue; the suggested approach was to seed an initial supply that is never burned, use a wider integer for the integral, and cast up to 256 bits for calculations before storing back.
Disclosed
-
Malicious Users Can Transfer Vault Collateral To Other Accounts To Extract Additional Yield From The Protocol
The issue should be fixed by ensuring that any vault operation (transfer, collateral movement, add/remove) triggers a checkpoint for both the previous and new owner; the team plans to deploy a separate Ladle for convex tokens and possibly remove stir and give.
Disclosed
-
CompositeMultiOracle returns wrong decimals for prices?
The code was fixed by requiring underlying oracles to have 18 decimals and later refactored to handle decimals properly.
Disclosed
-
Rewards accumulated can stay constant and often not increment
The simplest fix suggested is to not update the lastUpdated field if the accumulated amount does not change, though this should be carefully reviewed for side effects.
Disclosed
-
No ERC20 safe* versions called
The fix was to use OpenZeppelin's SafeERC20 safeTransfer and safeTransferFrom functions, which check the return value and handle non-standard tokens.
Disclosed
-
Rewards squatting - setting rewards in different ERC20 tokens opens various economic attacks.
The rewards token should not be changeable; instead, use a mapping with reward cycles so users can claim from old cycles for a period.
Disclosed
-
Exchange rates from Compound are assumed with 18 decimals
The issue was fixed by following the documentation and getting the decimals of the underlying tokens to set the correct decimal of a Source.
Disclosed
-
ERC20Rewards breaks when setting a different token
The project patched the issue by disallowing changing the reward token.
Disclosed
-
Use safeTransfer instead of transfer
The fix was to use OpenZeppelin's SafeERC20 library and call safeTransfer or safeTransferFrom instead of transfer.
Disclosed
-
ERC20Rewards returns wrong rewards if no tokens initially exist
The rewardsPerToken_.lastUpdated field should always be updated in _updateRewardsPerToken to the current time (or end) even if _totalSupply == 0, and the function should not return early.
Disclosed
-
Violation of implicit constraints in batched operations may break protocol assumptions
The issue should be fixed by enforcing batch operation constraints explicitly in the code, for example with tracking counters or booleans, along with documentation and onboarding validation.
Disclosed
-
Uniswap Oracle uses wrong prices
The fix should involve using a real Uniswap v3 pool and computing the time-weighted average price using the recommended library or equation.
Disclosed