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 contract

  • pubkey — public key associated with the Oracle

  • name — name of the Oracle


Public & External Interface

deployOracle

Deploys a new Oracle contract.

Parameters:

  • oraclePubkey — public key of the Oracle

  • oracleName — human-readable name of the Oracle

Behavior:

  • Ensures the root contract has the minimum required native balance

  • Builds stateInit for the Oracle using DexLib.buildOracleStateInit

  • Deploys a new Oracle contract with:

    • value: 60 vmshell

    • flag: 1

  • Passes the following arguments to the Oracle constructor:

    • oraclePubkey

    • _oracleEventListCode

    • _PrivateNoteCode

    • _pmpCode

  • Emits an OracleDeployed event 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