Skip to content

PublicAllocator

0xB62F34Ab315eaDeAc698e8EaEB6Fc2650951BFe7 | Git Source

Inherits: IPublicAllocatorStaticTyping

Publicly callable allocator for MetaMorpho vaults.

State Variables

MORPHO

The Morpho contract.

solidity
IMorpho public immutable MORPHO

admin

solidity
mapping(address => address) public admin

fee

solidity
mapping(address => uint256) public fee

accruedFee

solidity
mapping(address => uint256) public accruedFee

flowCaps

solidity
mapping(address => mapping(Id => FlowCaps)) public flowCaps

Functions

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

NameTypeDescription
vaultaddressThe MetaMorpho vault to reallocate.
withdrawalsWithdrawal[]The markets to withdraw from,and the amounts to withdraw.
supplyMarketParamsMarketParamsThe market receiving total withdrawn to.