FluidUsdOracleAuthorization ​
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)
modifier onlyGovernance() ;onlyGovernanceOrMultisig ​
Validates that an address is either governance (at Liquidity) or TEAM_MULTISIG
modifier onlyGovernanceOrMultisig() ;onlyWithTransientOracleKey ​
Ensures a key has been registered in transient storage for this transaction.
modifier onlyWithTransientOracleKey() ;onlyGovernanceOrMSNewConfig ​
Allows governance always. Allows multisig only if _tIsNewConfig == 1.
modifier onlyGovernanceOrMSNewConfig() ;onlyForExistingConfig ​
Ensures a config exists for the registered key (priceMode is set).
modifier onlyForExistingConfig() ;_checkAuth ​
Governance always; TEAM_MULTISIG only when allowMultisig_.
function _checkAuth(bool allowMultisig_) internal view;_isTeamMultisig ​
TEAM_MULTISIG and not also governance (needed for when TEAM_MULTISIG == governance).
function _isTeamMultisig() internal view returns (bool);_checkOnlyWithTransientOracleKey ​
Reverts if registerTransientOracleKey was not called in this tx.
function _checkOnlyWithTransientOracleKey() internal view;_checkOnlyForExistingConfig ​
Reverts if no priceMode is set for the registered key.
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.
function registerTransientOracleKey(OracleKey memory key_) external onlyGovernanceOrMultisig;Parameters
| Name | Type | Description |
|---|---|---|
key_ | OracleKey | Token, 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.
function setGuardian(address guardian_, bool allowed_) external onlyGovernance validAddress(guardian_);Parameters
| Name | Type | Description |
|---|---|---|
guardian_ | address | Address to grant or revoke guardian role. |
allowed_ | bool | True 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.
function setTokenType(address token_, uint8 tokenType_) external onlyGovernanceOrMultisig validAddress(token_);Parameters
| Name | Type | Description |
|---|---|---|
token_ | address | ERC20 or native sentinel address to list. |
tokenType_ | uint8 | One 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.
function setPausedState(address token_, bool pauseOperate_, bool pauseLiquidate_) external validAddress(token_);Parameters
| Name | Type | Description |
|---|---|---|
token_ | address | Token whose pause state is updated. |
pauseOperate_ | bool | When true, sets PAUSED_OPERATE on the token metadata. |
pauseLiquidate_ | bool | When 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.
function setTokenConfigGovernanceApproved(address token_, bool approved_)
external
onlyGovernance
validAddress(token_);Parameters
| Name | Type | Description |
|---|---|---|
token_ | address | Token whose approval bit is updated. |
approved_ | bool | True 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).
function _setTokenGovernanceApproved(address token_, TokenSourceConfig storage cfg_, bool approved_) internal;_getGovernanceAddr ​
gets the governance address at Liquidity.
function _getGovernanceAddr() internal view virtual returns (address governance_);_getRegisteredKey ​
Loads the registered OracleKey from transient storage.
function _getRegisteredKey() internal view returns (OracleKey memory key_);_clearRegisteredKey ​
Clears the transient admin session for the current transaction.
function _clearRegisteredKey() internal;_getRegisteredConfig ​
Returns storage pointer to the OracleKeyConfig for the registered key.
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.
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).
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).
function _registeredConfigExists() internal view returns (bool);