Errors

Smart Contract Errors

Atomic Transation

  1. AtomicTransaction_SlippageError

    • Description: This error is triggered if the bought amount of tokens during a swap operation is less than the expected amount, indicating that the slippage tolerance was exceeded.

    • Use Case: Typically occurs during the splitAndSwap function when the price movement is unfavorable beyond the allowed limit.

  2. AtomicTransaction_SwapError

    • Description: Indicates a generic failure during the swap operation.

    • Use Case: Although this error isn't explicitly used in the provided code, it could be a placeholder for more specific swap-related errors.

  3. AtomicTransaction_InvalidBalance

    • Description: This error occurs when the user's approved balance for the contract is insufficient to cover the specified operation, such as a deposit.

    • Use Case: Raised in the deposit function if the allowance of the underlying token is less than the amount the user intends to deposit.

  4. AtomicTransaction_InvalidParams

    • Description: Triggered when one or more input parameters for a function are invalid. This could mean that an address is zero, or an expected amount is set to zero.

    • Use Case: Encountered in the splitAndSwap function if any of the required parameters (like expectedAmount, depositAmount, sellAmount, or sellToken) are zero or improperly set.

  5. AtomicTransaction_BalancerError

    • Description: Raised when there is an issue related to the Balancer pool, such as when the sell or buy tokens are not bound to the specified pool.

    • Use Case: Occurs in the splitAndSwap function if the provided Balancer pool does not support the specified tokens.

  6. AtomicTransaction_ExpiryReached

    • Description: This error is triggered when the operation is attempted after the expiry date has passed.

    • Use Case: Used in the expiryDateCheck modifier to ensure that time-sensitive operations are not executed after the allowed period.

FlashLoans

  1. FlashLoan__InsufficientUnderlying

    • Description: This error is triggered when the flash loan operation cannot proceed due to insufficient underlying assets in the pool.

    • Use Case: Raised in the flashLoan function when the pool does not have enough assets to lend to the borrower.

  2. FlashLoan__FailedExecOps

    • Description: This error occurs when the receiver contract fails to execute the flash loan operation (i.e., the executeOperation call returns false).

    • Use Case: Raised during the execution of the flash loan after transferring assets to the receiver contract, indicating the receiver failed to fulfill the expected operations.

  3. FlashLoan__FailedRepayments

    • Description: Indicates that the borrower failed to repay the flash loan, along with any applicable premiums, back to the contract.

    • Use Case: Raised after the borrower receives the loan and fails to return the loan amount plus any premiums, preventing the contract from completing the flash loan process.

  4. FlashLoan__InvalidReceiver

    • Description: Raised when the receiver address for the flash loan is invalid (i.e., it is a zero address).

    • Use Case: Encountered in the flashLoan function if an invalid receiver address is passed as a parameter

Misc

BaseContract Errors

  1. BaseContract__SanctionedAddress

    • Description: Raised when an address attempting to interact with the contract is found on a sanctions list.

    • Use Case: Occurs during any operation protected by the onlyNotSanctioned modifier, which checks whether an address is sanctioned before allowing the operation.

  2. BaseContract__DepositCircuitBreaker

    • Description: Triggered when a deposit attempt is made while the deposit circuit breaker is activated, which halts deposits during emergency situations.

    • Use Case: Raised in the stopDeposit modifier to prevent deposits if the circuit breaker is active.

  3. BaseContract__WithdrawCircuitBreaker

    • Description: This error is triggered when a withdrawal attempt is made while the withdrawal circuit breaker is active.

    • Use Case: Occurs in the stopWithdraw modifier when withdrawal operations are halted during emergencies.

  4. BaseContract__TransferCircuitBreaker

    • Description: Triggered when a transfer attempt is made while the transfer circuit breaker is active.

    • Use Case: Raised in the stopTransfer modifier, halting transfers during emergencies.

  5. BaseContract__RebalanceCircuitBreaker

    • Description: Raised when an attempt is made to perform a rebalance while the rebalance circuit breaker is active.

    • Use Case: Raised in the stopRebalance modifier when rebalancing is halted due to an emergency.

  6. BaseContract__FlashLoanCircuitBreaker

    • Description: Triggered when a flash loan operation is attempted while the flash loan circuit breaker is active.

    • Use Case: Encountered when the stopFlashLoan modifier is used to prevent flash loan operations during emergencies.

