IOracleV1
Alluvial Finance Inc.
Oracle Interface (v1)
This interface exposes methods to handle the input from the allowed oracle members.Highly inspired by Lido's implementation.
Methods
addMember
Adds new address as oracle member, giving the ability to push cl reports.
Only callable by the adminstratorModifying the quorum clears all the reporting data
Parameters
_newOracleMember
address
Address of the new member
_newQuorum
uint256
New quorum value
getGlobalReportStatus
Retrieve member report status
Returns
_0
uint256
The raw report status value
getLastReportedEpochId
Retrieve the last reported epoch id
The Oracle contracts expects reports on an epoch id >= that the returned value
Returns
_0
uint256
The last reported epoch id
getMemberReportStatus
Retrieve member report status
Parameters
_oracleMember
address
Address of member to check
Returns
_0
bool
True if member has reported
getOracleMembers
Retrieve the list of oracle members
Returns
_0
address[]
The oracle members
getQuorum
Retrieve the current quorum
Returns
_0
uint256
The current quorum
getReportVariantDetails
Retrieve the details of a report variant
Parameters
_idx
uint256
The index of the report variant
Returns
_0
ReportsVariants.ReportVariantDetails
The report variant details
getReportVariantsCount
Retrieve report variants count
Returns
_0
uint256
The count of report variants
getRiver
Retrieve River address
Returns
_0
address
The address of River
initOracleV1
Initializes the oracle
Parameters
_river
address
Address of the River contract, able to receive oracle input data after quorum is met
_administratorAddress
address
Address able to call administrative methods
_epochsPerFrame
uint64
CL spec parameter. Number of epochs in a frame.
_slotsPerEpoch
uint64
CL spec parameter. Number of slots in one epoch.
_secondsPerSlot
uint64
CL spec parameter. Number of seconds between slots.
_genesisTime
uint64
CL spec parameter. Timestamp of the genesis slot.
_annualAprUpperBound
uint256
CL bound parameter. Maximum apr allowed for balance increase. Delta between updates is extrapolated on a year time frame.
_relativeLowerBound
uint256
CL bound parameter. Maximum relative balance decrease.
initOracleV1_1
Initializes the oracle
isMember
Returns true if address is member
Performs a naive search, do not call this on-chain, used as an off-chain helper
Parameters
_memberAddress
address
Address of the member
Returns
_0
bool
True if address is a member
removeMember
Removes an address from the oracle members.
Only callable by the adminstratorModifying the quorum clears all the reporting dataRemaining members that have already voted should vote again for the same frame.
Parameters
_oracleMember
address
Address to remove
_newQuorum
uint256
New quorum value
reportConsensusLayerData
Parameters
_report
IOracleManagerV1.ConsensusLayerReport
undefined
setMember
Changes the address of an oracle member
Only callable by the adminitrator or the member itselfCannot use an address already in use
Parameters
_oracleMember
address
Address to change
_newAddress
address
New address for the member
setQuorum
Edits the quorum required to forward cl data to River
Modifying the quorum clears all the reporting data
Parameters
_newQuorum
uint256
New quorum parameter
Events
AddMember
A member has been added to the oracle member list
Parameters
member indexed
address
The address of the member
ClearedReporting
Cleared reporting data
RemoveMember
A member has been removed from the oracle member list
Parameters
member indexed
address
The address of the member
ReportedConsensusLayerData
An oracle member performed a report
Parameters
member indexed
address
The oracle member
variant indexed
bytes32
The variant of the report
report
IOracleManagerV1.ConsensusLayerReport
The raw report structure
voteCount
uint256
The vote count
quorum
uint256
undefined
SetBounds
The report bounds have been changed
Parameters
annualAprUpperBound
uint256
The maximum allowed apr. 10% means increases in balance extrapolated to a year should not exceed 10%.
relativeLowerBound
uint256
The maximum allowed balance decrease as a relative % of the total balance
SetLastReportedEpoch
The last reported epoch has changed
Parameters
lastReportedEpoch
uint256
undefined
SetMember
A member address has been edited
Parameters
oldAddress indexed
address
The previous member address
newAddress indexed
address
The new member address
SetQuorum
The storage quorum value has been changed
Parameters
newQuorum
uint256
The new quorum value
SetRiver
The storage river address value has been changed
Parameters
_river
address
The new river address
SetSpec
The consensus layer spec has been changed
Parameters
epochsPerFrame
uint64
The number of epochs inside a frame (225 = 24 hours)
slotsPerEpoch
uint64
The number of slots inside an epoch (32 on ethereum mainnet)
secondsPerSlot
uint64
The time between two slots (12 seconds on ethereum mainnet)
genesisTime
uint64
The timestamp of block #0
Errors
AddressAlreadyInUse
The address is already in use by an oracle member
Parameters
newAddress
address
The address already in use
AlreadyReported
The member already reported on the given epoch id
Parameters
epochId
uint256
The epoch id provided as input
member
address
The oracle member
EpochTooOld
The provided epoch is too old compared to the expected epoch id
Parameters
providedEpochId
uint256
The epoch id provided as input
minExpectedEpochId
uint256
The minimum epoch id expected
InvalidEpoch
Thrown when the reported epoch is invalid
Parameters
epoch
uint256
The invalid epoch
ReportIndexOutOfBounds
Thrown when the report indexs fetched is out of bounds
Parameters
index
uint256
Requested index
length
uint256
Size of the variant array
Last updated