Dual Governance
The Dual Governance module provides an interface to interact with Lido's Dual Governance system, which implements a governance mechanism with veto signaling and rage quit capabilities. This module allows applications to query the current state of governance, monitor veto signaling thresholds, and interact with the relevant contracts.
Core Contracts
- EmergencyProtectedTimelock: A timelock contract with emergency protection mechanisms.
- DualGovernance: The main governance contract that manages the governance state.
- VetoSignallingEscrow: Manages stETH deposits used for veto signaling.
- stETH: The Lido staked ETH token contract.
- DualGovernanceConfigProvider: Provides configuration parameters for the dual governance system.
Governance States
The Dual Governance system can be in one of the following states:
- NotInitialized: Initial state before the governance system is activated.
- Normal: Regular operation state.
- VetoSignalling: Active veto signaling period.
- VetoSignallingDeactivation: Period when veto signaling is being deactivated.
- VetoCooldown: Cooldown period after veto signaling.
- RageQuit: State when rage quit is active, allowing users to withdraw their assets.
API Reference
Contract Access Methods
getContractEmergencyProtectedTimelockAddress()
: Returns the address of theEmergencyProtectedTimelock contract
.getContractEmergencyProtectedTimelock()
: Returns theEmergencyProtectedTimelock
contract instance.getContractDualGovernance()
: Returns theDualGovernance
contract instance.getContractVetoSignallingEscrow()
: Returns theVetoSignallingEscrow
contract instance.getContractStETH()
: Returns thestETH
contract instance.getContractDualGovernanceConfigProvider()
: Returns theDualGovernanceConfigProvider
contract instance.
Contract Address Methods
getGovernanceAddress()
: Returns the address of the DualGovernance contract.getVetoSignallingEscrowAddress()
: Returns the address of theVetoSignallingEscrow
contract.getStETHAddress()
: Returns the address of thestETH
contract.getDualGovernanceConfigProviderAddress()
: Returns the address of the DualGovernanceConfigProvider contract.
Data Query Methods
getVetoSignallingEscrowLockedAssets()
: Returns details about assets locked in theVetoSignallingEscrow
contract.getTotalStEthInEscrow()
: Calculates the total amount of stETH (in ETH terms) locked in theVetoSignallingEscrow
.getDualGovernanceConfig()
: Returns the configuration parameters of the dual governance system.getTotalStETHSupply()
: Returns the total supply of stETH tokens.calculateCurrentVetoSignallingThresholdProgress()
: Calculates the current progress towards the veto signaling threshold as a percentage.getDualGovernanceState()
: Returns the current persisted state of the dual governance system.getGovernanceWarningStatus()
: Computes the current governance status and returns a warning level based on the provided trigger percentage.
Usage Examples
import { LidoSDK } from '@lidofinance/lido-ethereum-sdk';
const lidoSDK = new LidoSDK();
const dualGovernance = lidoSDK.dualGovernance;
// Get the current veto signaling progress
const progress = await dualGovernance.calculateCurrentVetoSignallingThresholdProgress();
console.log(`Current veto signaling support: ${progress.currentSupportPercent}%`);
// Check if we should show a warning (e.g., if support is above 75%)
const warningStatus = await dualGovernance.getGovernanceWarningStatus({
triggerPercent: 75
});
if (warningStatus.state === 'Warning') {
console.log(`Warning: Veto support at ${warningStatus.currentVetoSupportPercent}%`);
} else if (warningStatus.state === 'Blocked') {
console.log('Governance is currently blocked (in VetoSignalling, VetoSignallingDeactivation, or RageQuit state)');
}