How it worksCompetitionsReviewsGuildsBountiesPortfolioBlog
Sign in

Euler / Euler-v2

euler-xyzeulerfinance

Overview

Euler v2 is a modular lending platform with two main components at launch: 1) the Euler Vault Kit (EVK), which empowers builders to deploy and chain together their own customised lending vaults in a permissionless manner; and 2) the Ethereum Vault Connector (EVC), a powerful, immutable, primitive which give vaults superpowers by allowing their use as collateral for other vaults. Together, the EVK and EVC provide the flexibility to build or recreate any type of pre-existing or future-state lending product inside the Euler ecosystem.

Euler Vault Kit:

The Euler Vault Kit is a system for constructing credit vaults. Credit vaults are ERC-4626 vaults with added borrowing functionality. Unlike typical ERC-4626 vaults which earn yield by actively investing deposited funds, credit vaults are passive lending pools.

Users can borrow from a credit vault as long as they have sufficient collateral deposited in other credit vaults. The liability vault (the one that was borrowed from) decides which credit vaults are acceptable as collateral. Interest is charged to borrowers by continuously increasing the amount of their outstanding liability and this interest results in yield for the depositors.

Vaults are integrated with the Ethereum Vault Connector contract (EVC), which keeps track of the vaults used as collateral by each account. In the event a liquidation is necessary, the EVC allows a liability vault to withdraw collateral on a user's behalf.

The EVC is also an alternate entry-point for interacting with vaults. It provides multicall-like batching, simulations, gasless transactions, and flash liquidity for efficient refinancing of loans. External contracts can be invoked without needing special adaptors, and all functionality is accessible to both EOAs and contract wallets. Although each address is only allowed one outstanding liability at any given time, the EVC provides it with 256 virtual addresses, called sub-accounts (from here on, just accounts). Sub-account addresses are internal to the EVC and compatible vaults, and care should be taken to ensure that these addresses are not used by other contracts.

The EVC is responsible for authentication, and vaults are responsible for authorisation. For example, if a user attempts to redeem a certain amount, the EVC makes sure the request actually came from the user, and the vault makes sure the user actually has this amount.

Ethereum Vault Connector

The Ethereum Vault Connector (EVC) is a foundational layer designed to facilitate the core functionality required for a lending market. It serves as a base building block for various protocols, providing a robust and flexible framework for developers to build upon. The EVC primarily mediates between vaults, contracts that implement the ERC-4626 interface and contain additional logic for interfacing with other vaults. The EVC not only provides a common base ecosystem but also reduces complexity in the core lending/borrowing contracts, allowing them to focus on their differentiating factors.

Euler Price Oracles:

Euler Price Oracles is a library of modular oracle adapters and components that implement IPriceOracle, an opinionated quote-based interface. It supports Chainlink, Chronicle, RedStone Core and Pyth through minimal, immutable adapter contracts. The EulerRouter component is a dispatcher contract that maintains a configuration of resolver oracles with an optional fallback. The router can price ERC4626 shares to assets through convertToAsset, making it a convenient entry point contract for EVK pricing.

Reward Streams:

Reward Streams is a powerful and flexible implementation of the billion-dollar algorithm, a popular method for proportional reward distribution in the Ethereum developer community. This project extends the algorithm's functionality to support both staking and staking-free (based on balance changes tracking) reward distribution, multiple reward tokens, and permissionless registration of reward distribution schemes (reward streams). This makes Reward Streams a versatile tool for incentivizing token staking and holding in a variety of use cases.

Prize distribution and scoring

  • Primary Prize Pool: $1,150,000

  • Formal Verification Prize pool: $100,000

  • The Primary prize pool distribution has 3 possible triggers:

    • If one or more valid low severity findings are found, the total pot size is $20,000
    • If one or more valid medium severity findings are found, the total pot size is $200,000
    • If one or more valid high severity findings are found, the total pot size is $1,150,000
  • $20,000 of the prize pot is reserved for Low Severity findings. These reports are judged based on quality and reviewers are then ranked from 1st to 5th for the purpose of prize allocation.

    • 1st: $10,000
    • 2nd: $5,000
    • 3rd: $2,500
    • 4th: $1,250
    • 5th: $1,250

