Skip to content

Commit c1e1c25

Browse files
committed
feat: add errors.md file
1 parent df7ee9b commit c1e1c25

File tree

1 file changed

+47
-0
lines changed

1 file changed

+47
-0
lines changed

docs/errors.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# Errors
2+
3+
## Introduction
4+
5+
The EulerSwap smart contracts throw errors that can help developers debug why EulerSwap instances are failing to provide quotes, satisfy swaps, rebalance, and more. In some cases these errors emerge directly from the EulerSwap smart contracts themselves, while errors can also come from lower level dependencies, such as the Euler Vault Kit (EVK) and Ethereum Vault Connector (EVC). Each error is listed here with its name and a description of when and why it might occur.
6+
7+
## Summary
8+
9+
### E_AccountLiquidity
10+
11+
**Description:** This error is thrown when the liquidity provider account on Euler does not have sufficient liquidity to perform a particular action, such as borrowing or swapping assets. It typically indicates that the collateral value is not enough to cover the desired transaction within the EVK module.
12+
13+
### E_AmountTooLargeToEncode
14+
15+
**Description:** TODO.
16+
17+
### E_BadAddress
18+
19+
**Description:** This error is triggered when an invalid or null address is provided as an input. It is commonly associated with interactions where a recipient, sender, or contract address must be validated before proceeding with a transaction.
20+
21+
### E_BadAssetReceiver
22+
23+
**Description:** Thrown when an asset is directed to an unintended or incompatible receiver contract. This error often prevents token transfers to addresses that do not implement necessary interfaces or are not approved within the EVK and EVC architecture.
24+
25+
### E_BadBorrowCap
26+
27+
**Description:** This error indicates that the specified borrowing cap for an asset is invalid, either being too high or too low according to protocol parameters. It helps maintain stability by enforcing borrowing limits in the EVK.
28+
29+
### E_BadCollateral
30+
31+
**Description:** Raised when an invalid asset is proposed as collateral in a transaction. The EVK system uses this error to ensure only approved and properly configured assets are used to back borrowing positions.
32+
33+
### E_BadFee
34+
35+
**Description:** This error is related to fee calculations within the EulerSwap or associated periphery contracts. It ensures that any fee applied during swaps or vault interactions is within the acceptable bounds set by governance or protocol parameters.
36+
37+
### E_BadMaxLiquidationDiscount
38+
39+
**Description:** Thrown when an invalid maximum liquidation discount is set. Liquidation discounts are critical for maintaining incentives for liquidators while protecting the protocol from excessive losses during liquidation events.
40+
41+
### E_BadSharesOwner
42+
43+
**Description:** This error indicates that the shares of a vault or liquidity pool are owned by an unexpected or unauthorised entity. It ensures that share ownership is consistent with the expected state of the EVK or EVC modules.
44+
45+
## Further reading
46+
47+
For more information, refer to the EulerSwap [White Paper](docs/whitepaper/EulerSwap_White_Paper.pdf) and the smart contract source code.

0 commit comments

Comments
 (0)