Skip to main content
The EventsLib library defines all events emitted by the Morpho Vault V2 system.

ERC20 events

Approval

event Approval(address indexed owner, address indexed spender, uint256 shares);
Emitted when an approval is set.
owner
address
The address granting the approval
spender
address
The address receiving the approval
shares
uint256
The amount of shares approved

Transfer

event Transfer(address indexed from, address indexed to, uint256 shares);
Emitted when shares are transferred.
from
address
The address sending the shares
to
address
The address receiving the shares
shares
uint256
The amount of shares transferred

AllowanceUpdatedByTransferFrom

event AllowanceUpdatedByTransferFrom(address indexed owner, address indexed spender, uint256 shares);
Emitted when the allowance is updated by transferFrom (not when it is updated by permit, approve, withdraw, or redeem because their respective events allow tracking the allowance).
owner
address
The address whose allowance is updated
spender
address
The address spending the allowance
shares
uint256
The new allowance amount

Permit

event Permit(address indexed owner, address indexed spender, uint256 shares, uint256 nonce, uint256 deadline);
Emitted when a permit is executed.
owner
address
The address granting the permit
spender
address
The address receiving the permit
shares
uint256
The amount of shares approved
nonce
uint256
The nonce used for the permit
deadline
uint256
The deadline for the permit

ERC4626 events

Deposit

event Deposit(address indexed sender, address indexed onBehalf, uint256 assets, uint256 shares);
Emitted when assets are deposited.
sender
address
The address initiating the deposit
onBehalf
address
The address receiving the shares
assets
uint256
The amount of assets deposited
shares
uint256
The amount of shares minted

Withdraw

event Withdraw(
    address indexed sender,
    address indexed receiver,
    address indexed onBehalf,
    uint256 assets,
    uint256 shares
);
Emitted when assets are withdrawn.
sender
address
The address initiating the withdrawal
receiver
address
The address receiving the assets
onBehalf
address
The address whose shares are burned
assets
uint256
The amount of assets withdrawn
shares
uint256
The amount of shares burned

Vault creation events

Constructor

event Constructor(address indexed owner, address indexed asset);
Emitted when the vault is created.
owner
address
The initial owner of the vault
asset
address
The asset token of the vault

Allocation events

Allocate

event Allocate(address indexed sender, address indexed adapter, uint256 assets, bytes32[] ids, int256 change);
Emitted when assets are allocated to an adapter.
sender
address
The address initiating the allocation
adapter
address
The adapter receiving the allocation
assets
uint256
The amount of assets allocated
ids
bytes32[]
The IDs affected by the allocation
change
int256
The change in allocation

Deallocate

event Deallocate(address indexed sender, address indexed adapter, uint256 assets, bytes32[] ids, int256 change);
Emitted when assets are deallocated from an adapter.
sender
address
The address initiating the deallocation
adapter
address
The adapter being deallocated from
assets
uint256
The amount of assets deallocated
ids
bytes32[]
The IDs affected by the deallocation
change
int256
The change in allocation

ForceDeallocate

event ForceDeallocate(
    address indexed sender,
    address adapter,
    uint256 assets,
    address indexed onBehalf,
    bytes32[] ids,
    uint256 penaltyAssets
);
Emitted when assets are force deallocated.
sender
address
The address initiating the force deallocation
adapter
address
The adapter being force deallocated from
assets
uint256
The amount of assets force deallocated
onBehalf
address
The address on whose behalf the force deallocation is performed
ids
bytes32[]
The IDs affected by the force deallocation
penaltyAssets
uint256
The amount of penalty assets charged

Fee and interest events

AccrueInterest

event AccrueInterest(
    uint256 previousTotalAssets,
    uint256 newTotalAssets,
    uint256 performanceFeeShares,
    uint256 managementFeeShares
);
Emitted when interest is accrued.
previousTotalAssets
uint256
The total assets before accrual
newTotalAssets
uint256
The total assets after accrual
performanceFeeShares
uint256
The shares minted as performance fee
managementFeeShares
uint256
The shares minted as management fee

Timelock events

Revoke

event Revoke(address indexed sender, bytes4 indexed selector, bytes data);
Emitted when a timelocked operation is revoked.
sender
address
The address revoking the operation
selector
bytes4
The function selector of the revoked operation
data
bytes
The data of the revoked operation

Submit

event Submit(bytes4 indexed selector, bytes data, uint256 executableAt);
Emitted when a timelocked operation is submitted.
selector
bytes4
The function selector of the submitted operation
data
bytes
The data of the submitted operation
executableAt
uint256
The timestamp when the operation becomes executable

Accept

event Accept(bytes4 indexed selector, bytes data);
Emitted when a timelocked operation is accepted and executed.
selector
bytes4
The function selector of the accepted operation
data
bytes
The data of the accepted operation

Configuration events

SetOwner

