Errors structure

In Fluid, errors are organized systematically to enhance clarity and ease of reference. Each protocol or module within a protocol has its dedicated set of error definitions and types.

Error IDs Specification

To maintain consistency and avoid clashes, we follow a unique numbering system for error IDs. Each protocol or even each contract within a protocol gets a distinct range.

For instance:

  • Liquidity Protocol:
    • Liquidity UserModule module: 10001, 10002, 10003, etc.
    • Liquidity AdminModule module: 11001, 11002, 11003, etc.
  • Lending Protocol:
    • Lending fToken module: 20001, 20002, 20003, etc.
    • Lending LendingFactory module: 21001, 21002, etc.

By adhering to this structure, developers can easily trace errors back to their source module and protocol, simplifying debugging and maintenance.

Error ID Ranges

1. Liquidity Protocol -

  • Admin Module - Prefix: AdminModule__:
    • Range: 10001-10999
  • User Module - Prefix: UserModule__:
    • Range: 11001-11999
  • Helpers - Prefix: LiquidityHelpers__:
    • Range: 12001-12999

2. Lending Protocol

  • fToken Module - Prefix: fToken__:
    • Range: 20001-20999
  • fToken Native Underlying Module - Prefix: fTokenNativeUnderlying__:
    • Range: 21001-21999
  • Lending Factory Module - Prefix: LendingFactory__:
    • Range: 22001-22999
  • Lending Rewards Rate Model Module - Prefix: LendingRewardsRateModel__:
    • Range: 23001-23999

3. Vault Protocol

  • Vault Factory Module - Prefix: VaultFactory__:
    • Range: 30001-30999
  • VaultT1 Module - Prefix: VaultT1__:
    • Range: 31001-31999
  • ERC721 Module - Prefix: ERC721__:
    • Range: 32001-32999
  • VaultT1 Admin - Prefix: VaultT1Admin__:
    • Range: 33001-33999
  • Vault Rewards - Prefix: VaultRewards__:
    • Range: 34001-34999

4. StETH Protocol - Prefix: StETH__

  • Range: 40001-40999

5. InfiniteProxy Protocol - Prefix: InfiniteProxy__

  • Range: 50001-50999

6. Oracles

  • FluidOracleL2 - Prefix: FluidOracleL2__:
    • Range: 60000
  • UniV3CheckCLRSOracle oracle - Prefix: UniV3CheckCLRSOracle__:
    • Range: 60001-60009
  • FluidOracle - Prefix: FluidOracle__:
    • Range: 60010
  • sUSDe oracle - Prefix: SUSDeOracle__:
    • Range: 60101-60199
  • Pendle oracle - Prefix: PendleOracle__:
    • Range: 60201-60299
  • CLRS2UniV3CheckCLRSOracleL2 - Prefix: CLRS2UniV3CheckCLRSOracleL2__:
    • Range: 60301-60310
  • Ratio2xFallbackCLRSOracleL2 - Prefix: Ratio2xFallbackCLRSOracleL2__:
    • Range: 60311-60320
  • Chainlink oracle - Prefix: ChainlinkOracle__:
    • Range: 61001-61999
  • UniV3Oracle oracle - Prefix: UniV3Oracle__:
    • Range: 62001-62999
  • WstETh oracle - Prefix: WstETHOracle__:
    • Range: 63001-63999
  • Redstone oracle - Prefix: RedstoneOracle__:
    • Range: 64001-64999
  • Fallback oracle - Prefix: FallbackOracle__:
    • Range: 65001-65999
  • FallbackCLRS oracle - Prefix: FallbackCLRSOracle__:
    • Range: 66001-66999
  • WstETHCLRS oracle - Prefix: WstETHCLRSOracle__:
    • Range: 67001-67999
  • CLFallbackUniV3 oracle - Prefix: CLFallbackUniV3Oracle__:
    • Range: 68001-68999
  • WstETHCLRS2UniV3CheckCLRS oracle - Prefix: WstETHCLRS2UniV3CheckCLRSOracle__:
    • Range: 69001-69999
  • WeETH oracle - Prefix: WeETHOracle__:
    • Range: 70001-79999

7. Libraries

  • LiquidityCalcs - Prefix: LiquidityCalcs__:
    • Range: 70001-70999
  • SafeTransfer - Prefix: SafeTransfer__:
    • Range: 71001-71999

8. Flashloan Protocol - Prefix: FlashLender__

  • Range: 80001-80999

9. Reserve Contract - Prefix: ReserveContract__

  • Range: 90001-90999

10. Configs

  • ExpandPercentConfigHandler - Prefix: ExpandPercentConfigHandler__:
    • Range: 100001-100009
  • EthenaRateConfigHandler - Prefix: EthenaRateConfigHandler__:
    • Range: 100011-100019
  • MaxBorrowConfigHandler - Prefix: MaxBorrowConfigHandler__:
    • Range: 100021-100029
  • BufferRateConfigHandler - Prefix: BufferRateConfigHandler__:
    • Range: 100031-100039
  • RatesAuthConfigHandler - Prefix: RatesAuth__;
    • Range: 100041-100045
  • ListTokenAuthHandler - Prefix: ListTokenAuth__:
    • Range: 100051-100053
  • CollectRevenueAuth - Prefix: CollectRevenueAuth__:
    • Range: 100061-100062