Hunt prep
Before you test Y2k Finance contest
What 25 disclosed reports say about Y2k Finance 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 | 12 | 0 | – | – | $0 |
| Access control lesson | 4 | 0 | – | – | $0 |
| DoS lesson | 1 | 0 | – | – | $0 |
| Smart contracts 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.
-
Depeg event can happen at incorrect price
The condition should be changed to revert when the strike price is less than or equal to the latest price, i.e., use <= instead of <.
Disclosed
-
Risk users are required to payout if the price of the pegged asset goes higher than underlying
The ratio should always be calculated as the pegged asset price divided by the underlying price, so that only downward depegs trigger a payout.
Disclosed
-
A design flaw in the case of using 2 oracles (aka PegOracle)
The protocol should only support markets for assets that have an oracle providing a price against a canonical value (x/ETH or x/USD).
Disclosed
-
StakingRewards.sol#stake is intended to be pausable but isn’t
Add external pause and unpause functions callable by the owner.
Disclosed
-
StakingRewards: Significant loss of precision possible
The differences from rounding should be accumulated and users should be able to claim them according to their shares.
Disclosed
-
StakingRewards.sol#notifyRewardAmount() Improper reward balance checks can make some users unable to withdraw their rewards
The function should be changed to transfer the reward tokens into the contract via transferFrom when notifying the reward amount, ensuring the contract actually holds the new funds.
Disclosed
-
After the vault expires, users may still receive rewards through the StakingRewards contract
The StakingRewards contract should be modified to ensure that the reward period finish time does not exceed the vault epoch end time.
Disclosed
-
function changeController() has rug potential as admin can unilaterally withdraw all user funds from both risk and insure vaults
The change of controller address should be restricted to the VaultFactory so that existing markets cannot have a different controller, or a timelock should be added; the report states a timelock was implemented.
Disclosed
-
Griefing attack on the Vaults is possible, withdrawing the winning side stakes
The approval check should be changed to verify that the caller (msg.sender) is approved by the owner, not the receiver.
Disclosed
-
User funds lost because they can’t withdraw() their funds before epoch startTime and they are stuck in positions that become unprofitable even when epoch is not started
The report recommends adding logic that lets users withdraw funds before the epoch start time, though the project disputed the finding.
Disclosed
-
Fees are taken on risk collateral
Fee calculations should be restructured to only take fees on premiums and insurance payouts.
Disclosed
-
It is possible that receiver and treasury can receive nothing when calling withdraw function due to division being performed before multiplication
The calculation should be changed to multiply before dividing, and a check should be added to ensure the entitled shares are greater than zero.
Disclosed
-
StakingRewards: recoverERC20() can be used as a backdoor by the owner to retrieve rewardsToken
Add a require statement that tokenAddress is not the rewardsToken, similar to the existing check for the staking token.
Disclosed
-
StakingRewards reward rate can be dragged out and diluted
The rewardRate should never decrease from a notifyRewardAmount call; either keep periodFinish unchanged and increase rewardRate, or keep rewardRate constant and extend periodFinish.
Disclosed
-
Different Oracle issues can return outdated prices
The timestamp check should be changed to reject prices older than a set observation frequency, such as one hour.
Disclosed