OracleEventList
(Work in progress) OracleEventList Contract Interface Documentation
Overview
OracleEventList is a contract that manages a list of events an Oracle is willing to service. It allows the Oracle to publish events, confirm or cancel participation via Pari Mutuel Pool (PMP) contracts, and manage event lifecycle state.
Each OracleEventList is uniquely identified by:
the Oracle address
a static index
Events
EventAdded
Emitted when a new event is added to the OracleEventList.
event EventAdded(
uint256 event_id,
string event_name,
uint128 oracle_fee,
uint64 deadline
);event_id— unique identifier (hash) of the eventevent_name— human-readable name of the eventoracle_fee— fee required by the Oracledeadline— timestamp until which the Oracle is willing to service the event
EventConfirmed
Emitted when an Oracle confirms participation in an event via a PMP contract.
event_id— identifier of the confirmed eventpmpAddress— address of the PMP contract that initiated confirmation
Public & External Interface
addEvent
addEventAdds a new event that the Oracle is willing to service.
Access: oracle owner only
Modifiers: onlyOwnerPubkey, accept
Parameters:
event_name— human-readable event nameoracle_fee— Oracle fee for servicing the eventdeadline— timestamp until which the event is validdescribe— detailed event descriptionoutcomeNames— mapping of outcome IDs to outcome namestrustAddr— optional trusted address for the event
Behavior:
Validates that the deadline is in the future
Ensures sufficient native balance
Requires at least 2 and fewer than 20 outcomes
Computes a deterministic
event_idfrom event parametersStores event information in contract storage
Emits
EventAddedto an external address
confirmEvent
confirmEventConfirms Oracle participation in an event.
Access: PMP contract only
Modifiers: senderIs, accept
Parameters:
event_id— identifier of the eventoracle_list_hash— hash of the oracle listtoken_type— token type used by the PMP
Behavior:
Ensures sufficient native balance
Transfers received fees to the Oracle owner
Rejects the event if it does not exist
Rejects the event if:
the deadline has passed
the paid fee is lower than the Oracle fee
Approves the event via the PMP contract if all conditions are met
Emits
EventConfirmedupon successful confirmation
cancelEvent
cancelEventCancels Oracle participation in an event.
Access: PMP contract only
Modifiers: senderIs, accept
Behavior:
Ensures sufficient native balance
Decreases the confirmation counter for the event
deleteEvent(uint256 event_id)
deleteEvent(uint256 event_id)Deletes an event from the OracleEventList.
Access: oracle owner only
Modifiers: onlyOwnerPubkey, accept
Behavior:
Ensures sufficient native balance
Deletes the event if:
no active confirmations exist, or
the event deadline has passed
getVersion()
getVersion()Returns the contract version information.
Returns:
Semantic version string (e.g.
"1.0.0")Contract identifier string:
"OracleEventList"
Last updated