Skip to content

Commit

Permalink
fix: evm version in config (#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
rbajollari authored Dec 18, 2024
1 parent bf231de commit b4181f8
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
1 change: 1 addition & 0 deletions foundry.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ via_ir = true
src = "src"
out = "out"
libs = ["lib"]
evm_version = "shanghai"
fs_permissions = [{ access = "read-write", path = "./"}]
gas_reports = ["*"]
build_info = true
Expand Down
20 changes: 20 additions & 0 deletions script/OjoPendleOracles.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {Script} from "forge-std/Script.sol";
import {OjoPendleOracle} from "src/OjoPendleOracle.sol";
import {OjoPTOraclePriceAdapter} from "src/OjoPTOraclePriceAdapter.sol";
import {console} from "forge-std/console.sol";
import {IPTOracle} from "src/interfaces/IPTOracle.sol";

contract DeployOjoPendleOracle is Script {
function run() external {
Expand Down Expand Up @@ -36,3 +37,22 @@ contract DeployOjoPTOraclePriceAdapter is Script {
console.log("OjoPTOraclePriceAdapter Address:", address(ojoPTOraclePriceAdapter));
}
}

contract CheckOracleState is Script {
function run() external {
address _ptoracle = vm.envAddress("PT_ORACLE");
address _market = vm.envAddress("MARKET");

IPTOracle oracle = IPTOracle(_ptoracle);

(bool increaseCardinalityRequired_, uint16 cardinalityRequired_, bool oldestObservationSatisfied_) = oracle
.getOracleState(
_market,
900 // 15 mins twap duration
);

console.log("increaseCardinalityRequired", increaseCardinalityRequired_);
console.log("cardinalityRequired", cardinalityRequired_);
console.log("oldestObservationSatisfied", oldestObservationSatisfied_);
}
}

0 comments on commit b4181f8

Please sign in to comment.