Sherlock contest - pauliax's results

Decentralized exploit protection.

General Information

Platform: Code4rena

Start Date: 20/01/2022

Pot Size: $80,000 USDC

Total HM: 5

Participants: 37

Period: 7 days

Judge: Jack the Pug

Total Solo HM: 1

Id: 76

League: ETH

Sherlock

Findings Distribution

Researcher Performance

Rank: 5/37

Findings: 3

Award: $7,049.05

🌟 Selected for report: 4

🚀 Solo Findings: 0

Findings Information

🌟 Selected for report: hyh

Also found by: GreyArt, harleythedog, pauliax

Labels

bug
duplicate
2 (Med Risk)

Awards

1331.2923 USDC - $1,331.29

External Links

Handle

pauliax

Vulnerability details

Impact

When the withdrawAll from yieldStrategy fails, it nevertheless sets the new yieldStrategy and the old one is forgiven.

    try yieldStrategy.withdrawAll() {} catch (bytes memory reason) {
      emit YieldStrategyUpdateWithdrawAllError(reason);
    }
    emit YieldStrategyUpdated(yieldStrategy, _yieldStrategy);
    yieldStrategy = _yieldStrategy;

I see no easy way to re-try withdrawing all the tokens later. Admin will have to set the old strategy as active again and try to repeat the withdrawal risking that more funds will be deposited in the meantime and become unavailable to withdraw. Thus, I suggest adding an extra gov-only function to withdraw all yield from any strategy, even not an active one, as I do not see any potential harm of having this.

An example implementation:

  function yieldStrategyWithdrawAll(IStrategyManager _yieldStrategy) external override onlyOwner {
    _yieldStrategy.withdrawAll();
  }

#0 - CloudEllie

2022-02-21T19:22:16Z

Duplicate of #76

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