Variables ​
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.
mapping(bytes32 => OracleKeyConfig) internal _configsconfigsMap ​
maps token => array of all configured eMode/isOperate/isCollateral combinations for that token. Used by getConfiguredTokenOracles to enumerate all configs.
mapping(address => ConfigMap[]) public configsMap_guardians ​
guardian address => 1 if active, 0 if not. Guardians can pause tokens for isOperate calls.
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:
_configs[key]for key-specific config._tokenSources[token]slot 0 for metadata +primarySrcleg 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 onprimarySrc(after leg-1 fields, before__placeholder1/ future slot 0 expansion).primarySrcuses storage slots 0-2;altSrcuses slots 3-5.sourceType2andsourceType3stay 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.
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).
mapping(address => TokenSourceConfig) internal _additionalTokenSources