Skip to main content

AtlasConstants

The AtlasConstants contract centralizes the definition of various internal constants used throughout the Atlas Protocol. By consolidating these constants, the protocol ensures consistency, maintainability, and clarity across its contracts and libraries.

Constants

Atlas Constants

Constant NameTypeValueDescription
_GAS_VALUE_DECIMALS_TO_DROPuint2561e9Represents the number of decimals to drop from gas values, measured in gwei.
_UNLOCKEDuint2560Represents an unlocked state or default value.
_BITS_FOR_INDEXuint25616Number of bits reserved for indexing in bid finding iterations.

Escrow Constants

Constant NameTypeValueDescription
_VALIDATION_GAS_LIMITuint256500,000Maximum gas limit allocated for validation processes.
_FASTLANE_GAS_BUFFERuint256125,000Buffer gas allocated for FastLane operations.

Gas Accounting Constants

Constant NameTypeValueDescription
_CALLDATA_LENGTH_PREMIUMuint25632Additional calldata length premium, calculated as double the default (16 bits).
_BASE_TRANSACTION_GAS_USEDuint25621,000Base gas used for a standard Ethereum transaction.
_SOLVER_OP_BASE_CALLDATAuint256608Calldata length for a SolverOperation excluding the data field.
_SOLVER_BASE_GAS_USEDuint2565,000Base gas charged to solvers in _handleSolverAccounting().
_BUNDLER_GAS_PENALTY_BUFFERuint256500,000Gas penalty buffer allocated for bundler-related operations.

Solver Lock Masks

Constant NameTypeValueDescription
_SOLVER_CALLED_BACK_MASKuint2561 << 161Mask to check if the solver has called back via reconcile.
_SOLVER_FULFILLED_MASKuint2561 << 162Mask to check if the solver's outstanding debt has been repaid via reconcile.

Phase Lock Mask

Constant NameTypeValueDescription
_LOCK_PHASE_MASKbytes320xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00Used to set the Lock phase without altering activeEnvironment or callConfig.

Error Threshold

Constant NameTypeValueDescription
_GRACEFUL_RETURN_THRESHOLDuint820Threshold for ValidCallsResult after which metacall will gracefully return instead of reverting.

Atlas Verification Constants

Constant NameTypeValueDescription
_FULL_BITMAPuint256_FIRST_240_BITS_TRUE_MASKRepresents a full bitmap for nonce tracking.
_NONCES_PER_BITMAPuint256240Number of nonces tracked per bitmap.
_MAX_SOLVERSuint8254Maximum number of solvers allowed (255 - 1).

Shared Constants

Constant NameTypeValueDescription
_FIRST_240_BITS_TRUE_MASKuint2560x0000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFMask to represent the first 240 bits set to true.
_FIRST_16_BITS_TRUE_MASKuint2560xFFFFMask to represent the first 16 bits set to true.
_FIRST_4_BITS_TRUE_MASKuint2560xFMask to represent the first 4 bits set to true.

Usage Notes

  • Centralized Configuration: By defining constants in a centralized contract, the protocol ensures that all components reference the same values, preventing discrepancies and enhancing maintainability.
  • Gas Optimization: Constants related to gas usage and accounting help in optimizing contract operations, ensuring efficient resource utilization.
  • Security Enhancements: Masks and thresholds are used to enforce security rules and operational constraints, safeguarding the protocol against malicious activities and unintended behaviors.