OracleAdapter.sol

General Overview

The OracleAdapter.sol acts as an intermediary between different contract components. It can set contract addresses, manage access control roles, and handle interactions concerning validator exits and dissolutions.

The contract is granted special permissions to interact with PirexEth for initiating voluntary exits of validators or managing their dissolution. A key feature is the ORACLE_ROLE, which authorizes updates to the validator's state upon dissolution.

Technical Overview

Inherits: IOracleAdapter, AccessControlDefaultAdminRules

State Variables

pirexEth

IPirexEth public pirexEth;

rewardRecipient

IRewardRecipient public rewardRecipient;

ORACLE_ROLE

bytes32 public constant ORACLE_ROLE = keccak256("ORACLE_ROLE");

GOVERNANCE_ROLE

bytes32 public constant GOVERNANCE_ROLE = keccak256("GOVERNANCE_ROLE");

Functions

constructor

constructor(uint48 _initialDelay) AccessControlDefaultAdminRules(_initialDelay, msg.sender);

Parameters

NameTypeDescription
_initialDelayuint48Delay required to schedule the acceptance

setContract

Set a contract address

function setContract(DataTypes.Contract c, address contractAddress) external onlyRole(GOVERNANCE_ROLE);

Parameters

NameTypeDescription
cDataTypes.ContractContract
contractAddressaddressContract address

requestVoluntaryExit

Send the request for voluntary exit

function requestVoluntaryExit(bytes calldata _pubKey) external override;

Parameters

NameTypeDescription
_pubKeybytesPublic key

dissolveValidator

Dissolve validator

function dissolveValidator(bytes calldata _pubKey, uint256 _amount) external onlyRole(ORACLE_ROLE);

Parameters

NameTypeDescription
_pubKeybytesPublic key
_amountuint256ETH amount

Events

SetContract

event SetContract(DataTypes.Contract indexed c, address contractAddress);

RequestValidatorExit

event RequestValidatorExit(bytes pubKey);

SetPirexEth

event SetPirexEth(address _pirexEth);