Hunt prep
Before you test Badger Citadel contest
What 11 disclosed reports say about Badger Citadel 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 | 8 | 0 | – | – | $0 |
| Race condition lesson | 2 | 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.
-
StakedCitadel: wrong setupVesting function name
The interface and call should use the correct function name, vest, instead of setupVesting; the report says this was confirmed and resolved.
Disclosed
-
Stale price used when citadelPriceFlag is cleared
The contract should always update the stored price, even when the flag is set.
Disclosed
-
New vest reset unlockBegin of existing vest without removing vested amount
The vest function should subtract the claimed amount from lockedAmounts and reset claimedAmounts to zero when a new vest is started; the report says this was fixed in a later pull request.
Disclosed
-
Guaranteed citadel profit
The report recommends calling mintAndDistribute through flashbots to prevent front-running.
Disclosed
-
StakedCitadel depositors can be attacked by the first depositor with depressing of vault token denomination
The deposit function should require a minimum deposit amount, or the first depositor should be required to lock a sufficiently large initial amount, to make the attack economically unviable.
Disclosed
-
KnightingRound tokenOutPrice changes
The buy function should accept a believedPrice parameter and revert if it does not match the current tokenOutPrice.
Disclosed
-
Funding.deposit() doesn’t work if there is no discount set
The getAmountOut function should be changed to always compute the base amount before applying any discount.
Disclosed
-
StakedCitadel doesn’t use correct balance for internal accounting
The balance() function should be fixed to return the vault balance plus the strategy balance, as in the referenced Badger vault implementation.
Disclosed
-
Owner can steal input tokens
The price should be locked once the sale has started, and the sale start should not be changeable after it has begun.
Disclosed
-
saleRecipient can rug buyers
The contract should hold the tokenIn itself and only release it to the saleRecipient after confirming that a sufficient amount of tokenOut has been transferred into the contract.
Disclosed
-
The Owner and Proxy Admin can make users lose funds (“rug vectors”)
The contract should be redesigned to remove or restrict owner and proxy admin powers, for example by using a standard crowdsale contract, enforcing funding before sale, removing onlyOwner from finalize, limiting condition changes, allowing emergency withdrawals, restricting sweep to after…
Disclosed