Skip to content

FluidUsdOracleAuthorization ​

Git Source

Inherits:FluidUsdOracleCore, Events

All access control: governance resolution, modifiers, transient storage session, guardian management, and token pause logic.

Functions ​

onlyGovernance ​

Validates that an address is governance (at Liquidity)

solidity
modifier onlyGovernance() ;

onlyGovernanceOrMultisig ​

Validates that an address is either governance (at Liquidity) or TEAM_MULTISIG

solidity
modifier onlyGovernanceOrMultisig() ;

onlyWithTransientOracleKey ​

Ensures a key has been registered in transient storage for this transaction.

solidity
modifier onlyWithTransientOracleKey() ;

onlyGovernanceOrMSNewConfig ​

Allows governance always. Allows multisig only if _tIsNewConfig == 1.

solidity
modifier onlyGovernanceOrMSNewConfig() ;

onlyForExistingConfig ​

Ensures a config exists for the registered key (priceMode is set).

solidity
modifier onlyForExistingConfig() ;

_checkAuth ​

Governance always; TEAM_MULTISIG only when allowMultisig_.

solidity
function _checkAuth(bool allowMultisig_) internal view;

_isTeamMultisig ​

TEAM_MULTISIG and not also governance (needed for when TEAM_MULTISIG == governance).

solidity
function _isTeamMultisig() internal view returns (bool);

_checkOnlyWithTransientOracleKey ​

Reverts if registerTransientOracleKey was not called in this tx.

solidity
function _checkOnlyWithTransientOracleKey() internal view;

_checkOnlyForExistingConfig ​

Reverts if no priceMode is set for the registered key.

solidity
function _checkOnlyForExistingConfig() internal view;

registerTransientOracleKey ​

Registers an OracleKey in transient storage for subsequent admin calls within the same transaction.

Must be called before any other per-key admin method. Calling again overwrites and resets the new-config flag. Reverts if the token has not been listed via setTokenType.

solidity
function registerTransientOracleKey(OracleKey memory key_) external onlyGovernanceOrMultisig;

Parameters

NameTypeDescription
key_OracleKeyToken, eMode, operate/collateral tuple identifying the per-key config being edited.

setGuardian ​

Sets or removes a guardian address for operate-side pause toggles.

Only governance may call. Guardians cannot change liquidate pause state.

solidity
function setGuardian(address guardian_, bool allowed_) external onlyGovernance validAddress(guardian_);

Parameters

NameTypeDescription
guardian_addressAddress to grant or revoke guardian role.
allowed_boolTrue to enable, false to disable.

setTokenType ​

Lists a token and assigns its type (PEG, STABLE, VOLATILE).

Governance may change the type of an already-listed token. Multisig may only list a token that is not yet listed (TOKEN_TYPE_NOT_SET); post-listing type changes are governance-only. Crossing the PEG type boundary reverts while any key still reads a second leg (fallback, deviation check, or CROSS_PATH): which bucket that leg lives in is type-dependent. Fetches and stores ERC20 decimals (18 for NATIVE_TOKEN_ADDRESS). Writes _tokenSources[token_].primarySrc metadata fields only.

solidity
function setTokenType(address token_, uint8 tokenType_) external onlyGovernanceOrMultisig validAddress(token_);

Parameters

NameTypeDescription
token_addressERC20 or native sentinel address to list.
tokenType_uint8One of TOKEN_TYPE_PEG, TOKEN_TYPE_STABLE, or TOKEN_TYPE_VOLATILE.

setPausedState ​

Sets per-token pause bits for pricing: operate (bit 0) and/or liquidate (bit 1).

Guardians may toggle operate pause only; governance or multisig may set any combination.

solidity
function setPausedState(address token_, bool pauseOperate_, bool pauseLiquidate_) external validAddress(token_);

Parameters

NameTypeDescription
token_addressToken whose pause state is updated.
pauseOperate_boolWhen true, sets PAUSED_OPERATE on the token metadata.
pauseLiquidate_boolWhen true, sets PAUSED_LIQUIDATE on the token metadata.

setTokenConfigGovernanceApproved ​

Sets or clears the governance-approved flag on token-level oracle sources (FLAG_GOVERNANCE_APPROVED).

Only governance may call. Used to stamp multisig-created token-level configs or revoke approval.

solidity
function setTokenConfigGovernanceApproved(address token_, bool approved_)
    external
    onlyGovernance
    validAddress(token_);

Parameters

NameTypeDescription
token_addressToken whose approval bit is updated.
approved_boolTrue to set the flag, false to clear it.

_setTokenGovernanceApproved ​

approved_ == true sets FLAG_GOVERNANCE_APPROVED; false clears it (e.g. multisig token-level source write).

solidity
function _setTokenGovernanceApproved(address token_, TokenSourceConfig storage cfg_, bool approved_) internal;

_getGovernanceAddr ​

gets the governance address at Liquidity.

solidity
function _getGovernanceAddr() internal view virtual returns (address governance_);

_getRegisteredKey ​

Loads the registered OracleKey from transient storage.

solidity
function _getRegisteredKey() internal view returns (OracleKey memory key_);

_clearRegisteredKey ​

Clears the transient admin session for the current transaction.

solidity
function _clearRegisteredKey() internal;

_getRegisteredConfig ​

Returns storage pointer to the OracleKeyConfig for the registered key.

solidity
function _getRegisteredConfig() internal view returns (OracleKeyConfig storage);

_revertIfTeamMultisigModifiesExistingConfig ​

Governance may always create or modify. TEAM_MULTISIG may only create new configs (exact slot empty) on tokens that are not yet governance-approved.

solidity
function _revertIfTeamMultisigModifiesExistingConfig(bool exists_) internal view;

_revertIfTeamMultisigModifiesExistingConfig ​

Per-key create/modify gate for setPriceMode. Same create-only rule as the bool overload, plus: TEAM_MULTISIG creating eMode≠0 is treated as modifying existing live config when that leg already has eMode 0 and the token is FLAG_GOVERNANCE_APPROVED (would shadow fallback).

solidity
function _revertIfTeamMultisigModifiesExistingConfig(
    bool exists_,
    OracleKey memory key_,
    TokenSourceConfig storage tokenCfg_
) internal view;

_registeredConfigExists ​

Checks if a configuration exists for the registered key (priceMode is set).

solidity
function _registeredConfigExists() internal view returns (bool);