PublicAllocator
Inherits: IPublicAllocatorStaticTyping
Publicly callable allocator for MetaMorpho vaults.
State Variables
MORPHO
The Morpho contract.
solidity
IMorpho public immutable MORPHOadmin
solidity
mapping(address => address) public adminfee
solidity
mapping(address => uint256) public feeaccruedFee
solidity
mapping(address => uint256) public accruedFeeflowCaps
solidity
mapping(address => mapping(Id => FlowCaps)) public flowCapsFunctions
onlyAdminOrVaultOwner
Reverts if the caller is not the admin nor the owner of this vault.
solidity
modifier onlyAdminOrVaultOwner(address vault) ;constructor
Initializes the contract.
solidity
constructor(address morpho) ;setAdmin
Sets the admin for a given vault.
solidity
function setAdmin(address vault, address newAdmin) external onlyAdminOrVaultOwner(vault);setFee
Sets the fee for a given vault.
solidity
function setFee(address vault, uint256 newFee) external onlyAdminOrVaultOwner(vault);setFlowCaps
Sets the maximum inflow and outflow through public allocation for some markets for a given vault.
Max allowed inflow/outflow is MAX_SETTABLE_FLOW_CAP.
solidity
function setFlowCaps(address vault, FlowCapsConfig[] calldata config) external onlyAdminOrVaultOwner(vault);transferFee
Transfers the current balance to feeRecipient for a given vault.
solidity
function transferFee(address vault, address payable feeRecipient) external onlyAdminOrVaultOwner(vault);reallocateTo
Reallocates from a list of markets to one market.
Will call MetaMorpho's reallocate.
solidity
function reallocateTo(address vault, Withdrawal[] calldata withdrawals, MarketParams calldata supplyMarketParams)
external
payable;Parameters
| Name | Type | Description |
|---|---|---|
vault | address | The MetaMorpho vault to reallocate. |
withdrawals | Withdrawal[] | The markets to withdraw from,and the amounts to withdraw. |
supplyMarketParams | MarketParams | The market receiving total withdrawn to. |