Skip to content

Variables ​

Git Source

Inherits:Constants, Structs, TransientVariables, Immutables

State Variables ​

_configs ​

Per-key configs: maps keccak256(abi.encode(token, eMode, isOperate, isCollateral)) => OracleKeyConfig. Each key config is 1 slot, storing priceMode + caps + deviation + fallback flag. This is one of the two hot-path SLOADs for the common getPrice() flow.

solidity
mapping(bytes32 => OracleKeyConfig) internal _configs

configsMap ​

maps token => array of all configured eMode/isOperate/isCollateral combinations for that token. Used by getConfiguredTokenOracles to enumerate all configs.

solidity
mapping(address => ConfigMap[]) public configsMap

_guardians ​

guardian address => 1 if active, 0 if not. Guardians can pause tokens for isOperate calls.

solidity
mapping(address => uint256) internal _guardians

_tokenSources ​

Main per-token source configuration + metadata. This mapping is the second hot-path SLOAD for the common getPrice() flow: _tokenSources[token] storage slot 0 (primarySrc word 0) packs metadata with leg-1 source fields. The layout is intentionally optimized so common reads resolve in 2 SLOADs total:

  1. _configs[key] for key-specific config.
  2. _tokenSources[token] slot 0 for metadata + primarySrc leg 1 (source1, sourceType1-3, …). Without packing metadata into slot 0, token reads would need an extra SLOAD on every price lookup just to fetch pause state / token type / decimals / flags. Metadata lives on primarySrc (after leg-1 fields, before __placeholder1 / future slot 0 expansion). primarySrc uses storage slots 0-2; altSrc uses slots 3-5. sourceType2 and sourceType3 stay in slot 0 so the read path can branch without loading slots 1 or 2. What this mapping stores depends on token type:
  • VOLATILE/STABLE: market price sources in the primary leg fields (the only price type for these tokens), keeping those tokens on the 2-SLOAD path.
  • PEG: peg price sources in _tokenSources, while market price sources for PEG tokens are stored separately in _additionalTokenSources. Peg is stored as primary because it is the more common lookup, so PEG tokens also stay on the 2-SLOAD path for their primary price reads.
solidity
mapping(address => TokenSourceConfig) internal _tokenSources

_additionalTokenSources ​

Additional per-token source configuration for secondary price types. Reuses TokenSourceConfig, but only primary leg fields / altSrc are populated here. Metadata bytes remain zero; listing metadata lives in _tokenSources so that hot-path reads do not need to touch this mapping unless the requested price type is the uncommon secondary one.

  • PEG tokens: stores market price sources in the primary leg fields (secondary for PEG tokens). Reading this path costs an extra SLOAD versus the common primary read.
  • VOLATILE/STABLE: unused (these tokens only have market price in _tokenSources).
solidity
mapping(address => TokenSourceConfig) internal _additionalTokenSources