Constants
Last updated
Last updated
uint256 constant WORD_SIZE = 32;
uint256 constant SELECTOR_SIZE = 4;
uint256 constant MINIMUM_CALLDATA_LENGTH = WORD_SIZE + SELECTOR_SIZE;
uint256 constant CALLDATA_OFFSET = MINIMUM_CALLDATA_LENGTH;
uint256 constant ERC20_SPENDER_OFFSET = 36;
uint256 constant ADDRESS_SIZE_BITS = 160;
uint256 constant BEFORE_HOOK_MASK = 1;
uint256 constant AFTER_HOOK_MASK = 2;
uint256 constant HOOKS_FLAG_MASK = 0x80;
uint256 constant CONFIGURABLE_HOOKS_LENGTH_MASK = 0x7F;
uint256 constant MASK_8_BIT = 0xff;
uint256 constant MASK_16_BIT = 0xffff;
uint256 constant RESULTS_INDEX_OFFSET = 24;
uint256 constant COPY_WORD_OFFSET = 16;
uint256 constant EXTRACT_OFFSET_SIZE_BITS = 16;
uint256 constant EXTRACTION_OFFSET_SHIFT_BITS = 240;
Maximum number of extraction offsets(16) + 1
uint256 constant MAX_EXTRACT_OFFSETS_EXCLUSIVE = 17;
uint16 constant NO_CALLBACK_DATA = type(uint16).max;
uint256 constant SELECTOR_OFFSET = 48;
uint256 constant CALLBACK_DATA_OFFSET = 160;
uint256 constant ONE_IN_BPS = 1e4;
uint256 constant MAX_TVL_FEE = 2000;
uint256 constant MAX_PERFORMANCE_FEE = ONE_IN_BPS;
uint256 constant SECONDS_PER_YEAR = 365 days;
uint256 constant MAX_DISPUTE_PERIOD = 30 days;
Precision for unit price calculations (18 decimals)
uint256 constant UNIT_PRICE_PRECISION = 1e18;
One minute in seconds
uint256 constant ONE_MINUTE = 1 minutes;
One day in seconds
uint256 constant ONE_DAY = 1 days;
Minimum deposit multiplier 50%
uint256 constant MIN_DEPOSIT_MULTIPLIER = 5000;
Minimum redeem multiplier 50%
uint256 constant MIN_REDEEM_MULTIPLIER = 5000;
Deposit/Redeem flag in RequestType enum
uint256 constant DEPOSIT_REDEEM_FLAG = 1;
Auto/Fixed price flag in RequestType enum
uint256 constant AUTO_PRICE_FIXED_PRICE_FLAG = 2;
One unit with 18 decimals
uint256 constant ONE_UNIT = 1e18;
Maximum seconds between request deadline and current timestamp
uint256 constant MAX_SECONDS_TO_DEADLINE = 365 days;
Upper bound for depositRefundTimeout to prevent indefinite user lockout
uint256 constant MAX_DEPOSIT_REFUND_TIMEOUT = 30 days;
Whitelist flag in AddressToUintMap
uint8 constant IS_WHITELISTED_FLAG = 1;