Badger Citadel contest - scaraven's results

Bringing BTC to DeFi

General Information

Platform: Code4rena

Start Date: 14/04/2022

Pot Size: $75,000 USDC

Total HM: 8

Participants: 72

Period: 7 days

Judge: Jack the Pug

Total Solo HM: 2

Id: 110

League: ETH

BadgerDAO

Findings Distribution

Researcher Performance

Rank: 26/72

Findings: 2

Award: $523.21

🌟 Selected for report: 0

🚀 Solo Findings: 0

Findings Information

Labels

bug
duplicate
3 (High Risk)
sponsor confirmed

Awards

431.1404 USDC - $431.14

External Links

Lines of code

https://github.com/code-423n4/2022-04-badger-citadel/blob/18f8c392b6fc303fe95602eba6303725023e53da/src/StakedCitadel.sol#L830 https://github.com/code-423n4/2022-04-badger-citadel/blob/18f8c392b6fc303fe95602eba6303725023e53da/src/interfaces/citadel/IVesting.sol#L5 https://github.com/code-423n4/2022-04-badger-citadel/blob/18f8c392b6fc303fe95602eba6303725023e53da/src/StakedCitadelVester.sol#L132

Vulnerability details

Impact

In the withdraw() function in the stakedCitadel contract, the function makes a call to setupVesting() which does not exist in the StakedCitadelVester contract. Therefore, any transaction where a user tries to withdraw CTDL from the vault will fail and users will not be able to retreive their deposits.

Change all instances of setupVesting() to vest()

#0 - GalloDaSballo

2022-04-23T01:36:45Z

Yes

#1 - jack-the-pug

2022-05-29T07:08:22Z

Dup #9

Uncecessary functions in StakedCitadel.sol and IVault.sol

It mentions in the documentation here that the StakedCitadel.sol contract is a fork with no strategy. Consider removing functions such as setStrategy(), earn() and other strategy related functions to increase readability.

Running setStrategy() and earn() in StakedCitadel.sol can cause hypothetical loss of user funds

If governence sets a strategy and then executes earn(). 95% of the CTDL in the vault to be sent to the strategy contract. Any user who then tries to withdraw CTDL using xCTDL will only receive a fraction of their deposit as balance() has decreased. Consider removing these functions. See earn() and withdraw()

Additionally, the IVault interface for StakedCitadel contains reward() which was removed from StakedCitadel.sol in version 1.5. Consider removing reward() from the interface.

AuditHub

A portfolio for auditors, a security profile for protocols, a hub for web3 security.

Built bymalatrax © 2024

Auditors

Browse

Contests

Browse

Get in touch

ContactTwitter