Contract Details
Tech Stack
Solidity ^0.8.24 Foundry forge-std
Chains
Ethereum Arbitrum Base Optimism
Description
Mock oracle framework for testing oracle-dependent contracts. Provides configurable mock price feeds, simulated staleness, deviation injection, and VRF coordinator mocks. Essential for unit and integration testing of any oracle-consuming contract.
Features
- ✓ MockChainlinkAggregator with price manipulation
- ✓ Staleness simulation (configurable timestamps)
- ✓ Deviation injection for edge case testing
- ✓ MockVRFCoordinator with fulfillment control
- ✓ MockDataFeed with update scheduling
- ✓ Price sequence replay from historical data
- ✓ Revert simulation for failure testing
- ✓ Gas benchmarking utilities
- ✓ Foundry test helpers and assertions
- ✓ Integration test examples
// SPDX-License-Identifier: MIT pragma solidity ^0.8.24; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; /// @title Oracle Testing Harness /// @notice Mock oracle framework for testing oracle-dependent contracts. contract OracleTestingHarness { address public immutable owner; uint256 public constant VERSION = 1; event Initialized(address indexed deployer); constructor() { owner = msg.sender; emit Initialized(msg.sender); } // ... full implementation in purchased package }