Note that for Low findings, we want to encourage high-quality non-trivial submissions. Given that the codebase has gone through multiple reviews before, and due to the large number of participants, we’ll be marking any trivial low / info findings as invalid (these are typically findings generated from a static-analyzer). To reiterate, the above pot is judged on quality alone and not quantity.

Documentation

Links

White Papers

Specs

Audit Reports/Security Reviews

EVC

EVK

Price Oracle

Reward Streams

Scope

Walkthrough

Contracts

  • EVC
    • Commit: f791f94e6e790dd82041908983b57412dc04fb84
    • Total LOC: 980
    • Files:
FileLinesnLinesnSLOCComments
ethereum-vault-connector/src/utils/EVCUtil.sol1091096334
ethereum-vault-connector/src/EthereumVaultConnector.sol12361126603305
ethereum-vault-connector/src/Set.sol31030717085
ethereum-vault-connector/src/ExecutionContext.sol90905419
ethereum-vault-connector/src/interfaces/IERC1271.sol151439
ethereum-vault-connector/src/interfaces/IEthereumVaultConnector.sol4344818297
ethereum-vault-connector/src/interfaces/IVault.sol3316323
ethereum-vault-connector/src/TransientStorage.sol51511923
ethereum-vault-connector/src/Events.sol80802246
ethereum-vault-connector/src/Errors.sol50502522
Totals24081891980863
  • Euler Vault Kit

    • Commit: f6fd0ee3b454630abd961d6471beb0c7eaf1216a
    • Total LOC: 3093
    • Files:
