MaxApyFactory
Overview
The MaxApyVaultFactory contract is responsible for deploying new MaxApy vaults with deterministic addresses. It manages vault creation and ensures proper initialization with standardized naming conventions.
Constants
uint256 public constant ADMIN_ROLE = _ROLE_0; // Role for administrative functions
uint256 public constant DEPLOYER_ROLE = _ROLE_1; // Role for deploying new vaults
address public immutable treasury; // MaxApy treasury addressEvents
event CreateVault(address indexed asset, address vaultAddress);Functions
Constructor
constructor(address _treasury)Initializes the factory with treasury address and sets up initial roles.
Parameters:
_treasury: Address of the MaxApy treasury
Deployment Functions
deploy
Deploys a new vault with a deterministic address using CREATE3.
Parameters:
underlyingAsset: ERC20 token the vault will acceptvaultAdmin: Admin address for the new vaultsalt: Unique salt for deterministic address generation
Returns:
Address of the deployed vault
View Functions
computeAddress
Computes the deterministic deployment address for a given salt.
Parameters:
salt: Salt to use for address computation
Returns:
Expected deployment address
Internal Functions
parseName
Generates standardized vault name from asset symbol.
Parameters:
symbol: Asset symbol
Returns:
Formatted vault name (e.g., "MaxApy-USDC Vault")
parseSymbol
Generates standardized vault symbol from asset symbol.
Parameters:
symbol: Asset symbol
Returns:
Formatted vault symbol (e.g., "maxUSDC")
Last updated