event SetOwner(address indexed newOwner);
Emitted when the owner is changed.
newOwner
address
The new owner address

SetCurator

event SetCurator(address indexed newCurator);
Emitted when the curator is changed.
newCurator
address
The new curator address

SetIsSentinel

event SetIsSentinel(address indexed account, bool newIsSentinel);
Emitted when an account’s sentinel status is changed.
account
address
The account whose sentinel status is changed
newIsSentinel
bool
The new sentinel status

SetName

event SetName(string newName);
Emitted when the vault name is changed.
newName
string
The new vault name

SetSymbol

event SetSymbol(string newSymbol);
Emitted when the vault symbol is changed.
newSymbol
string
The new vault symbol

SetIsAllocator

event SetIsAllocator(address indexed account, bool newIsAllocator);
Emitted when an account’s allocator status is changed.
account
address
The account whose allocator status is changed
newIsAllocator
bool
The new allocator status

SetReceiveSharesGate

event SetReceiveSharesGate(address indexed newReceiveSharesGate);
Emitted when the receive shares gate is changed.
newReceiveSharesGate
address
The new receive shares gate address

SetSendSharesGate

event SetSendSharesGate(address indexed newSendSharesGate);
Emitted when the send shares gate is changed.
newSendSharesGate
address
The new send shares gate address

SetReceiveAssetsGate

event SetReceiveAssetsGate(address indexed newReceiveAssetsGate);
Emitted when the receive assets gate is changed.
newReceiveAssetsGate
address
The new receive assets gate address

SetSendAssetsGate

event SetSendAssetsGate(address indexed newSendAssetsGate);
Emitted when the send assets gate is changed.
newSendAssetsGate
address
The new send assets gate address

SetAdapterRegistry

event SetAdapterRegistry(address indexed newAdapterRegistry);
Emitted when the adapter registry is changed.
newAdapterRegistry
address
The new adapter registry address

AddAdapter

event AddAdapter(address indexed account);
Emitted when an adapter is added.
account
address
The adapter address being added

RemoveAdapter

event RemoveAdapter(address indexed account);
Emitted when an adapter is removed.
account
address
The adapter address being removed

DecreaseTimelock

event DecreaseTimelock(bytes4 indexed selector, uint256 newDuration);
Emitted when a timelock duration is decreased.
selector
bytes4
The function selector whose timelock is decreased
newDuration
uint256
The new timelock duration

IncreaseTimelock

event IncreaseTimelock(bytes4 indexed selector, uint256 newDuration);
Emitted when a timelock duration is increased.
selector
bytes4
The function selector whose timelock is increased
newDuration
uint256
The new timelock duration

Abdicate

event Abdicate(bytes4 indexed selector);
Emitted when a function is abdicated (permanently disabled).
selector
bytes4
The function selector being abdicated

SetLiquidityAdapterAndData

event SetLiquidityAdapterAndData(
    address indexed sender,
    address indexed newLiquidityAdapter,
    bytes indexed newLiquidityData
);
Emitted when the liquidity adapter and data are changed.
sender
address
The address initiating the change
newLiquidityAdapter
address
The new liquidity adapter address
newLiquidityData
bytes
The new liquidity data

SetPerformanceFee

event SetPerformanceFee(uint256 newPerformanceFee);
Emitted when the performance fee is changed.
newPerformanceFee
uint256
The new performance fee

SetPerformanceFeeRecipient

event SetPerformanceFeeRecipient(address indexed newPerformanceFeeRecipient);
Emitted when the performance fee recipient is changed.
newPerformanceFeeRecipient
address
The new performance fee recipient address

SetManagementFee

event SetManagementFee(uint256 newManagementFee);
Emitted when the management fee is changed.
newManagementFee
uint256
The new management fee

SetManagementFeeRecipient

event SetManagementFeeRecipient(address indexed newManagementFeeRecipient);
Emitted when the management fee recipient is changed.
newManagementFeeRecipient
address
The new management fee recipient address

DecreaseAbsoluteCap

event DecreaseAbsoluteCap(address indexed sender, bytes32 indexed id, bytes idData, uint256 newAbsoluteCap);
Emitted when an absolute cap is decreased.
sender
address
The address initiating the decrease
id
bytes32
The ID whose cap is decreased
idData
bytes
The ID data
newAbsoluteCap
uint256
The new absolute cap value

IncreaseAbsoluteCap

event IncreaseAbsoluteCap(bytes32 indexed id, bytes idData, uint256 newAbsoluteCap);
Emitted when an absolute cap is increased.
id
bytes32
The ID whose cap is increased
idData
bytes
The ID data
newAbsoluteCap
uint256
The new absolute cap value

DecreaseRelativeCap

event DecreaseRelativeCap(address indexed sender, bytes32 indexed id, bytes idData, uint256 newRelativeCap);
Emitted when a relative cap is decreased.
sender
address
The address initiating the decrease
id
bytes32
The ID whose cap is decreased
idData
bytes
The ID data
newRelativeCap
uint256
The new relative cap value