SMART Token

  1. SmartToken__NotTokenFactory

    • Description: Raised when an unauthorized contract (i.e., not the TokenFactory) attempts to interact with the SmartToken contract.

    • Use Case: Raised in the onlyTokenFactory modifier to ensure only the TokenFactory contract can call certain functions.

  2. SmartToken__MethodNotAllowed

    • Description: Raised when an invalid or restricted method is called in a situation where it is not allowed, such as handling non-native tokens with certain operations.

    • Use Case: Encountered when restricted operations are attempted in the contract, such as draining non-native tokens.

  3. SmartToken__DepositMoreThanMax

    • Description: Raised when a deposit exceeds the allowed limit.

    • Use Case: Raised in functions handling deposits if the amount exceeds the maximum allowed for the user.

  4. SmartToken__MintMoreThanMax

    • Description: Raised when an attempt is made to mint more than the maximum allowed tokens.

    • Use Case: Raised in the mint function if the minting amount exceeds the allowed limit for the user.

  5. SmartToken__WithdrawMoreThanMax

    • Description: Raised when a withdrawal attempt exceeds the allowed limit.

    • Use Case: Occurs in the withdraw function if the amount being withdrawn is more than the allowed maximum for the user.

  6. SmartToken__RedeemMoreThanMax

    • Description: Raised when a redemption attempt exceeds the maximum limit allowed for the user.

    • Use Case: Occurs when attempting to redeem more tokens than allowed in the redeem function.

  7. SmartToken__OnlyAssetOwner

    • Description: Raised when a function is called by an address that is not the owner of the asset.

    • Use Case: Triggered by the onlyAssetOwner modifier to ensure only the token holder can perform specific actions.

  8. SmartToken__ZeroDeposit

    • Description: Raised when a deposit attempt is made with zero tokens, which is not allowed.

    • Use Case: Encountered in deposit functions if the user tries to deposit an amount of zero tokens.

  9. SmartToken__InsufficientUnderlying

    • Description: Raised when there are insufficient underlying assets in the TokenFactory contract to proceed with the requested action.

    • Use Case: Occurs when there are not enough assets to meet the user's request, often during withdrawals.

  10. SmartToken__DepositLimitHit

    • Description: Triggered when a user hits the periodic deposit limit, preventing further deposits.

    • Use Case: Encountered in functions that involve depositing tokens if the user reaches their deposit limit.

  11. SmartToken__WithdrawLimitHit

    • Description: Raised when a user hits the periodic withdrawal limit, preventing further withdrawals.

    • Use Case: Occurs in functions handling withdrawals if the user exceeds the allowed withdrawal amount.

  12. SmartToken__ExpiryDateReached

    • Description: Triggered when an operation is attempted after the expiry date has passed.

    • Use Case: Raised in functions with expiry checks when the current time exceeds the specified expiry date.

  13. SmartToken__WithdrawNativeFailed

    • Description: Raised when a native token withdrawal fails.

    • Use Case: Occurs when attempting to withdraw native tokens (e.g., ETH) and the operation fails

Token Factory

  1. TokenFactory__MethodNotAllowed

    • Description: Raised when a function is called by an unauthorized address or when the function is not permitted to be executed in the current context.

    • Use Case: Commonly encountered in functions guarded by the onlySmartTokens, onlyOrchestrator, or similar modifiers to ensure that only specific entities can invoke them.

  2. TokenFactory__InvalidDivision

    • Description: Indicates an attempt to perform an invalid division operation, such as dividing by zero or when an invalid time period is encountered.

    • Use Case: Typically raised during management fee calculations or other scenarios where division operations are critical.

  3. TokenFactory__InvalidRebalanceParams

    • Description: Triggered when the parameters provided for a rebalance operation are invalid or do not meet the expected conditions.

    • Use Case: Encountered during the execution of the rebalance function if the provided smart token prices or underlying values do not align with expectations.

  4. TokenFactory__InvalidSequenceNumber

    • Description: Raised when the sequence number provided for a rebalance operation is either out of order or has already been applied.

    • Use Case: Occurs in the executeRebalance function when the sequence number is checked against the expected next sequence number.

  5. TokenFactory__InvalidNaturalRebalance

    • Description: Indicates that a natural rebalance was attempted before the scheduled interval has passed.

    • Use Case: Raised when the executeRebalance function detects that the current timestamp is earlier than the expected time for a natural rebalance.

  6. TokenFactory__AlreadyInitialized

    • Description: Triggered when an attempt is made to initialize the contract or a component of the contract that has already been initialized.

    • Use Case: Encountered during the initializeSMART function to prevent multiple initializations of the smart tokens.

  7. TokenFactory__InvalidSignature

    • Description: Raised when the signature provided for a rebalance operation does not match any of the authorized signers.

    • Use Case: Occurs in the verifyAndDecode function when verifying the authenticity of a rebalance request.

  8. TokenFactory__InvalidSignatureLength

    • Description: Indicates that the length of the provided signature is invalid.

    • Use Case: Typically used in the context of signature verification where the length of the provided data does not match expected values.

  9. TokenFactory__InvalidManagementFees

    • Description: Raised when an invalid management fee rate is provided, typically if it exceeds allowable limits.

    • Use Case: Encountered during the setManagementFeeRate function when setting a new management fee rate.

  10. TokenFactory__SmartTokenArrayOutOfBounds

    • Description: Triggered when an attempt is made to access a smart token that does not exist in the array.

    • Use Case: Typically encountered when interacting with the smartTokenArray and accessing an invalid index.

  11. TokenFactory__NoPremiumsToDrain

    • Description: Raised when an attempt is made to drain flashloan premiums, but no premiums are available to drain.

    • Use Case: Encountered in the drainFlashloanPremiums function when there are no collected premiums to distribute

Orchestrator

  1. Orchestrator_FailedOperation

    • Description: Triggered when an operation executed by the Orchestrator contract fails. This generally occurs when a call to a destination address within an operation does not return the expected result.

    • Use Case: This error is raised during the rebalance function if one of the downstream operations fails to execute successfully.

  2. Orchestrator_Index_Out_Bounds

    • Description: Raised when an index provided as an argument to a function is outside the valid range of the array being accessed.

    • Use Case: This error is encountered when performing operations like adding, removing, or enabling/disabling an operation or balancer pool at an invalid index.

  3. Orchestrator_Wrong_Dest_Addr

    • Description: Indicates that the destination address provided to modify the status of an operation does not match the expected address for that index.

    • Use Case: This error is raised in the setOperationEnabled function when the provided destination address does not match the destination address stored at the specified index in the operations array.


Last updated