YearnV3StrategyFactory
Inherits: BaseStrategyFactory
Title: YearnV3StrategyFactory
Author: Golem Foundation
Factory for deploying Yearn v3 yield donating strategies
Deterministic deployment and per-strategy metadata storage
Note: security-contact: [email protected]
State Variables
yearnV3StrategyInfo
Mapping to store YearnV3Strategy-specific information Maps strategy address to YearnV3StrategyInfo
mapping(address => YearnV3StrategyInfo) public yearnV3StrategyInfo
Functions
createStrategy
Deploy a new YearnV3 strategy
Deterministic salt derived from all parameters to avoid duplicates
function createStrategy(
address _yearnVault,
address _asset,
string memory _name,
string memory _symbol,
address _management,
address _keeper,
address _emergencyAdmin,
address _donationAddress,
bool _enableBurning,
address _tokenizedStrategyAddress
) external returns (address);
Parameters
| Name | Type | Description |
|---|---|---|
_yearnVault | address | Yearn v3 vault address to compound into |
_asset | address | Underlying asset address |
_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 burning shares during loss protection |
_tokenizedStrategyAddress | address | TokenizedStrategy implementation address |
Returns
| Name | Type | Description |
|---|---|---|
<none> | address | strategyAddress Deployed YearnV3Strategy 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 on successful strategy deployment
event StrategyDeploy(
address indexed management,
address indexed donationAddress,
address indexed strategyAddress,
string vaultTokenName
);
Parameters
| Name | Type | Description |
|---|---|---|
management | address | Management address for the deployed strategy |
donationAddress | address | Donation destination address for strategy |
strategyAddress | address | Deployed strategy address |
vaultTokenName | string | Vault token name associated with strategy |
Structs
YearnV3StrategyInfo
Extended struct to store YearnV3Strategy-specific information
struct YearnV3StrategyInfo {
address management;
}
Properties
| Name | Type | Description |
|---|---|---|
management | address | Management address responsible for the strategy |