Oracle Contracts

The Noderr Oracle system provides decentralized price feeds and strategy scoring for the protocol.

Contract Addresses (Base Sepolia)

ContractAddressPurpose
OracleRegistry0x...Oracle node registration
PriceOracle0x...Asset price feeds
StrategyOracle0x...Strategy performance data
GuardianWorkloadManagerV20x...Guardian selection lottery
ValidatorFulfillmentManager0x8b6f112178bAC1a8968B12C292B0B2A123eE42D2Validator selection

OracleRegistry

Manages registration and reputation of Oracle nodes.

Key Functions

// Register as oracle node
function registerOracle(
bytes32 nodeId,
string calldata endpoint,
uint256 stake
) external returns (bool);
// Update oracle reputation
function updateReputation(
bytes32 nodeId,
int256 delta,
string calldata reason
) external onlyRole(ADMIN_ROLE);
// Get oracle info
function getOracle(bytes32 nodeId) external view returns (OracleInfo memory);

Events

event OracleRegistered(bytes32 indexed nodeId, address indexed operator, uint256 stake);
event OracleDeregistered(bytes32 indexed nodeId, address indexed operator);
event ReputationUpdated(bytes32 indexed nodeId, int256 delta, uint256 newScore);

PriceOracle

Provides price feeds for assets used in the protocol.

import "@chainlink/contracts/src/v0.8/interfaces/AggregatorV3Interface.sol";
contract PriceOracle {
mapping(address => AggregatorV3Interface) public priceFeeds;
function getPrice(address asset) external view returns (uint256) {
AggregatorV3Interface feed = priceFeeds[asset];
(, int256 price,,,) = feed.latestRoundData();
return uint256(price);
}
}

Supported Assets

AssetFeed AddressDecimals
ETH/USD0x...8
NODR/USD0x...8
USDC/USD0x...8

StrategyOracle

Records and validates strategy performance metrics.

Key Functions

// Submit strategy score (Oracle nodes only)
function submitScore(
bytes32 strategyId,
uint256 score,
bytes calldata proof
) external onlyRole(ORACLE_ROLE);
// Get aggregated score
function getStrategyScore(bytes32 strategyId) external view returns (
uint256 score,
uint256 confidence,
uint256 lastUpdate
);

Commit-Reveal Scheme

To prevent front-running, scores use commit-reveal:

// Phase 1: Commit hash
function commitScore(bytes32 strategyId, bytes32 commitment) external;
// Phase 2: Reveal score
function revealScore(
bytes32 strategyId,
uint256 score,
bytes32 salt
) external;

GuardianWorkloadManagerV2

Selects Guardian nodes for strategy validation using Chainlink VRF.

Selection Process

  1. Oracle requests Guardian selection
  2. Contract requests random number from Chainlink VRF
  3. 3 Guardians selected based on reputation-weighted lottery
  4. Selected Guardians perform validation
  5. 2/3 consensus required for approval

Key Functions

// Request Guardian selection
function requestGuardianSelection(
bytes32 strategyId,
uint256 validationLevel
) external returns (uint256 requestId);
// Get selected Guardians
function getSelectedGuardians(uint256 requestId) external view returns (
address[] memory guardians,
uint256[] memory weights
);

ValidatorFulfillmentManager

Selects Validator nodes for ERC-7540 fulfillment operations.

Key Functions

// Register vault for fulfillment
function registerVault(
address vault,
uint256 fulfillmentDelay
) external onlyRole(ADMIN_ROLE);
// Request validator selection for fulfillment
function requestFulfillment(
address vault,
uint256 requestId,
FulfillmentType fulfillmentType
) external returns (uint256 selectionId);
// Execute fulfillment (selected validator only)
function executeFulfillment(
uint256 selectionId
) external onlySelectedValidator(selectionId);

Events

event ValidatorSelected(
uint256 indexed selectionId,
address indexed validator,
address indexed vault,
uint256 requestId
);
event FulfillmentExecuted(
uint256 indexed selectionId,
address indexed validator,
bool success
);

Security Considerations

Oracle Manipulation Protection

  1. Multiple Oracles: Scores aggregated from multiple sources
  2. Outlier Detection: Extreme values filtered
  3. Time-Weighted Average: Prevents flash manipulation
  4. Reputation Slashing: Bad actors lose stake
  • VRF for provably fair randomness
  • Price feeds for accurate asset pricing
  • Automation for scheduled operations

Integration Example

import { ethers } from'ethers';
import { PriceOracleABI } from'@noderr/sdk/abis';
const priceOracle = new ethers.Contract(
PRICE_ORACLE_ADDRESS,
PriceOracleABI,
provider
);
// Get ETH priceconst ethPrice = await priceOracle.getPrice(ETH_ADDRESS);
console.log(`ETH Price: $${ethPrice / 1e8}`);

Last Updated: December 2025

results matching ""

    No results matching ""