Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
# Compiler files
cache/
out/
.zkout/

# Ignores development broadcast logs
!/broadcast
/broadcast/*/31337/
/broadcast/**/dry-run/
broadcast/
lib/

# Docs
docs/
Expand Down
2 changes: 1 addition & 1 deletion scripts/MorphoPythOracleDeploy.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -68,4 +68,4 @@ contract MorphoPythOracleDeploy is Script {

vm.stopBroadcast();
}
}
}
2 changes: 1 addition & 1 deletion scripts/MorphoPythOracleFactoryDeploy.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ contract MorphoPythOracleFactoryDeploy is Script {

vm.stopBroadcast();
}
}
}
26 changes: 26 additions & 0 deletions scripts/MorphoPythOracleRead.s.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// SPDX-License-Identifier: Apache-2.0
pragma solidity 0.8.21;

import "forge-std/Script.sol";
import {console} from "forge-std/console.sol";
import {IMorphoPythOracle} from "../src/morpho-pyth/interfaces/IMorphoPythOracle.sol";
import {IERC4626} from "../src/interfaces/IERC4626.sol";

contract MorphoPythOracleRead is Script {
function run() public {
// Use an RPC fork so external calls hit the real chain state
string memory rpcUrl = vm.envString("RPC");
vm.createSelectFork(rpcUrl);

// Get the Factory address on your chain
address oracleAddress = vm.envAddress("ORACLE_ADDRESS");
console.log("Oracle address:", oracleAddress);

IMorphoPythOracle oracle = IMorphoPythOracle(oracleAddress);
console.log("Pyth address:", address(oracle.pyth()));

console2.log("Max age:", oracle.PRICE_FEED_MAX_AGE());

console2.log("Price:", oracle.price());
}
}
Loading