// Copyright 2026 Liam Lakevold // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. 'use strict' /** * Minimal Euler Vault Kit (EVK) vault interface used by this module. * Source of truth: euler-xyz/euler-vault-kit, src/EVault/IEVault.sol. */ export const EVAULT_ABI = [ 'function EVC() view returns (address)', 'function asset() view returns (address)', 'function balanceOf(address account) view returns (uint256)', 'function convertToAssets(uint256 shares) view returns (uint256)', 'function maxDeposit(address account) view returns (uint256)', 'function maxWithdraw(address owner) view returns (uint256)', 'function maxRedeem(address owner) view returns (uint256)', 'function cash() view returns (uint256)', 'function debtOf(address account) view returns (uint256)', 'function hookConfig() view returns (address hookTarget, uint32 hookedOps)', 'function LTVBorrow(address collateral) view returns (uint16)', 'function accountLiquidity(address account, bool liquidation) view returns (uint256 collateralValue, uint256 liabilityValue)', 'function deposit(uint256 amount, address receiver) returns (uint256)', 'function withdraw(uint256 amount, address receiver, address owner) returns (uint256)', 'function redeem(uint256 amount, address receiver, address owner) returns (uint256)', 'function borrow(uint256 amount, address receiver) returns (uint256)', 'function repay(uint256 amount, address receiver) returns (uint256)', 'function disableController()' ] /** * Minimal Ethereum Vault Connector (EVC) interface used by this module. * Source of truth: euler-xyz/ethereum-vault-connector, src/interfaces/IEthereumVaultConnector.sol. */ export const EVC_ABI = [ 'function getControllers(address account) view returns (address[])', 'function getCollaterals(address account) view returns (address[])', 'function isControllerEnabled(address account, address vault) view returns (bool)', 'function isCollateralEnabled(address account, address vault) view returns (bool)', 'function enableController(address account, address vault) payable', 'function enableCollateral(address account, address vault) payable', 'function disableCollateral(address account, address vault) payable', 'function batch((address targetContract, address onBehalfOfAccount, uint256 value, bytes data)[] items) payable' ] /** * EVK operation flags (euler-vault-kit, src/EVault/shared/Constants.sol). When a flag is set in a vault's * `hookedOps` and its `hookTarget` is the zero address, that operation is disabled on the vault. */ export const OP = { DEPOSIT: 1 << 0, WITHDRAW: 1 << 2, REDEEM: 1 << 3, BORROW: 1 << 6, REPAY: 1 << 7 }