Skip to main content

YearnV3StrategyFactory

Git Source

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

NameTypeDescription
_yearnVaultaddressYearn v3 vault address to compound into
_assetaddressUnderlying asset address
_namestringStrategy share token name
_symbolstringStrategy share token symbol
_managementaddressManagement address (can update params)
_keeperaddressKeeper address (calls report)
_emergencyAdminaddressEmergency admin address
_donationAddressaddressDragon router address (receives profit shares)
_enableBurningboolTrue to enable burning shares during loss protection
_tokenizedStrategyAddressaddressTokenizedStrategy implementation address

Returns

NameTypeDescription
<none>addressstrategyAddress 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

NameTypeDescription
_vaultaddressVault address (e.g., Yearn vault, or factory constant for hardcoded vaults)
_assetaddressUnderlying asset address (or factory constant for hardcoded assets)
_namestringStrategy share token name
_symbolstringStrategy share token symbol
_managementaddressManagement address
_keeperaddressKeeper address
_emergencyAdminaddressEmergency admin address
_donationAddressaddressDonation address
_enableBurningboolEnable burning flag
_tokenizedStrategyAddressaddressTokenizedStrategy implementation
_deployeraddressAddress that will deploy the strategy

Returns

NameTypeDescription
<none>addressPredicted strategy address

Events

StrategyDeploy

Emitted on successful strategy deployment

event StrategyDeploy(
address indexed management,
address indexed donationAddress,
address indexed strategyAddress,
string vaultTokenName
);

Parameters

NameTypeDescription
managementaddressManagement address for the deployed strategy
donationAddressaddressDonation destination address for strategy
strategyAddressaddressDeployed strategy address
vaultTokenNamestringVault token name associated with strategy

Structs

YearnV3StrategyInfo

Extended struct to store YearnV3Strategy-specific information

struct YearnV3StrategyInfo {
address management;
}

Properties

NameTypeDescription
managementaddressManagement address responsible for the strategy