Skip to main content

SharedMevEscrow

Git Source ↗

Inherits: ISharedMevEscrow

Accumulates received MEV. The rewards are shared by multiple Vaults.

Events

MevReceived

Event emitted on received MEV

event MevReceived(uint256 assets);

Parameters

NameTypeDescription
assetsuint256The amount of MEV assets received

Harvested

Event emitted on harvest

event Harvested(address indexed caller, uint256 assets);

Parameters

NameTypeDescription
calleraddressThe function caller
assetsuint256The amount of assets withdrawn

Functions

harvest

Withdraws MEV accumulated in the escrow. Can be called only by the Vault.

IconImportant

IMPORTANT: because control is transferred to the Vault, care must be taken to not create reentrancy vulnerabilities. The Vault must follow the checks-effects-interactions pattern: https://docs.soliditylang.org/en/v0.8.22/security-considerations.html#use-the-checks-effects-interactions-pattern

function harvest(uint256 assets) external override;

Parameters

NameTypeDescription
assetsuint256The amount of assets to withdraw

receive

Function for receiving MEV

receive() external payable;