RiskStewardReceiver
RiskStewardReceiver
Section titled “RiskStewardReceiver”Contract that reads updates from a Risk Oracle, validates them with timelock and debounce, and either executes them locally via the configured RiskSteward or forwards them cross‑chain.
This page follows RiskStewardReceiver.sol at v2.15.0. On BNB mainnet at block 118369568, proxy 0x47856bFa74B71d24a5545c7506862B8FddE52baB used implementation 0xC00Ec4149eCfB60378152e05C5B896c08EA49e6E, matching the tagged artifact.
This is the origin receiver. It uses LayerZero V2 OApp endpoint IDs (uint32), unlike the older uint16 LayerZero V1 endpoint IDs in Omnichain Governance and the XVS bridge. Do not interchange their peer, fee, or retry APIs.
Solidity API
Section titled “Solidity API”UPDATE_EXPIRATION_TIME
Section titled “UPDATE_EXPIRATION_TIME”Period after which a proposed update becomes expired and can no longer be applied
uint256 UPDATE_EXPIRATION_TIMELAYER_ZERO_EID
Section titled “LAYER_ZERO_EID”Source chain LayerZero endpoint ID
uint32 LAYER_ZERO_EIDRISK_ORACLE
Section titled “RISK_ORACLE”The Risk Oracle contract address
contract IRiskOracle RISK_ORACLEpaused
Section titled “paused”Pause flag
bool pausedriskParameterConfigs
Section titled “riskParameterConfigs”Mapping of supported risk configurations and their validation parameters (keyed by hashed updateType)
mapping(bytes32 => struct IRiskStewardReceiver.RiskParamConfig) riskParameterConfigsupdates
Section titled “updates”Master storage of all registered updates by update ID
mapping(uint256 => struct IRiskStewardReceiver.RegisteredUpdate) updateslastProcessedUpdate
Section titled “lastProcessedUpdate”Track last processed update ID per (updateTypeKey, market)
mapping(bytes32 => mapping(address => uint256)) lastProcessedUpdatelastRegisteredUpdate
Section titled “lastRegisteredUpdate”Track the current registered update per (updateType, market) to avoid registering multiple updates
mapping(bytes32 => mapping(address => uint256)) lastRegisteredUpdatewhitelistedExecutors
Section titled “whitelistedExecutors”Mapping from executor address to whitelist status
mapping(address => bool) whitelistedExecutorsconstructor
Section titled “constructor”Disables initializers and sets the Risk Oracle and LayerZero configuration.
constructor(address riskOracle_, address endpoint_, uint32 layerZeroLzEid_) publicParameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
| riskOracle_ | address | The address of the Risk Oracle contract. |
| endpoint_ | address | The LayerZero endpoint contract used by the underlying OAppUpgradeable. |
| layerZeroLzEid_ | uint32 | The LayerZero endpoint ID (EID) for this chain. |
initialize
Section titled “initialize”Initializes the contract with the Access Control Manager and OApp owner.
function initialize(address acm_, address delegate_) externalParameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
| acm_ | address | The address of the Access Control Manager |
| delegate_ | address | The address of the OApp owner passed to __OApp_init. |
receive
Section titled “receive”Accepts native tokens (e.g., BNB) sent to this contract.
receive() external payablesweepNative
Section titled “sweepNative”Allows the owner to sweep leftover native tokens (e.g., BNB) from the contract.
function sweepNative() external📅 Events
Section titled “📅 Events”- Emits SweepNative event.
setPaused
Section titled “setPaused”Sets the pause status for processUpdate.
function setPaused(bool paused_) externalParameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
| paused_ | bool | True to pause, false to unpause |
📅 Events
Section titled “📅 Events”- Emits PauseStatusUpdated
⛔️ Access Requirements
Section titled “⛔️ Access Requirements”- Controlled by AccessControlManager
setRiskParameterConfig
Section titled “setRiskParameterConfig”Sets the risk parameter config for a given update type
function setRiskParameterConfig(string updateType, address riskSteward, uint256 debounce, uint256 timelock) externalParameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
| updateType | string | The type of update to configure |
| riskSteward | address | The address for the risk steward contract responsible for processing the update |
| debounce | uint256 | The debounce period for the update |
| timelock | uint256 | The timelock period before the update can be executed |
📅 Events
Section titled “📅 Events”- Emits RiskParameterConfigUpdated
⛔️ Access Requirements
Section titled “⛔️ Access Requirements”- Controlled by AccessControlManager
❌ Errors
Section titled “❌ Errors”- InvalidUpdateType if the update type string is empty
- Throws InvalidDebounce if the debounce is 0
- Throws InvalidTimelock if the timelock is greater than or equal to the expiration time
- Throws ZeroAddressNotAllowed if the risk steward address is zero
setConfigActive
Section titled “setConfigActive”Sets the active status of a risk parameter config
function setConfigActive(string updateType, bool active) externalParameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
| updateType | string | The type of update to configure |
| active | bool | The active status to set |
📅 Events
Section titled “📅 Events”- Emits ConfigActiveUpdated with the update type hash, update type, previous active status, and the active status
⛔️ Access Requirements
Section titled “⛔️ Access Requirements”- Controlled by AccessControlManager
❌ Errors
Section titled “❌ Errors”- Throws UnsupportedUpdateType if the update type is not supported
- Throws ConfigStatusUnchanged if the active status is already set to the desired value
setWhitelistedExecutor
Section titled “setWhitelistedExecutor”Manages the whitelist of executors that are allowed to execute timelocked registered updates.
function setWhitelistedExecutor(address executor, bool approved) externalParameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
| executor | address | The address of the executor |
| approved | bool | The whitelist status to set (true to whitelist, false to remove) |
📅 Events
Section titled “📅 Events”- Emits ExecutorStatusUpdated with the executor address, previous approval status, and approval status
⛔️ Access Requirements
Section titled “⛔️ Access Requirements”- Controlled by AccessControlManager
❌ Errors
Section titled “❌ Errors”- Throws ZeroAddressNotAllowed if the executor address is zero
- Throws ExecutorStatusUnchanged if the executor whitelist status is already set to the desired value
processUpdate
Section titled “processUpdate”Processes an update from the Risk Oracle. Validates, registers the update, and either executes immediately, registers with timelock, or forwards cross-chain.
function processUpdate(uint256 updateId) externalParameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
| updateId | uint256 | The update ID from the oracle’s perspective |
📅 Events
Section titled “📅 Events”- Emits UpdateRegistered, UpdateExecuted, or UpdateSentToDestination depending on the update type
❌ Errors
Section titled “❌ Errors”- Throws UpdateAlreadyResolved if the update was already processed
- Throws UpdateIsExpired if the update has expired
- Throws ConfigNotActive if the config is not active
- Throws UpdateTooFrequent if the debounce period has not passed
- Throws RegisteredUpdateTypeExist if there is a non-expired pending update of the same type
executeRegisteredUpdate
Section titled “executeRegisteredUpdate”Executes a registered update. Only whitelisted executors can call this function. This function can be used for updates that have completed their timelock and are ready to execute.
function executeRegisteredUpdate(uint256 updateId) externalParameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
| updateId | uint256 | The oracle update ID of the update to execute |
📅 Events
Section titled “📅 Events”- Emits UpdateExecuted with the oracle update ID
⛔️ Access Requirements
Section titled “⛔️ Access Requirements”- Only whitelisted executors can call this function
❌ Errors
Section titled “❌ Errors”- Throws NotAnExecutor if the caller is not a whitelisted executor
- Throws InvalidRegisteredUpdate if the update was never registered
- Throws UpdateAlreadyResolved if the update was already executed or rejected
- Throws UpdateIsExpired if the update has expired
- Throws ConfigNotActive if the config is not active
- Throws UpdateNotUnlocked if the unlock time has not passed
rejectUpdate
Section titled “rejectUpdate”Rejects a registered update
function rejectUpdate(uint256 updateId) externalParameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
| updateId | uint256 | The oracle update ID of the update to reject |
📅 Events
Section titled “📅 Events”- Emits UpdateRejected with the oracle update ID
⛔️ Access Requirements
Section titled “⛔️ Access Requirements”- Only whitelisted executors can call this function
❌ Errors
Section titled “❌ Errors”- Throws UpdateAlreadyResolved if the update was already executed or rejected
resendRemoteUpdate
Section titled “resendRemoteUpdate”Resends a remote update to the destination chain. This function is useful in case of bridge failures.
function resendRemoteUpdate(uint256 updateId, bytes options) external payableParameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
| updateId | uint256 | The oracle update ID to resend |
| options | bytes | LayerZero message options; if empty, default executor option is used |
📅 Events
Section titled “📅 Events”- Emits UpdateResentToDestination with the update ID, destination chain ID, update type, and market
⛔️ Access Requirements
Section titled “⛔️ Access Requirements”- Only whitelisted executors can call this function
❌ Errors
Section titled “❌ Errors”- Throws NotAnExecutor if the caller is not a whitelisted executor
- Throws InvalidUpdateToResend if the update status is not SENT_TO_DESTINATION
- Throws UpdateIsExpired if the update has expired
getExecutableUpdates
Section titled “getExecutableUpdates”Returns an array of update IDs for executable registered updates for a given update type and comptroller.
function getExecutableUpdates(string updateType, address comptroller) external view returns (uint256[] executableUpdates)Parameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
| updateType | string | The human‑readable identifier of the update type to filter by |
| comptroller | address | The address of the Comptroller (either Core Pool or Isolated Pools) that manages the markets |
Return Values
Section titled “Return Values”| Name | Type | Description |
|---|---|---|
| executableUpdates | uint256[] | Array of update IDs that are ready to be executed |
isUpdateExecutable
Section titled “isUpdateExecutable”Returns whether a registered update is ready to be executed.
function isUpdateExecutable(uint256 updateId) external view returns (bool)Parameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
| updateId | uint256 | The oracle update ID to query |
Return Values
Section titled “Return Values”| Name | Type | Description |
|---|---|---|
| [0] | bool | True if the update is pending, not expired, active, and past its timelock |
getRiskParameterConfig
Section titled “getRiskParameterConfig”Returns the risk parameter configuration for a given update type
function getRiskParameterConfig(string updateType) external view returns (struct IRiskStewardReceiver.RiskParamConfig)Parameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
| updateType | string | The human-readable identifier of the update type |
Return Values
Section titled “Return Values”| Name | Type | Description |
|---|---|---|
| [0] | struct IRiskStewardReceiver.RiskParamConfig | The risk parameter configuration |
getLastProcessedUpdate
Section titled “getLastProcessedUpdate”Returns the last processed update ID for a given update type and market
function getLastProcessedUpdate(string updateType, address market) external view returns (uint256)Parameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
| updateType | string | The human-readable identifier of the update type |
| market | address | The address of the market |
Return Values
Section titled “Return Values”| Name | Type | Description |
|---|---|---|
| [0] | uint256 | The last processed update ID |
getLastRegisteredUpdate
Section titled “getLastRegisteredUpdate”Returns the last registered update ID for a given update type and market
function getLastRegisteredUpdate(string updateType, address market) external view returns (uint256)Parameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
| updateType | string | The human-readable identifier of the update type |
| market | address | The address of the market |
Return Values
Section titled “Return Values”| Name | Type | Description |
|---|---|---|
| [0] | uint256 | The last registered update ID |
Quotes the gas fee needed to pay for the full omnichain transaction in native gas or ZRO token.
function quote(struct RiskParameterUpdate update, bytes options, bool payInLzToken) public view returns (struct MessagingFee fee)Parameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
| update | struct RiskParameterUpdate | The risk parameter update payload to be sent |
| options | bytes | Message execution options (e.g., for sending gas to the destination) |
| payInLzToken | bool | Whether to return the fee in ZRO token instead of native gas |
Return Values
Section titled “Return Values”| Name | Type | Description |
|---|---|---|
| fee | struct MessagingFee | A MessagingFee struct containing the calculated gas fee |
lzSend
Section titled “lzSend”Sends a RiskParameterUpdate to a destination chain via LayerZero.
function lzSend(uint32 dstEid, struct RiskParameterUpdate update, bytes options, struct MessagingFee fee, address refundAddress) public payableParameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
| dstEid | uint32 | Destination chain endpoint ID |
| update | struct RiskParameterUpdate | The risk parameter update payload to send |
| options | bytes | LayerZero message options; if empty, a default executor option is used |
| fee | struct MessagingFee | Messaging fee structure returned by quote |
| refundAddress | address | Address to receive any surplus fee refunds |
❌ Errors
Section titled “❌ Errors”- InvalidLzSendCaller if called by any address other than this contract
transferOwnership
Section titled “transferOwnership”Starts the two-step ownership transfer used jointly by AccessControlledV8 and the LayerZero OApp base. The pending owner must call acceptOwnership.
function transferOwnership(address newOwner) publicrenounceOwnership
Section titled “renounceOwnership”Disables renounceOwnership function
function renounceOwnership() public pure❌ Errors
Section titled “❌ Errors”- Throws RenounceOwnershipNotAllowed