RiskOracle
Risk Oracle
Section titled “Risk Oracle”Contract for managing and publishing risk parameter updates for Risk-Steward Updates
This API is pinned to RiskOracle.sol at v2.15.0. On BNB mainnet at block 118369568, proxy 0x0E3E51958b0Daa8C57c949675975CBEDd7b5a1a1 used implementation 0x34045517284cB1Ac2806Fe3298a39886DA29De48, matching the tagged artifact.
The proxy surface also includes inherited two-step ownership, AccessControlManager, and upgrade selectors. Publishing authorization is determined by authorizedSenders and active update types; ABI presence alone does not authorize a caller.
Solidity API
Section titled “Solidity API”updateCounter
Section titled “updateCounter”Counter to keep track of the total number of updates
uint256 updateCounterallUpdateTypes
Section titled “allUpdateTypes”Array to store all update types
string[] allUpdateTypesactiveUpdateTypes
Section titled “activeUpdateTypes”Whitelist of valid update type identifiers, keyed by updateType hash
mapping(bytes32 => bool) activeUpdateTypesupdatesById
Section titled “updatesById”Mapping from unique update ID to the update details
mapping(uint256 => struct RiskParameterUpdate) updatesByIdauthorizedSenders
Section titled “authorizedSenders”Authorized accounts capable of proposing updates
mapping(address => bool) authorizedSenderslatestUpdateIdByMarketAndType
Section titled “latestUpdateIdByMarketAndType”Mapping to store the latest update ID for each combination of update type key and market
mapping(bytes32 => mapping(address => uint256)) latestUpdateIdByMarketAndTypeconstructor
Section titled “constructor”Disables initializers
constructor() publicinitialize
Section titled “initialize”Initializes the contract with access control manager
function initialize(address accessControlManager_) externalParameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
| accessControlManager_ | address | Address of the access control manager |
❌ Errors
Section titled “❌ Errors”- Reverts with “invalid acess control manager address” if accessControlManager_ is zero address
addAuthorizedSender
Section titled “addAuthorizedSender”Adds a new sender to the list of addresses authorized to perform updates
function addAuthorizedSender(address sender) externalParameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
| sender | address | Address to be authorized |
📅 Events
Section titled “📅 Events”- Emits AuthorizedSenderAdded when sender is successfully added
⛔️ Access Requirements
Section titled “⛔️ Access Requirements”- Controlled by AccessControlManager
❌ Errors
Section titled “❌ Errors”- Throws ZeroAddressNotAllowed if sender is zero address
- Throws SenderAlreadyAuthorized if sender is already authorized
- Throws Unauthorized if caller is not allowed by AccessControlManager
removeAuthorizedSender
Section titled “removeAuthorizedSender”Removes an address from the list of authorized senders
function removeAuthorizedSender(address sender) externalParameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
| sender | address | Address to be unauthorized |
📅 Events
Section titled “📅 Events”- Emits AuthorizedSenderRemoved when sender is successfully removed
⛔️ Access Requirements
Section titled “⛔️ Access Requirements”- Controlled by AccessControlManager
❌ Errors
Section titled “❌ Errors”- Throws SenderNotAuthorized if sender is not currently authorized
- Throws Unauthorized if caller is not allowed by AccessControlManager
addUpdateType
Section titled “addUpdateType”Adds a new type of update to the list of authorized update types
function addUpdateType(string newUpdateType) externalParameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
| newUpdateType | string | New type of update to allow |
📅 Events
Section titled “📅 Events”- Emits UpdateTypeAdded when update type is successfully added
⛔️ Access Requirements
Section titled “⛔️ Access Requirements”- Controlled by AccessControlManager
❌ Errors
Section titled “❌ Errors”- Throws InvalidUpdateTypeString if update type string is empty or exceeds 64 characters
- Throws UpdateTypeAlreadyExists if update type already exists
- Throws Unauthorized if caller is not allowed by AccessControlManager
setUpdateTypeActive
Section titled “setUpdateTypeActive”Sets the active status of an existing update type
function setUpdateTypeActive(string updateType, bool active) externalParameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
| updateType | string | The update type to set active status for |
| active | bool | True to activate, false to deactivate |
📅 Events
Section titled “📅 Events”- Emits UpdateTypeActiveStatusChanged when status is successfully changed
⛔️ Access Requirements
Section titled “⛔️ Access Requirements”- Controlled by AccessControlManager
❌ Errors
Section titled “❌ Errors”- Throws UpdateTypeNotFound if update type doesn’t exist
- Throws UpdateTypeStatusUnchanged if status is already set to the desired value
- Throws Unauthorized if caller is not allowed by AccessControlManager
publishRiskParameterUpdate
Section titled “publishRiskParameterUpdate”Publishes a new risk parameter update
function publishRiskParameterUpdate(string referenceId, bytes newValue, string updateType, address market, uint96 poolId, uint32 dstEid, bytes additionalData) externalParameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
| referenceId | string | An external reference ID associated with the update |
| newValue | bytes | The new value of the risk parameter being updated |
| updateType | string | Type of update performed, must be previously authorized |
| market | address | Address for market of the parameter update |
| poolId | uint96 | Pool identifier for eMode-style collateral configuration (0 for regular markets) |
| dstEid | uint32 | Destination endpoint ID for cross-chain routing |
| additionalData | bytes | Additional data for the update |
📅 Events
Section titled “📅 Events”- Emits UpdatePublished when update is successfully published
❌ Errors
Section titled “❌ Errors”- Throws SenderNotAuthorized if caller is not an authorized sender
- Throws UpdateTypeNotActive if update type is not active
- Throws ZeroAddressNotAllowed if market is zero address
publishBulkRiskParameterUpdates
Section titled “publishBulkRiskParameterUpdates”Publishes multiple risk parameter updates in a single transaction
function publishBulkRiskParameterUpdates(string[] referenceIds, bytes[] newValues, string[] updateTypes, address[] markets, uint96[] poolIds, uint32[] dstEid, bytes[] additionalData) externalParameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
| referenceIds | string[] | Array of external reference IDs |
| newValues | bytes[] | Array of new values for each update |
| updateTypes | string[] | Array of types for each update, all must be authorized |
| markets | address[] | Array of addresses for markets of the parameter updates |
| poolIds | uint96[] | Array of pool identifiers for eMode-style collateral configuration (0 for regular markets) |
| dstEid | uint32[] | Array of destination endpoint IDs for cross-chain routing |
| additionalData | bytes[] | Array of additional data for the updates |
📅 Events
Section titled “📅 Events”- Emits UpdatePublished for each successfully published update
❌ Errors
Section titled “❌ Errors”- Throws SenderNotAuthorized if caller is not an authorized sender
- Throws ArrayLengthMismatch if the array lengths do not match or if no updates are provided
- Throws UpdateTypeNotActive if any update type is not active
- Throws ZeroAddressNotAllowed if any market is zero address
getLatestUpdateByTypeAndMarket
Section titled “getLatestUpdateByTypeAndMarket”Fetches the most recent update for a specific parameter in a specific market
function getLatestUpdateByTypeAndMarket(string updateType, address market) external view returns (struct RiskParameterUpdate)Parameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
| updateType | string | The identifier for the parameter |
| market | address | The market identifier |
Return Values
Section titled “Return Values”| Name | Type | Description |
|---|---|---|
| [0] | struct RiskParameterUpdate | The most recent RiskParameterUpdate for the specified parameter and market |
❌ Errors
Section titled “❌ Errors”- Throws NoUpdateFound if no update exists for the specified parameter and market
getUpdateById
Section titled “getUpdateById”Fetches the update for a provided updateId
function getUpdateById(uint256 updateId) external view returns (struct RiskParameterUpdate)Parameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
| updateId | uint256 | Update ID |
Return Values
Section titled “Return Values”| Name | Type | Description |
|---|---|---|
| [0] | struct RiskParameterUpdate | The RiskParameterUpdate for the specified id |
❌ Errors
Section titled “❌ Errors”- Throws InvalidUpdateId if updateId is 0 or greater than updateCounter
allUpdateTypesLength
Section titled “allUpdateTypesLength”Returns the total number of update types in the allUpdateTypes array
function allUpdateTypesLength() external view returns (uint256)Return Values
Section titled “Return Values”| Name | Type | Description |
|---|---|---|
| [0] | uint256 | The length of the allUpdateTypes array |
getLatestUpdateIdByTypeAndMarket
Section titled “getLatestUpdateIdByTypeAndMarket”Gets the latest update ID for a specific market and update type (string) combination
function getLatestUpdateIdByTypeAndMarket(string updateType, address market) external view returns (uint256)Parameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
| updateType | string | The update type string |
| market | address | The market address |
Return Values
Section titled “Return Values”| Name | Type | Description |
|---|---|---|
| [0] | uint256 | The latest update ID for the given market and update type, or 0 if none exists |
getActiveUpdateTypes
Section titled “getActiveUpdateTypes”Checks if a given update type is currently active.
function getActiveUpdateTypes(string updateType) external view returns (bool)Parameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
| updateType | string | The update type string to check |
Return Values
Section titled “Return Values”| Name | Type | Description |
|---|---|---|
| [0] | bool | True if the update type is active, false otherwise |
getAllUpdateTypes
Section titled “getAllUpdateTypes”Returns all update types in the allUpdateTypes array
function getAllUpdateTypes() external view returns (string[])Return Values
Section titled “Return Values”| Name | Type | Description |
|---|---|---|
| [0] | string[] | An array of all update type strings |
renounceOwnership
Section titled “renounceOwnership”Disables renounceOwnership function
function renounceOwnership() public pure❌ Errors
Section titled “❌ Errors”- Throws RenounceOwnershipNotAllowed