FileLinesnLinesnSLOCComments
euler-vault-kit/src/interfaces/IBalanceTracker.sol2019314
euler-vault-kit/src/interfaces/ISequenceRegistry.sol141338
euler-vault-kit/src/interfaces/IPermit2.sol1615310
euler-vault-kit/src/interfaces/IFlashLoan.sol131237
euler-vault-kit/src/interfaces/IHookTarget.sol141338
euler-vault-kit/src/interfaces/IPriceOracle.sol3212319
euler-vault-kit/src/Synths/EulerSavingsRate.sol26724012972
euler-vault-kit/src/Synths/ERC20Collateral.sol74682733
euler-vault-kit/src/Synths/PegStabilityModule.sol1561568546
euler-vault-kit/src/Synths/ESynth.sol1691699151
euler-vault-kit/src/Synths/IRMSynth.sol1091097416
euler-vault-kit/src/EVault/modules/Liquidation.sol23921711653
euler-vault-kit/src/EVault/modules/Initialize.sol1071076221
euler-vault-kit/src/EVault/modules/Borrowing.sol17117110222
euler-vault-kit/src/EVault/modules/RiskManager.sol1271095526
euler-vault-kit/src/EVault/modules/Vault.sol27526215839
euler-vault-kit/src/EVault/modules/Governance.sol406395216100
euler-vault-kit/src/EVault/modules/BalanceForwarder.sol59593310
euler-vault-kit/src/EVault/modules/Token.sol1031036018
euler-vault-kit/src/EVault/DToken.sol95954432
euler-vault-kit/src/EVault/Dispatch.sol17517512146
euler-vault-kit/src/EVault/IEVault.sol5585414319
euler-vault-kit/src/EVault/EVault.sol24324310030
euler-vault-kit/src/EVault/shared/LTVUtils.sol2020115
euler-vault-kit/src/EVault/shared/BalanceUtils.sol1271146914
euler-vault-kit/src/EVault/shared/Cache.sol1351358026
euler-vault-kit/src/EVault/shared/Events.sol1271273970
euler-vault-kit/src/GenericFactory/BeaconProxy.sol80805016
euler-vault-kit/src/EVault/shared/Errors.sol5959525
euler-vault-kit/src/GenericFactory/GenericFactory.sol2051938867
euler-vault-kit/src/GenericFactory/MetaProxyDeployer.sol29291310
euler-vault-kit/src/EVault/shared/EVCClient.sol1441419615
euler-vault-kit/src/InterestRateModels/IIRM.sol2517415
euler-vault-kit/src/ProtocolConfig/IProtocolConfig.sol3318323
euler-vault-kit/src/ProtocolConfig/ProtocolConfig.sol21821210361
euler-vault-kit/src/EVault/shared/LiquidityUtils.sol1251066318
euler-vault-kit/src/EVault/shared/BorrowUtils.sol19218812819
euler-vault-kit/src/EVault/shared/Constants.sol64643123
euler-vault-kit/src/EVault/shared/AssetTransfers.sol43432214
euler-vault-kit/src/EVault/shared/Base.sol1521489231
euler-vault-kit/src/EVault/shared/Storage.sol212179
euler-vault-kit/src/InterestRateModels/IRMLinearKink.sol74643913
euler-vault-kit/src/EVault/shared/types/AmountCap.sol33331413
euler-vault-kit/src/EVault/shared/types/Snapshot.sol38381913
euler-vault-kit/src/EVault/shared/types/LTVConfig.sol84804720
euler-vault-kit/src/EVault/shared/types/Owed.sol8383568
euler-vault-kit/src/EVault/shared/types/UserStorage.sol76764712
euler-vault-kit/src/EVault/shared/types/Shares.sol7070506
euler-vault-kit/src/EVault/shared/types/VaultCache.sol52522021
euler-vault-kit/src/EVault/shared/types/Assets.sol9191676
euler-vault-kit/src/EVault/shared/types/ConfigAmount.sol3939247
euler-vault-kit/src/EVault/shared/lib/ConversionHelpers.sol2622126
euler-vault-kit/src/EVault/shared/lib/AddressUtils.sol171785
euler-vault-kit/src/EVault/shared/types/VaultStorage.sol78783234
euler-vault-kit/src/EVault/shared/lib/RPow.sol1001005928
euler-vault-kit/src/EVault/shared/types/Flags.sol2525137
euler-vault-kit/src/EVault/shared/lib/SafeERC20Lib.sol53503110
euler-vault-kit/src/EVault/shared/types/Types.sol8282584
euler-vault-kit/src/EVault/shared/lib/RevertBytes.sol2121125
euler-vault-kit/src/EVault/shared/lib/ProxyUtils.sol3030187
euler-vault-kit/src/SequenceRegistry/SequenceRegistry.sol32321114
Totals6345561430931680
FileLinesnLinesnSLOCComments
euler-price-oracle/src/lib/Governable.sol44442215
euler-price-oracle/src/lib/ScaleUtils.sol78703132
euler-price-oracle/src/lib/Errors.sol2525915
euler-price-oracle/src/interfaces/IPriceOracle.sol3011318
euler-price-oracle/src/EulerRouter.sol1531496474
euler-price-oracle/src/adapter/chronicle/IChronicle.sol1612310
euler-price-oracle/src/adapter/chronicle/ChronicleOracle.sol71713429
euler-price-oracle/src/adapter/chainlink/ChainlinkOracle.sol74743630
euler-price-oracle/src/adapter/chainlink/AggregatorV3Interface.sol2310313
euler-price-oracle/src/adapter/pyth/PythOracle.sol1391397651
euler-price-oracle/src/adapter/CrossAdapter.sol63632929
euler-price-oracle/src/adapter/redstone/RedstoneCoreOracle.sol1311316653
euler-price-oracle/src/adapter/lido/IStEth.sol1611310
euler-price-oracle/src/adapter/lido/LidoOracle.sol35351616
euler-price-oracle/src/adapter/BaseAdapter.sol40391717
euler-price-oracle/src/adapter/uniswap/UniswapV3Oracle.sol78783834
Totals1016962450446
  • Reward Streams

    • Commit: 4f63aea41dae996b59d0ba453326b6e97f44f680

    • Total LOC: 392

    • Files:

FileLinesnLinesnSLOCComments
reward-streams/src/interfaces/IBalanceTracker.sol1918313
reward-streams/src/interfaces/IRewardStreams.sol4517610
reward-streams/src/StakingRewardStreams.sol1131086321
reward-streams/src/BaseRewardStreams.sol664617290225
reward-streams/src/TrackingRewardStreams.sol62583018
Totals903818392287

Build Instructions

Basic Proof Of Concept test

System Roles and Privileges

  • Euler DAO: This entity manages the upgrade admin role in GenericFactory (if not revoked), and the admin role in ProtocolConfig. For the purposes of this contest, this role is considered trusted.
  • Vault creators/governors: Anyone can create a vault and optionally retain governance control over it. Governors are responsible for securely configuring their own vaults, and for selecting suitable vaults to use as collateral. For this contest, a vault's governor should be considered trusted so far as users of this vault are concerned (including other vault governors who choose to use it as collateral).
  • EulerRouter price governors: These users are responsible for maintaining the pricing sources used for an oracle. For this contest they can be trusted to not select malicious oracles.
  • Synth owners/minters: These users should be considered trusted in the context of managing the synthetic asset and its distribution.
  • Regular users: Any other user is considered untrusted.

