A single contract to be used for the Lido DAO Aragon vote that performs on-chain actions for the Lido V1→V2 upgrade on behalf of the Lido DAO.
Lido V2 upgrade changes almost every previously deployed contract and adds new ones. From the prospects of the governance process, an on-chain vote for the upgrade should perform an atomic (all or nothing) transition. The upgrade template encompasses migrations, permissions granting procedures, and overall protocol integrity checks.
The template contract will be used on the third step of the Lido protocol upgrade scheme:
Step 1: Deploy new contracts and updated implementations from EOA.
Step 2: Deploy a new template with the hardcoded addresses of the deployed artifacts.
Step 3: Run an on-chain Aragon vote to execute the template using the entitled Voting
contract
For information: the vote structure is presented in the upgrade_shapella_1.py
and upgrade_shapella_2_revoke_roles.py
upgrade scripts.
On-chain code size:
~650 nSLOC (using the [1] method)
The contract is written in Solidity 0.8.9.
The ShapellaUpgradeTemplate
contract will be changed one last time before the actual upgrade on mainnet to hardcode the deployed addresses of the verified Lido V2
contracts.
The service of deployment verification is vital for this audit that includes:
Lido V2
verified contracts addresses on mainnetThe final commit to audit is: 8f9bfb2f0616fec031d382c4ec5e3455e7ebcd07
In advance. Most of the admin roles stay on deployerEOA. Part are set to Voting
at once.
WithdrawalQueue
, ValidatorExitBusOracle
, AccountingOracle
, StakingRouter
, LidoLocator
DepositSecurityModule
, OracleReportSanityChecker
, OracleDaemonConfig
, EIP712StETH
, Burner
, HashConsensus for AccountingOracle
, HashConsensus for ValidatorsExitBusOracle
LidoLocator
implementation with all the addresses knownGateSeal
contractUpgradeTemplate
contractUpgradeTemplate
from DeployerEOA
UpgradeTemplate
(on etherscan)deployerEOA
to UpdateTemplate
WithdrawalManagerStub
implementation to WithdrawalVault
UpgradeTemplate.startUpgrade()
Lido
, NodeOperatorsRegistry
, LidoOracle
STAKING_ROUTER_ROLE
of NodeOperatorsRegistry
to StakingRouter
UpgradeTemplate.finishUpgrade()
UpgradeTemplate.revertIfUpgradeNotFinished
Voting
at initial deployment
deployerEOA
at initial deployment. passed to UpgradeTemplate
before start of Aragon voting
UpgradeTemplate
by UpgradeTemplate
via initialize()
calls. Passed to Voting
during UpgradeTemplate.finishUpgrade()