File tree Expand file tree Collapse file tree 2 files changed +29
-0
lines changed Expand file tree Collapse file tree 2 files changed +29
-0
lines changed Original file line number Diff line number Diff line change 11# Compiler files
22cache /
33out /
4+ .zkout /
45
56# Ignores development broadcast logs
67! /broadcast
78/broadcast /* /31337 /
89/broadcast /** /dry-run /
910broadcast /
11+ lib /
1012
1113# Docs
1214docs /
Original file line number Diff line number Diff line change 1+ // SPDX-License-Identifier: Apache-2.0
2+ pragma solidity 0.8.21 ;
3+
4+ import "forge-std/Script.sol " ;
5+ import {console} from "forge-std/console.sol " ;
6+ import {IMorphoPythOracle} from "../src/morpho-pyth/interfaces/IMorphoPythOracle.sol " ;
7+ import {IERC4626 } from "../src/interfaces/IERC4626.sol " ;
8+
9+ contract MorphoPythOracleRead is Script {
10+ function run () public {
11+
12+ // Use an RPC fork so external calls hit the real chain state
13+ string memory rpcUrl = vm.envString ("RPC " );
14+ vm.createSelectFork (rpcUrl);
15+
16+ // Get the Factory address on your chain
17+ address oracleAddress = vm.envAddress ("ORACLE_ADDRESS " );
18+ console.log ("Oracle address: " , oracleAddress);
19+
20+ IMorphoPythOracle oracle = IMorphoPythOracle (oracleAddress);
21+ console.log ("Pyth address: " , address (oracle.pyth ()));
22+
23+ console2.log ("Max age: " , oracle.PRICE_FEED_MAX_AGE ());
24+
25+ console2.log ("Price: " , oracle.price ());
26+ }
27+ }
You can’t perform that action at this time.
0 commit comments