Out of Scope issues

Any previous issue marked as acknowledged/will not fix is not in scope to be reported again. If there has been a fix implemented, the fixed code can be treated as in scope.

  • Issues described in our documentation: in-code comments, in the README and in the whitepapers.
  • Issues found in previous security reviews
  • Issues related to deploy scripts or tests
  • Third party integrations not functioning as advertised
  • Issues related to potentially malicious actions taken by Euler DAO controlled entities are considered out of scope as they are assumed to be trusted
  • Issues related to non Euler DAO/untrusted entities or mistakes made by governors/admins/deployers when configuring vaults or price oracles:
    • The issue will be considered out of scope if it involves a user or vault actively opting to use something created or controlled by the untrusted actor
    • The issue will be considered in scope if there is impact on other disconnected vaults/parts of the system that are not associated with the untrusted actor
  • Issues related to chain re-orgs and network liveness
  • Issues related to non-EVM networks
  • Issues related to Arbitrum, Base, and Optimism networks are in scope. While issues specific to deployment on other EVM networks will be considered valid for low vulnerability payouts only
  • Incompatibilities with ERC-4626 and ERC-20 unless they pose a direct security risk
  • Issues related to non-standard tokens and their behaviors (i.e. weird-tokens)
  • Incorrect hardcoded addresses would be considered low, unless there is a direct loss of funds on deployment from using them.
  • Protocol must change relevant addresses(if any) prior to deploying across multiple chains. These issues are at best low.
  • Automated findings from Lightchaser

EVK-Specific

  • Omniscia EVK web report (see above), since we don't have PDF yet
  • External contracts chosen by the factory admin are assumed to not be malicious:
    • EVC, ProtocolConfig, SequenceRegistry, BalanceTracker, Permit2
  • External contracts chosen by governor are assumed to not be malicious:
    • Underlying tokens, Price Oracles, IRMs, hook targets

Euler Price Oracle-Specific

  • We are aware that some Price Oracles are not compatible with all networks. RedstoneCoreOracle and LidoOracle only work on Ethereum. ChronicleOracle does not (yet) work on Base and Optimism.
  • Issues related to misconfiguration in the constructors, including but not limited to zero addresses, wrong base/quote tokens and invalid decimals.
  • Issues related to a malicious/compromised governor in EulerRouter.
  • Issues related to misconfiguration in EulerRouter, including but not limited to resolving ERC4626 vaults with an insecure convertToAssets method.
  • Issues related to overflows and other math errors must have a demonstrable impact with a concrete scenario.
  • Issues related to reusing an adapter for integrations it was not intended for. For example, using ChainlinkOracle for an AggregatorV3-compatible oracle that is not Chainlink.
  • Issues related to censorship / frontrunning users that interact with Pyth and RedStone. We expect users to interact with the EVC or another multicall-like contract to update the price and retrieve it in a single call.
  • Issues related to using non-crypto price feeds in oracle adapters, including but not limited to Stocks feeds, ETF feeds, Forex feeds and any other feeds that have working hours.
  • Issues stemming from sequencer downtime on L2s, including but not limited to inexistent sequencer liveness checks.
  • Issues stemming from liveness and catastrophic bugs or malicious behaviour in the integrated oracles, including but not limited to Chainlink upgrades, Chronicle caller whitelist, RedStone signers rotating, Pyth downtime due to Wormhole. By using an oracle users choose to accept those trust assumptions.

Reward Stream-Specific

  • Issues related to an incorrect integration of the tracking reward streams (ie, a non-EVK installation)

Automated findings generated by LightChaserV3

Summary

Status

Escalations Ended

Total reward:

$1,250,000 USDC

Start date:

20 May 2024 8:00pm (local time)

End date:

17 Jun 2024 8:00pm (local time)

The first marketplace for web3 security. We've aggregated the security talent and solutions so you don't have to.

Services

CompetitionsReviewsBountiesGuilds

© 2024 Cantina. All rights reserved.