Oracle
(Work in progress) Oracle Contract Interface Documentation
Overview
Oracle is a core contract responsible for managing Oracle events and deploying OracleEventList contracts.
It provides authorization via an oracle public key, supports fee withdrawal, event list deployment, and helper utilities for proposal data encoding.
Events
OracleEventListDeployed
Emitted when a new OracleEventList contract is deployed.
event OracleEventListDeployed(address eventListAddress, uint128 index);eventListAddress— address of the deployed OracleEventListindex— index identifier of the event list
EventPublished
Emitted when an event is published by the Oracle.
event_id— unique identifier of the eventevent_name— human-readable event name
Public & External Interface
deployEventList
Deploys a new OracleEventList with a specified index.
Access: oracle owner only
Modifiers: onlyOwnerPubkey, accept
Parameters:
index— index identifier of the new OracleEventList
Behavior:
Ensures the contract has sufficient native balance
Deploys a new
OracleEventListfor the given indexEmits
OracleEventListDeployedwith the deployed address and index
withdrawFees
Withdraws accumulated fees to a specified address.
Access: oracle owner only
Modifiers: onlyOwnerPubkey, accept
Parameters:
to— Recipient address.amount— Amount of fees to withdraw.
Behavior:
Transfers the specified amount in shell currency to the recipient
Uses a minimal attached value for the transfer
getCellForProposalSetStakeDeadline
Encodes staking and result submission deadlines into a TvmCell.
Parameters:
stakeStart— staking period start timestampstakeEnd— staking period end timestampresultStart— result submission start timestampresultEnd— result submission end timestamp
Returns:
Encoded
TvmCellcontaining all timestamps
getCellForProposalSetResolve
Encodes event resolution data into a TvmCell.
Parameters:
outcomeId— identifier of the winning outcome
Returns:
Encoded
TvmCellcontaining the outcome ID
getEventListAddress
Returns the address of an OracleEventList for a given index.
Parameters:
index— index of the OracleEventList (currently index0is supported)
Returns:
Address of the corresponding OracleEventList contract
getVersion
Returns the contract version information.
Returns:
Semantic version string (e.g.
"1.0.0")Contract identifier string:
"Oracle"
Last updated