Oracle Contracts
The Noderr Oracle system provides decentralized price feeds and strategy scoring for the protocol.
Contract Addresses (Base Sepolia)
| Contract | Address | Purpose |
|---|---|---|
| OracleRegistry | 0x... | Oracle node registration |
| PriceOracle | 0x... | Asset price feeds |
| StrategyOracle | 0x... | Strategy performance data |
| GuardianWorkloadManagerV2 | 0x... | Guardian selection lottery |
| ValidatorFulfillmentManager | 0x8b6f112178bAC1a8968B12C292B0B2A123eE42D2 | Validator 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.
Integration with Chainlink
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
| Asset | Feed Address | Decimals |
|---|---|---|
| ETH/USD | 0x... | 8 |
| NODR/USD | 0x... | 8 |
| USDC/USD | 0x... | 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
- Oracle requests Guardian selection
- Contract requests random number from Chainlink VRF
- 3 Guardians selected based on reputation-weighted lottery
- Selected Guardians perform validation
- 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
- Multiple Oracles: Scores aggregated from multiple sources
- Outlier Detection: Extreme values filtered
- Time-Weighted Average: Prevents flash manipulation
- Reputation Slashing: Bad actors lose stake
Chainlink Integration
- 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