RootOracle
(Work in progress) RootOracle Contract Interface Documentation
Overview
RootOracle is the system root contract responsible for deploying and managing Oracle contracts. It also supports contract code upgrades and emits events related to Oracle deployment.
Events
OracleDeployed
Emitted when a new Oracle contract is successfully deployed.
event OracleDeployed(address oracle, uint256 pubkey, string name);oracle— address of the deployed Oracle contractpubkey— public key associated with the Oraclename— name of the Oracle
Public & External Interface
deployOracle
Deploys a new Oracle contract.
Parameters:
oraclePubkey— public key of the OracleoracleName— human-readable name of the Oracle
Behavior:
Ensures the root contract has the minimum required native balance
Builds
stateInitfor the Oracle usingDexLib.buildOracleStateInitDeploys a new
Oraclecontract with:value: 60 vmshellflag: 1
Passes the following arguments to the Oracle constructor:
oraclePubkey_oracleEventListCode_PrivateNoteCode_pmpCode
Emits an
OracleDeployedevent to an external address
View Functions
getOracleAddress
Returns the deterministic address of an Oracle contract by its name.
Parameters:
name— unique Oracle name used during deployment
Returns:
oracleAddress— deterministic address of the Oracle contract associated with the given name
getVersion
Returns the contract version identifier.
Returns:
semantic version string
Contract name:
"RootOracle"
Last updated