LidoStrategyFactory
Inherits: BaseStrategyFactory
Title: LidoStrategyFactory
Author: Golem Foundation
Factory for deploying LidoStrategy instances with deterministic addresses
Uses CREATE2 for predictable deployment addresses based on parameters \n * DEPLOYMENT:\n * - Hardcoded to wstETH on Ethereum mainnet\n * - Parameters hashed to prevent duplicate deployments\n * - Each deployer can create multiple strategies with different params\n * \n * GAS COST:\n * - Strategy deployment: ~3-4M gas\n * - Includes full contract deployment (not a proxy)\n
Note: security-contact: [email protected]
State Variables
WSTETH
wstETH token address on Ethereum mainnet
Lido's wrapped staked ETH (non-rebasing wrapper for stETH)
address public constant WSTETH = 0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0
Functions
createStrategy
Deploys a new LidoStrategy instance
Uses CREATE2 for deterministic deployment PARAMETERS HASHED FOR SALT: All parameters combined determine unique address Same parameters = same address (prevents duplicates) PROCESS:
- Hash all parameters for salt generation
- Encode bytecode with constructor args
- Deploy via CREATE2 (reverts if duplicate)
- Emit StrategyDeploy event
- Record deployment for tracking
function createStrategy(
string memory _name,
string memory _symbol,
address _management,
address _keeper,
address _emergencyAdmin,
address _donationAddress,
bool _enableBurning,
address _tokenizedStrategyAddress
) external returns (address strategyAddress);
Parameters
| Name | Type | Description |
|---|---|---|
_name | string | Strategy share token name |
_symbol | string | Strategy share token symbol |
_management | address | Management address (can update params) |
_keeper | address | Keeper address (calls report) |
_emergencyAdmin | address | Emergency admin address |
_donationAddress | address | Dragon router address (receives profit shares) |
_enableBurning | bool | True to enable dragon loss protection |
_tokenizedStrategyAddress | address | TokenizedStrategy implementation address |
Returns
| Name | Type | Description |
|---|---|---|
strategyAddress | address | Deployed LidoStrategy address |
computeStrategyAddress
Compute the deterministic address where a strategy will be deployed
Must be implemented by child factories using their own bytecode
function computeStrategyAddress(
address _vault,
address _asset,
string memory _name,
string memory _symbol,
address _management,
address _keeper,
address _emergencyAdmin,
address _donationAddress,
bool _enableBurning,
address _tokenizedStrategyAddress,
address _deployer
) public view override returns (address);
Parameters
| Name | Type | Description |
|---|---|---|
_vault | address | Vault address (e.g., Yearn vault, or factory constant for hardcoded vaults) |
_asset | address | Underlying asset address (or factory constant for hardcoded assets) |
_name | string | Strategy share token name |
_symbol | string | Strategy share token symbol |
_management | address | Management address |
_keeper | address | Keeper address |
_emergencyAdmin | address | Emergency admin address |
_donationAddress | address | Donation address |
_enableBurning | bool | Enable burning flag |
_tokenizedStrategyAddress | address | TokenizedStrategy implementation |
_deployer | address | Address that will deploy the strategy |
Returns
| Name | Type | Description |
|---|---|---|
<none> | address | Predicted strategy address |
Events
StrategyDeploy
Emitted when a new LidoStrategy is deployed
event StrategyDeploy(
address indexed deployer,
address indexed donationAddress,
address indexed strategyAddress,
string vaultTokenName
);
Parameters
| Name | Type | Description |
|---|---|---|
deployer | address | Address that deployed the strategy |
donationAddress | address | Dragon router address that receives profit shares |
strategyAddress | address | Deployed strategy address |
vaultTokenName | string | Strategy share token name |