Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: evm version in config #3

Merged
merged 1 commit into from
Dec 18, 2024
Merged
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
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_);
}
}
Loading