ConstantVariables ​
State Variables ​
GOVERNANCE_SLOT ​
Storage slot with the admin of the contract. Logic from "proxy.sol". This is the keccak-256 hash of "eip1967.proxy.admin" subtracted by 1, and is validated in the constructor.
bytes32 internal constant GOVERNANCE_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103EXCHANGE_PRICES_PRECISION ​
uint256 internal constant EXCHANGE_PRICES_PRECISION = 1e12NATIVE_TOKEN_ADDRESS ​
address that is mapped to the chain native token
address internal constant NATIVE_TOKEN_ADDRESS = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeENATIVE_TOKEN_DECIMALS ​
decimals for native token
uint8 internal constant NATIVE_TOKEN_DECIMALS = 18MIN_TOKEN_DECIMALS ​
Minimum token decimals for any token that can be listed at Liquidity (inclusive)
uint8 internal constant MIN_TOKEN_DECIMALS = 6MAX_TOKEN_DECIMALS ​
Maximum token decimals for any token that can be listed at Liquidity (inclusive)
uint8 internal constant MAX_TOKEN_DECIMALS = 18SECONDS_PER_YEAR ​
Ignoring leap years
uint256 internal constant SECONDS_PER_YEAR = 365 daysMAX_TOKEN_AMOUNT_CAP ​
limit any total amount to be half of type(uint128).max (~3.4e38) at type(int128).max (~1.7e38) as safety measure for any potential overflows / unexpected outcomes. This is checked for total borrow / supply.
uint256 internal constant MAX_TOKEN_AMOUNT_CAP = uint256(uint128(type(int128).max))MAX_INPUT_AMOUNT_EXCESS ​
limit for triggering a revert if sent along excess input amount diff is bigger than this percentage (in 1e2)
uint256 internal constant MAX_INPUT_AMOUNT_EXCESS = 100SKIP_TRANSFERS ​
if this bytes32 is set in the calldata, then token transfers are skipped as long as Liquidity layer is on the winning side.
bytes32 internal constant SKIP_TRANSFERS = keccak256(bytes("SKIP_TRANSFERS"))NET_TRANSFERS ​
if this bytes32 is set in the calldata, then token transfers are only done for net input - output.
bytes32 internal constant NET_TRANSFERS = keccak256(bytes("NET_TRANSFERS"))SKIP_TRANSFER_OUT_BELOW_VALUE_SIGNAL ​
int256 internal constant SKIP_TRANSFER_OUT_BELOW_VALUE_SIGNAL = -1FORCE_STORAGE_WRITE_AFTER_TIME ​
time after which a write to storage of exchangePricesAndConfig will happen always.
uint256 internal constant FORCE_STORAGE_WRITE_AFTER_TIME = 1 daysTOTAL_DECAY_CHECKPOINTS ​
target duration for new decays on deposit amounts that push the withdrawal limit up. effective duration depends on existing decay amount ratio to new decay amount.
uint256 internal constant TOTAL_DECAY_CHECKPOINTS = 1e3MIN_DECAY_DURATION_CHECKPOINTS ​
uint256 internal constant MIN_DECAY_DURATION_CHECKPOINTS = 80DECAY_CHECKPOINT_DURATION_SCALEDX10 ​
uint256 internal constant DECAY_CHECKPOINT_DURATION_SCALEDX10 = 36MAX_NEW_VS_EXISTING_TOTAL_AMOUNT_RATIO_DEPOSIT_BORROW ​
when a new operate amount is > 10_000 * existing total amount AND the amount is bigger than 2 ** 80 -> revert. extra input validation safety check.
uint256 internal constant MAX_NEW_VS_EXISTING_TOTAL_AMOUNT_RATIO_DEPOSIT_BORROW = 10_000MAX_NEW_VS_EXISTING_TOTAL_AMOUNT_RATIO_WITHDRAW_PAYBACK ​
uint256 internal constant MAX_NEW_VS_EXISTING_TOTAL_AMOUNT_RATIO_WITHDRAW_PAYBACK = 2MAX_NEW_AMOUNT_WHEN_RATIO_CHECK ​
uint256 internal constant MAX_NEW_AMOUNT_WHEN_RATIO_CHECK = 2 ** 80DECAY_COEFFICIENT_SIZE ​
constants used for BigMath conversion from and to storage
uint256 internal constant DECAY_COEFFICIENT_SIZE = 18SMALL_COEFFICIENT_SIZE ​
uint256 internal constant SMALL_COEFFICIENT_SIZE = 10DEFAULT_COEFFICIENT_SIZE ​
uint256 internal constant DEFAULT_COEFFICIENT_SIZE = 56DEFAULT_EXPONENT_SIZE ​
uint256 internal constant DEFAULT_EXPONENT_SIZE = 8DEFAULT_EXPONENT_MASK ​
uint256 internal constant DEFAULT_EXPONENT_MASK = 0xFFFOUR_DECIMALS ​
constants to increase readability for using bit masks
uint256 internal constant FOUR_DECIMALS = 1e4TWELVE_DECIMALS ​
uint256 internal constant TWELVE_DECIMALS = 1e12X8 ​
uint256 internal constant X8 = 0xffX10 ​
uint256 internal constant X10 = 0x3ffX14 ​
uint256 internal constant X14 = 0x3fffX15 ​
uint256 internal constant X15 = 0x7fffX16 ​
uint256 internal constant X16 = 0xffffX18 ​
uint256 internal constant X18 = 0x3ffffX24 ​
uint256 internal constant X24 = 0xffffffX26 ​
uint256 internal constant X26 = 0x3ffffffX33 ​
uint256 internal constant X33 = 0x1ffffffffX64 ​
uint256 internal constant X64 = 0xffffffffffffffffDEXV2_IDENTIFIER ​
bytes32 internal constant DEXV2_IDENTIFIER = keccak256(bytes("DEXV2"))
