Skip to main content

MorphoCompounderStrategyFactory

Git Source

Inherits: BaseStrategyFactory

Title: MorphoCompounderStrategyFactory

Author: Golem Foundation

Factory for deploying Morpho Compounder yield donating strategies

Uses CREATE2 for deterministic deployments; records deployments via BaseStrategyFactory MORPHO INTEGRATION: This factory deploys strategies that deposit into Yearn USDC vaults, which in turn deploy into Morpho lending markets for yield generation. Morpho is a lending pool optimizer built on top of Compound/Aave.

Note: security-contact: [email protected]

Constants

YS_USDC

Yearn Strategy USDC vault address (target vault for deposits)

address public constant YS_USDC = 0x074134A2784F4F66b6ceD6f68849382990Ff3215

USDC

USDC token address on Ethereum mainnet

address public constant USDC = USDC_MAINNET

Functions

createStrategy

Deploy a new MorphoCompounder strategy

Deterministic salt derived from all parameters to avoid duplicates

function createStrategy(
string memory _name,
string memory _symbol,
address _management,
address _keeper,
address _emergencyAdmin,
address _donationAddress,
bool _enableBurning,
address _tokenizedStrategyAddress
) external returns (address);

Parameters

NameTypeDescription
_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 MorphoCompounderStrategy 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 deployer,
address indexed donationAddress,
address indexed strategyAddress,
string vaultTokenName
);

Parameters

NameTypeDescription
deployeraddressTransaction sender performing deployment
donationAddressaddressDonation destination address for strategy
strategyAddressaddressDeployed strategy address
vaultTokenNamestringVault token name associated with strategy