IncreaseRelativeCap

event IncreaseRelativeCap(bytes32 indexed id, bytes idData, uint256 newRelativeCap);
Emitted when a relative cap is increased.
id
bytes32
The ID whose cap is increased
idData
bytes
The ID data
newRelativeCap
uint256
The new relative cap value

SetMaxRate

event SetMaxRate(uint256 newMaxRate);
Emitted when the maximum rate is changed.
newMaxRate
uint256
The new maximum rate

SetForceDeallocatePenalty

event SetForceDeallocatePenalty(address indexed adapter, uint256 forceDeallocatePenalty);
Emitted when the force deallocate penalty is changed.
adapter
address
The adapter whose penalty is changed
forceDeallocatePenalty
uint256
The new force deallocate penalty

Source code

// SPDX-License-Identifier: GPL-2.0-or-later
// Copyright (c) 2025 Morpho Association
pragma solidity ^0.8.0;

library EventsLib {
    // ERC20 events
    event Approval(address indexed owner, address indexed spender, uint256 shares);
    event Transfer(address indexed from, address indexed to, uint256 shares);
    /// @dev Emitted when the allowance is updated by transferFrom (not when it is updated by permit, approve, withdraw,
    /// redeem because their respective events allow to track the allowance).
    event AllowanceUpdatedByTransferFrom(address indexed owner, address indexed spender, uint256 shares);
    event Permit(address indexed owner, address indexed spender, uint256 shares, uint256 nonce, uint256 deadline);

    // ERC4626 events
    event Deposit(address indexed sender, address indexed onBehalf, uint256 assets, uint256 shares);
    event Withdraw(
        address indexed sender, address indexed receiver, address indexed onBehalf, uint256 assets, uint256 shares
    );

    // Vault creation events
    event Constructor(address indexed owner, address indexed asset);

    // Allocation events
    event Allocate(address indexed sender, address indexed adapter, uint256 assets, bytes32[] ids, int256 change);
    event Deallocate(address indexed sender, address indexed adapter, uint256 assets, bytes32[] ids, int256 change);
    event ForceDeallocate(
        address indexed sender,
        address adapter,
        uint256 assets,
        address indexed onBehalf,
        bytes32[] ids,
        uint256 penaltyAssets
    );

    // Fee and interest events
    event AccrueInterest(
        uint256 previousTotalAssets, uint256 newTotalAssets, uint256 performanceFeeShares, uint256 managementFeeShares
    );

    // Timelock events
    event Revoke(address indexed sender, bytes4 indexed selector, bytes data);
    event Submit(bytes4 indexed selector, bytes data, uint256 executableAt);
    event Accept(bytes4 indexed selector, bytes data);

    // Configuration events
    event SetOwner(address indexed newOwner);
    event SetCurator(address indexed newCurator);
    event SetIsSentinel(address indexed account, bool newIsSentinel);
    event SetName(string newName);
    event SetSymbol(string newSymbol);
    event SetIsAllocator(address indexed account, bool newIsAllocator);
    event SetReceiveSharesGate(address indexed newReceiveSharesGate);
    event SetSendSharesGate(address indexed newSendSharesGate);
    event SetReceiveAssetsGate(address indexed newReceiveAssetsGate);
    event SetSendAssetsGate(address indexed newSendAssetsGate);
    event SetAdapterRegistry(address indexed newAdapterRegistry);
    event AddAdapter(address indexed account);
    event RemoveAdapter(address indexed account);
    event DecreaseTimelock(bytes4 indexed selector, uint256 newDuration);
    event IncreaseTimelock(bytes4 indexed selector, uint256 newDuration);
    event Abdicate(bytes4 indexed selector);
    event SetLiquidityAdapterAndData(
        address indexed sender, address indexed newLiquidityAdapter, bytes indexed newLiquidityData
    );
    event SetPerformanceFee(uint256 newPerformanceFee);
    event SetPerformanceFeeRecipient(address indexed newPerformanceFeeRecipient);
    event SetManagementFee(uint256 newManagementFee);
    event SetManagementFeeRecipient(address indexed newManagementFeeRecipient);
    event DecreaseAbsoluteCap(address indexed sender, bytes32 indexed id, bytes idData, uint256 newAbsoluteCap);
    event IncreaseAbsoluteCap(bytes32 indexed id, bytes idData, uint256 newAbsoluteCap);
    event DecreaseRelativeCap(address indexed sender, bytes32 indexed id, bytes idData, uint256 newRelativeCap);
    event IncreaseRelativeCap(bytes32 indexed id, bytes idData, uint256 newRelativeCap);
    event SetMaxRate(uint256 newMaxRate);
    event SetForceDeallocatePenalty(address indexed adapter, uint256 forceDeallocatePenalty);
}