Try   HackMD

Anchor Sunset. Review Scope.

Simple summary

The anchor-collateral-steth contains Ethereum contracts for integrating stETH as a collateral into the Anchor protocol in the form of bETH token.

Context

In June 2022, we created a post on the research forum in which we published a proposals to stop supporting Anchor integration. A snapshot was published too, that passed the vote.

The procedure is as follows:

  • upgrade contracts to prevent bETH from minting;
  • stop the bot accruing and distributing rewards;
  • allow withdrawal of user funds;
  • stop supporting the Anchor widget UI.

The main changes of AnchorVault contract should look like this:

  • add a deprecation notice
  • disable submit func
  • disable collect_rewards func
  • removed can_deposit_or_withdraw func
  • removed emergency_admin - only DAO can pause or resume the contract now
  • cleared up the contract - remove unused func/events/interfaces/ etc

Note: wrt stETH rebases — rewards distribution discontinued and bETH holders redeem their stETH with 1:1 ratio except only for scaling penalties down on hypothetical severe protocol losses. See get_rate here

We removed everything unnecessary from the contract: unused func, constants, interfaces, etc.

Scope of the review

Code size: ~280 lines of Vyper, ~70 lines of Solidity(calculated by https://github.com/AlDanial/cloc)

The AnchorVault contract is supposed to be used as an implementation for the already deployed AnchorVaultProxy contract.

Commit for review: f2c9c1131bd145b07a6018dbb1ebf11cbf87ea50
UPD. 22 Sep 2023: commit 510b7cc784bb8d07339eef0f388c415701b0d993
UPD. 27 Sep 2023: final commit c186bf3bb89f2945646a76a4e033030c4ea2842a

References