Errors
Smart Contract Errors
Atomic Transation
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.
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.
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.
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 (likeexpectedAmount
,depositAmount
,sellAmount
, orsellToken
) are zero or improperly set.
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.
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
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.
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.
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.
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
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.
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.
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.
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.
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.
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
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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
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.
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.
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