From 4aacbd3214a5995eabc2260013ba3761bb2234a8 Mon Sep 17 00:00:00 2001 From: Siddharth2207 Date: Sun, 19 Apr 2026 21:33:42 +0530 Subject: [PATCH 1/5] update flake --- .gitignore | 3 +- flake.lock | 144 +++++++++++++++++++++++++++++++++++++++++++---------- 2 files changed, 120 insertions(+), 27 deletions(-) diff --git a/.gitignore b/.gitignore index bf3d16b..fdf0fe8 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ out -cache \ No newline at end of file +cache +.pre-commit-config.yaml \ No newline at end of file diff --git a/flake.lock b/flake.lock index 78eae1c..5e1c9e4 100644 --- a/flake.lock +++ b/flake.lock @@ -1,5 +1,21 @@ { "nodes": { + "flake-compat": { + "flake": false, + "locked": { + "lastModified": 1767039857, + "narHash": "sha256-vNpUSpF5Nuw8xvDLj2KCwwksIbjua2LZCqhV1LNRDns=", + "owner": "NixOS", + "repo": "flake-compat", + "rev": "5edf11c44bc78a0d334f6334cdaf7d60d732daab", + "type": "github" + }, + "original": { + "owner": "NixOS", + "repo": "flake-compat", + "type": "github" + } + }, "flake-utils": { "inputs": { "systems": "systems" @@ -182,11 +198,11 @@ "nixpkgs": "nixpkgs_5" }, "locked": { - "lastModified": 1758705030, - "narHash": "sha256-zYM8PiEXANNrtjfyGUc7w37/D/kCynp0cQS+wCQ77GI=", + "lastModified": 1773213477, + "narHash": "sha256-Pv1Z3QqGkSGEUV+9pM5vYIiI7VJo7Tfm6ZmR+JSp1zo=", "owner": "shazow", "repo": "foundry.nix", - "rev": "b59a55014050110170023e3e1c277c1d4a2f055b", + "rev": "3c73daa86c823d706824fd9bbcb85aa23fd0f668", "type": "github" }, "original": { @@ -195,6 +211,48 @@ "type": "github" } }, + "git-hooks-nix": { + "inputs": { + "flake-compat": "flake-compat", + "gitignore": "gitignore", + "nixpkgs": "nixpkgs_6" + }, + "locked": { + "lastModified": 1774104215, + "narHash": "sha256-EAtviqz0sEAxdHS4crqu7JGR5oI3BwaqG0mw7CmXkO8=", + "owner": "cachix", + "repo": "git-hooks.nix", + "rev": "f799ae951fde0627157f40aec28dec27b22076d0", + "type": "github" + }, + "original": { + "owner": "cachix", + "repo": "git-hooks.nix", + "type": "github" + } + }, + "gitignore": { + "inputs": { + "nixpkgs": [ + "rainix", + "git-hooks-nix", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1709087332, + "narHash": "sha256-HG2cCnktfHsKV0s4XW83gU3F57gaTljL9KNSuG6bnQs=", + "owner": "hercules-ci", + "repo": "gitignore.nix", + "rev": "637db329424fd7e46cf4185293b9cc8c88c95394", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "gitignore.nix", + "type": "github" + } + }, "nixpkgs": { "locked": { "lastModified": 1666753130, @@ -209,6 +267,22 @@ "type": "indirect" } }, + "nixpkgs-old": { + "locked": { + "lastModified": 1749104371, + "narHash": "sha256-m2NmOPd6XgBiskmUq/BS9Xxuf3z0ebnGVfSKNAO5NEM=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "48975d7f9b9960ed33c4e8561bcce20cc0c2de5b", + "type": "github" + }, + "original": { + "owner": "nixos", + "repo": "nixpkgs", + "rev": "48975d7f9b9960ed33c4e8561bcce20cc0c2de5b", + "type": "github" + } + }, "nixpkgs_2": { "locked": { "lastModified": 1714764285, @@ -272,11 +346,27 @@ }, "nixpkgs_6": { "locked": { - "lastModified": 1758711836, - "narHash": "sha256-uBqPg7wNX2v6YUdTswH7wWU8wqb60cFZx0tHaWTGF30=", + "lastModified": 1770073757, + "narHash": "sha256-Vy+G+F+3E/Tl+GMNgiHl9Pah2DgShmIUBJXmbiQPHbI=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "47472570b1e607482890801aeaf29bfb749884f6", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_7": { + "locked": { + "lastModified": 1776017067, + "narHash": "sha256-oEp8fqJweZd5doqvH/aBAtc6NzZh+fh0tOhR09gQXck=", "owner": "nixos", "repo": "nixpkgs", - "rev": "46f97b78e825ae762c0224e3983c47687436a498", + "rev": "a5a7cf16648d79134eb4da0e3354b08913917b2f", "type": "github" }, "original": { @@ -285,7 +375,7 @@ "type": "github" } }, - "nixpkgs_7": { + "nixpkgs_8": { "locked": { "lastModified": 1744536153, "narHash": "sha256-awS2zRgF4uTwrOKwwiJcByDzDOdo3Q1rPZbiHQg/N38=", @@ -301,13 +391,13 @@ "type": "github" } }, - "nixpkgs_8": { + "nixpkgs_9": { "locked": { - "lastModified": 1748662220, - "narHash": "sha256-7gGa49iB9nCnFk4h/g9zwjlQAyjtpgcFkODjcOQS0Es=", + "lastModified": 1771923393, + "narHash": "sha256-Fy0+UXELv9hOE8WjYhJt8fMDLYTU2Dqn3cX4BwoGBos=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "59138c7667b7970d205d6a05a8bfa2d78caa3643", + "rev": "ea7f1f06811ce7fcc81d6c6fd4213150c23edcf2", "type": "github" }, "original": { @@ -362,16 +452,18 @@ "inputs": { "flake-utils": "flake-utils_7", "foundry": "foundry_2", - "nixpkgs": "nixpkgs_6", + "git-hooks-nix": "git-hooks-nix", + "nixpkgs": "nixpkgs_7", + "nixpkgs-old": "nixpkgs-old", "rust-overlay": "rust-overlay_2", "solc": "solc_2" }, "locked": { - "lastModified": 1758730752, - "narHash": "sha256-ZQ1INSsEWYgb1NdC5zo6nu1ObLzOCDI+wjiZ4222fQ8=", + "lastModified": 1776019532, + "narHash": "sha256-0aMnHCZ2fR0+ZwuRHFouYYUQqYL/dSp5cOgka0m6vE4=", "owner": "rainprotocol", "repo": "rainix", - "rev": "cc7c9bbbd9b817aa3a6a5c994262e14fb0bc920c", + "rev": "9babaac787d1e1119609b0d89c33a6b42249c066", "type": "github" }, "original": { @@ -408,14 +500,14 @@ }, "rust-overlay_2": { "inputs": { - "nixpkgs": "nixpkgs_7" + "nixpkgs": "nixpkgs_8" }, "locked": { - "lastModified": 1758681214, - "narHash": "sha256-8cW731vev6kfr58cILO2ZsjHwaPhm88dQ8Q6nTSjP9I=", + "lastModified": 1773216618, + "narHash": "sha256-iZlowevS+xKLGOXtZwpIrz3SWe7PtoGUfEeVZNib+WE=", "owner": "oxalica", "repo": "rust-overlay", - "rev": "b12ed88d8d33d4f3cbc842bf29fad93bb1437299", + "rev": "07d7dc6fcc5eae76b4fb0e19d4afd939437bec97", "type": "github" }, "original": { @@ -446,27 +538,27 @@ "solc-macos-amd64-list-json": { "flake": false, "locked": { - "narHash": "sha256-AvITkfpNYgCypXuLJyqco0li+unVw39BAfdOZvd/SPE=", + "narHash": "sha256-oEiXc95EghuYCudzkPA9XBFOnMdgWFfTO2/4XUfSTpc=", "type": "file", - "url": "https://github.com/argotorg/solc-bin/raw/26fc3fd/macosx-amd64/list.json" + "url": "https://github.com/argotorg/solc-bin/raw/83cb756/macosx-amd64/list.json" }, "original": { "type": "file", - "url": "https://github.com/argotorg/solc-bin/raw/26fc3fd/macosx-amd64/list.json" + "url": "https://github.com/argotorg/solc-bin/raw/83cb756/macosx-amd64/list.json" } }, "solc_2": { "inputs": { "flake-utils": "flake-utils_9", - "nixpkgs": "nixpkgs_8", + "nixpkgs": "nixpkgs_9", "solc-macos-amd64-list-json": "solc-macos-amd64-list-json" }, "locked": { - "lastModified": 1756368702, - "narHash": "sha256-cqEHv7uCV0LibmQphyiXZ1+jYtGjMNb9Pae4tfcAcF8=", + "lastModified": 1772085240, + "narHash": "sha256-+NEcuhT2A0QQumVx9Ze6g2iuNicyuW028Jq/HUJHGh4=", "owner": "hellwolf", "repo": "solc.nix", - "rev": "d83e90df2fa8359a690f6baabf76099432193c3f", + "rev": "d3cc119973e484ea366f4b997b404bb00d7829ca", "type": "github" }, "original": { From 562cf37b7f6d16968b4912fe96948ce4265f6a93 Mon Sep 17 00:00:00 2001 From: Siddharth2207 Date: Sun, 19 Apr 2026 21:34:04 +0530 Subject: [PATCH 2/5] add sgov feed --- src/lib/pyth/LibPyth.sol | 8 ++++++++ test/lib/LibFork.sol | 1 + test/src/lib/pyth/LibPyth.constants.t.sol | 4 ++++ test/src/lib/pyth/LibPyth.getPriceFeedId.t.sol | 5 +++++ test/src/lib/pyth/LibPyth.getPriceNoOlderThan.t.sol | 13 ++++++++++++- 5 files changed, 30 insertions(+), 1 deletion(-) diff --git a/src/lib/pyth/LibPyth.sol b/src/lib/pyth/LibPyth.sol index 7941e42..b99d5ad 100644 --- a/src/lib/pyth/LibPyth.sol +++ b/src/lib/pyth/LibPyth.sol @@ -280,6 +280,12 @@ library LibPyth { // slither-disable-next-line too-many-digits uint256 constant PRICE_FEED_SYMBOL_INTORASTRING_EQUITY_US_RKLB_USD = uint256(0x924571756974792e55532e524b4c422f55534400000000000000000000000000); + /// SGOV/USD + bytes32 constant PRICE_FEED_ID_EQUITY_US_SGOV_USD = + 0x8d6a29bb5ed522931d711bb12c4bbf92af986936e52af582032913b5ffcbf4d5; + // slither-disable-next-line too-many-digits + uint256 constant PRICE_FEED_SYMBOL_INTORASTRING_EQUITY_US_SGOV_USD = + uint256(0x924571756974792e55532e53474f562f55534400000000000000000000000000); /// TODO replace with O(1) lookup table. function getPriceFeedContract(uint256 chainId) internal pure returns (IPyth) { @@ -389,6 +395,8 @@ library LibPyth { return PRICE_FEED_ID_EQUITY_US_BMNR_USD_POST; } else if (feedSymbol == PRICE_FEED_SYMBOL_INTORASTRING_EQUITY_US_RKLB_USD) { return PRICE_FEED_ID_EQUITY_US_RKLB_USD; + } else if (feedSymbol == PRICE_FEED_SYMBOL_INTORASTRING_EQUITY_US_SGOV_USD) { + return PRICE_FEED_ID_EQUITY_US_SGOV_USD; } else { revert UnsupportedFeedSymbol(); } diff --git a/test/lib/LibFork.sol b/test/lib/LibFork.sol index 009b224..c143ff9 100644 --- a/test/lib/LibFork.sol +++ b/test/lib/LibFork.sol @@ -11,3 +11,4 @@ uint256 constant FORK_BLOCK_BASE_CRCL = 39622962; uint256 constant FORK_BLOCK_BASE_PPLT = 39588538; uint256 constant FORK_BLOCK_BASE_BMNR = 40460679; uint256 constant FORK_BLOCK_BASE_RKLB = 40582366; +uint256 constant FORK_BLOCK_BASE_SGOV = 44912388; diff --git a/test/src/lib/pyth/LibPyth.constants.t.sol b/test/src/lib/pyth/LibPyth.constants.t.sol index bf8829c..fae4519 100644 --- a/test/src/lib/pyth/LibPyth.constants.t.sol +++ b/test/src/lib/pyth/LibPyth.constants.t.sol @@ -201,5 +201,9 @@ contract LibPythConstantsTest is Test { LibPyth.PRICE_FEED_SYMBOL_INTORASTRING_EQUITY_US_RKLB_USD, IntOrAString.unwrap(LibIntOrAString.fromString2("Equity.US.RKLB/USD")) ); + assertEq( + LibPyth.PRICE_FEED_SYMBOL_INTORASTRING_EQUITY_US_SGOV_USD, + IntOrAString.unwrap(LibIntOrAString.fromString2("Equity.US.SGOV/USD")) + ); } } diff --git a/test/src/lib/pyth/LibPyth.getPriceFeedId.t.sol b/test/src/lib/pyth/LibPyth.getPriceFeedId.t.sol index 29b1cef..5438207 100644 --- a/test/src/lib/pyth/LibPyth.getPriceFeedId.t.sol +++ b/test/src/lib/pyth/LibPyth.getPriceFeedId.t.sol @@ -186,6 +186,10 @@ contract LibPythGetPriceFeedIdTest is Test { LibPyth.PRICE_FEED_ID_EQUITY_US_RKLB_USD, LibPyth.getPriceFeedId(LibIntOrAString.fromString2("Equity.US.RKLB/USD")) ); + assertEq( + LibPyth.PRICE_FEED_ID_EQUITY_US_SGOV_USD, + LibPyth.getPriceFeedId(LibIntOrAString.fromString2("Equity.US.SGOV/USD")) + ); } function testPriceFeedIdUnknownMappings(IntOrAString symbol) external { @@ -244,6 +248,7 @@ contract LibPythGetPriceFeedIdTest is Test { && IntOrAString.unwrap(symbol) != IntOrAString.unwrap(LibIntOrAString.fromString2("Equity.US.BMNR/USD.POST")) && IntOrAString.unwrap(symbol) != IntOrAString.unwrap(LibIntOrAString.fromString2("Equity.US.RKLB/USD")) + && IntOrAString.unwrap(symbol) != IntOrAString.unwrap(LibIntOrAString.fromString2("Equity.US.SGOV/USD")) ); vm.expectRevert(UnsupportedFeedSymbol.selector); this.getPriceFeedIdExternal(symbol); diff --git a/test/src/lib/pyth/LibPyth.getPriceNoOlderThan.t.sol b/test/src/lib/pyth/LibPyth.getPriceNoOlderThan.t.sol index 50c891b..f24f83e 100644 --- a/test/src/lib/pyth/LibPyth.getPriceNoOlderThan.t.sol +++ b/test/src/lib/pyth/LibPyth.getPriceNoOlderThan.t.sol @@ -12,7 +12,8 @@ import { FORK_BLOCK_BASE_CRCL, FORK_BLOCK_BASE_PPLT, FORK_BLOCK_BASE_BMNR, - FORK_BLOCK_BASE_RKLB + FORK_BLOCK_BASE_RKLB, + FORK_BLOCK_BASE_SGOV } from "test/lib/LibFork.sol"; import {IntOrAString, LibIntOrAString} from "rain.intorastring/lib/LibIntOrAString.sol"; import {Float, LibDecimalFloat} from "rain.math.float/lib/LibDecimalFloat.sol"; @@ -393,4 +394,14 @@ contract LibPythGetPriceNoOlderThanTest is Test { LibDecimalFloat.packLossless(0.12886e5, -5) ); } + function testPriceNoOlderThanBaseSgov() external { + vm.createSelectFork(FORK_RPC_URL_BASE, FORK_BLOCK_BASE_SGOV); + checkPriceNoOlderThan( + LibIntOrAString.fromString2("Equity.US.SGOV/USD"), + LibDecimalFloat.packLossless(48 hours, 0), + LibDecimalFloat.packLossless(100.56505e5, -5), + LibDecimalFloat.packLossless(0.10552e5, -5) + ); + } + } From feccf72f66e7b3167b834aac1083b86c8d016d83 Mon Sep 17 00:00:00 2001 From: Siddharth2207 Date: Sun, 19 Apr 2026 21:35:32 +0530 Subject: [PATCH 3/5] pointers --- src/generated/PythWords.pointers.sol | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/generated/PythWords.pointers.sol b/src/generated/PythWords.pointers.sol index fc58e9e..e9e2c2b 100644 --- a/src/generated/PythWords.pointers.sol +++ b/src/generated/PythWords.pointers.sol @@ -10,7 +10,7 @@ pragma solidity ^0.8.25; // file needs the contract to exist so that it can be compiled. /// @dev Hash of the known bytecode. -bytes32 constant BYTECODE_HASH = bytes32(0x75f6cf625295be434800bc1143b31558b8835fe1566aaca5960b8d3058a776ff); +bytes32 constant BYTECODE_HASH = bytes32(0xfd467e959e3b5d8cdbb20330135e8de3612b3833714b30b0096e259d314b8a92); /// @dev The hash of the meta that describes the contract. bytes32 constant DESCRIBED_BY_META_HASH = bytes32(0xe7bb5842b2cf1d25681a9885109fbf8943495bcebb9ec049bc3790e5db57fa80); From df6cd9a1c911d37588506ed1f5f8c02c5ecef9f5 Mon Sep 17 00:00:00 2001 From: Siddharth2207 Date: Sun, 19 Apr 2026 21:36:24 +0530 Subject: [PATCH 4/5] fmt --- src/abstract/PythExtern.sol | 20 +++++----------- src/abstract/PythSubParser.sol | 16 ++++--------- src/lib/pyth/LibPyth.sol | 3 ++- .../src/lib/pyth/LibPyth.getPriceFeedId.t.sol | 24 ++++++++++++------- .../pyth/LibPyth.getPriceNoOlderThan.t.sol | 2 +- 5 files changed, 30 insertions(+), 35 deletions(-) diff --git a/src/abstract/PythExtern.sol b/src/abstract/PythExtern.sol index cb0d7e0..9be4ad0 100644 --- a/src/abstract/PythExtern.sol +++ b/src/abstract/PythExtern.sol @@ -25,13 +25,9 @@ abstract contract PythExtern is BaseRainterpreterExternNPE2 { } function buildOpcodeFunctionPointers() external pure returns (bytes memory) { - function(OperandV2, StackItem[] memory) - internal - view - returns (StackItem[] memory)[] memory fs = new function(OperandV2, StackItem[] memory) - internal - view - returns (StackItem[] memory)[](OPCODE_FUNCTION_POINTERS_LENGTH); + function(OperandV2, StackItem[] memory) internal view returns (StackItem[] memory)[] memory fs = new function(OperandV2, StackItem[] memory) + internal + view returns (StackItem[] memory)[](OPCODE_FUNCTION_POINTERS_LENGTH); fs[OPCODE_PYTH_PRICE] = LibOpPythPrice.run; uint256[] memory pointers; @@ -42,13 +38,9 @@ abstract contract PythExtern is BaseRainterpreterExternNPE2 { } function buildIntegrityFunctionPointers() external pure returns (bytes memory) { - function(OperandV2, uint256, uint256) - internal - pure - returns (uint256, uint256)[] memory fs = new function(OperandV2, uint256, uint256) - internal - pure - returns (uint256, uint256)[](OPCODE_FUNCTION_POINTERS_LENGTH); + function(OperandV2, uint256, uint256) internal pure returns (uint256, uint256)[] memory fs = new function(OperandV2, uint256, uint256) + internal + pure returns (uint256, uint256)[](OPCODE_FUNCTION_POINTERS_LENGTH); fs[OPCODE_PYTH_PRICE] = LibOpPythPrice.integrity; uint256[] memory pointers; diff --git a/src/abstract/PythSubParser.sol b/src/abstract/PythSubParser.sol index 03033d8..5bd9586 100644 --- a/src/abstract/PythSubParser.sol +++ b/src/abstract/PythSubParser.sol @@ -39,10 +39,8 @@ abstract contract PythSubParser is BaseRainterpreterSubParserNPE2 { } function buildOperandHandlerFunctionPointers() external pure returns (bytes memory) { - function(bytes32[] memory) internal pure returns (OperandV2)[] memory fs = new function(bytes32[] memory) - internal - pure - returns (OperandV2)[](SUB_PARSER_WORD_PARSERS_LENGTH); + function(bytes32[] memory) internal pure returns (OperandV2)[] memory fs = + new function(bytes32[] memory) internal pure returns (OperandV2)[](SUB_PARSER_WORD_PARSERS_LENGTH); fs[SUB_PARSER_WORD_PYTH_PRICE] = LibParseOperand.handleOperandDisallowed; uint256[] memory pointers; @@ -57,13 +55,9 @@ abstract contract PythSubParser is BaseRainterpreterSubParserNPE2 { } function buildSubParserWordParsers() external pure returns (bytes memory) { - function(uint256, uint256, OperandV2) - internal - view - returns (bool, bytes memory, bytes32[] memory)[] memory fs = new function(uint256, uint256, OperandV2) - internal - view - returns (bool, bytes memory, bytes32[] memory)[](SUB_PARSER_WORD_PARSERS_LENGTH); + function(uint256, uint256, OperandV2) internal view returns (bool, bytes memory, bytes32[] memory)[] memory fs = new function(uint256, uint256, OperandV2) + internal + view returns (bool, bytes memory, bytes32[] memory)[](SUB_PARSER_WORD_PARSERS_LENGTH); fs[SUB_PARSER_WORD_PYTH_PRICE] = pythPriceSubParser; uint256[] memory pointers; diff --git a/src/lib/pyth/LibPyth.sol b/src/lib/pyth/LibPyth.sol index b99d5ad..2ad78ce 100644 --- a/src/lib/pyth/LibPyth.sol +++ b/src/lib/pyth/LibPyth.sol @@ -38,7 +38,8 @@ library LibPyth { uint256 constant PRICE_FEED_SYMBOL_INTORASTRING_CRYPTO_WBTC_USD = uint256(0x8F43727970746F2E574254432F55534400000000000000000000000000000000); /// CBBTC/USD - bytes32 constant PRICE_FEED_ID_CRYPTO_CBBTC_USD = 0x2817d7bfe5c64b8ea956e9a26f573ef64e72e4d7891f2d6af9bcc93f7aff9a97; + bytes32 constant PRICE_FEED_ID_CRYPTO_CBBTC_USD = + 0x2817d7bfe5c64b8ea956e9a26f573ef64e72e4d7891f2d6af9bcc93f7aff9a97; // slither-disable-next-line too-many-digits uint256 constant PRICE_FEED_SYMBOL_INTORASTRING_CRYPTO_CBBTC_USD = uint256(0x9043727970746F2E43424254432F555344000000000000000000000000000000); diff --git a/test/src/lib/pyth/LibPyth.getPriceFeedId.t.sol b/test/src/lib/pyth/LibPyth.getPriceFeedId.t.sol index 5438207..7adb6ac 100644 --- a/test/src/lib/pyth/LibPyth.getPriceFeedId.t.sol +++ b/test/src/lib/pyth/LibPyth.getPriceFeedId.t.sol @@ -210,41 +210,49 @@ contract LibPythGetPriceFeedIdTest is Test { && IntOrAString.unwrap(symbol) != IntOrAString.unwrap(LibIntOrAString.fromString2("Crypto.XAUT/USD")) && IntOrAString.unwrap(symbol) != IntOrAString.unwrap(LibIntOrAString.fromString2("Crypto.XRP/USD")) && IntOrAString.unwrap(symbol) != IntOrAString.unwrap(LibIntOrAString.fromString2("Equity.US.COIN/USD")) - && IntOrAString.unwrap(symbol) != IntOrAString.unwrap(LibIntOrAString.fromString2("Equity.US.COIN/USD.PRE")) + && IntOrAString.unwrap(symbol) + != IntOrAString.unwrap(LibIntOrAString.fromString2("Equity.US.COIN/USD.PRE")) && IntOrAString.unwrap(symbol) != IntOrAString.unwrap(LibIntOrAString.fromString2("Equity.US.COIN/USD.POST")) && IntOrAString.unwrap(symbol) != IntOrAString.unwrap(LibIntOrAString.fromString2("Equity.US.GOOG/USD")) && IntOrAString.unwrap(symbol) != IntOrAString.unwrap(LibIntOrAString.fromString2("Equity.US.AMZN/USD")) - && IntOrAString.unwrap(symbol) != IntOrAString.unwrap(LibIntOrAString.fromString2("Equity.US.AMZN/USD.PRE")) + && IntOrAString.unwrap(symbol) + != IntOrAString.unwrap(LibIntOrAString.fromString2("Equity.US.AMZN/USD.PRE")) && IntOrAString.unwrap(symbol) != IntOrAString.unwrap(LibIntOrAString.fromString2("Equity.US.AMZN/USD.POST")) && IntOrAString.unwrap(symbol) != IntOrAString.unwrap(LibIntOrAString.fromString2("Equity.US.AAPL/USD")) && IntOrAString.unwrap(symbol) != IntOrAString.unwrap(LibIntOrAString.fromString2("Equity.US.MSFT/USD")) && IntOrAString.unwrap(symbol) != IntOrAString.unwrap(LibIntOrAString.fromString2("Equity.US.TSLA/USD")) - && IntOrAString.unwrap(symbol) != IntOrAString.unwrap(LibIntOrAString.fromString2("Equity.US.TSLA/USD.PRE")) + && IntOrAString.unwrap(symbol) + != IntOrAString.unwrap(LibIntOrAString.fromString2("Equity.US.TSLA/USD.PRE")) && IntOrAString.unwrap(symbol) != IntOrAString.unwrap(LibIntOrAString.fromString2("Equity.US.TSLA/USD.POST")) && IntOrAString.unwrap(symbol) != IntOrAString.unwrap(LibIntOrAString.fromString2("Equity.US.NVDA/USD")) - && IntOrAString.unwrap(symbol) != IntOrAString.unwrap(LibIntOrAString.fromString2("Equity.US.NVDA/USD.PRE")) + && IntOrAString.unwrap(symbol) + != IntOrAString.unwrap(LibIntOrAString.fromString2("Equity.US.NVDA/USD.PRE")) && IntOrAString.unwrap(symbol) != IntOrAString.unwrap(LibIntOrAString.fromString2("Equity.US.NVDA/USD.POST")) && IntOrAString.unwrap(symbol) != IntOrAString.unwrap(LibIntOrAString.fromString2("Equity.US.META/USD")) && IntOrAString.unwrap(symbol) != IntOrAString.unwrap(LibIntOrAString.fromString2("Equity.US.GME/USD")) && IntOrAString.unwrap(symbol) != IntOrAString.unwrap(LibIntOrAString.fromString2("Equity.US.MSTR/USD")) - && IntOrAString.unwrap(symbol) != IntOrAString.unwrap(LibIntOrAString.fromString2("Equity.US.MSTR/USD.PRE")) + && IntOrAString.unwrap(symbol) + != IntOrAString.unwrap(LibIntOrAString.fromString2("Equity.US.MSTR/USD.PRE")) && IntOrAString.unwrap(symbol) != IntOrAString.unwrap(LibIntOrAString.fromString2("Equity.US.MSTR/USD.POST")) - && IntOrAString.unwrap(symbol) != IntOrAString.unwrap(LibIntOrAString.fromString2("Equity.US.BRK-B/USD")) + && IntOrAString.unwrap(symbol) + != IntOrAString.unwrap(LibIntOrAString.fromString2("Equity.US.BRK-B/USD")) && IntOrAString.unwrap(symbol) != IntOrAString.unwrap(LibIntOrAString.fromString2("Equity.US.SPLG/USD")) && IntOrAString.unwrap(symbol) != IntOrAString.unwrap(LibIntOrAString.fromString2("Equity.US.IAU/USD")) && IntOrAString.unwrap(symbol) != IntOrAString.unwrap(LibIntOrAString.fromString2("Equity.US.SIVR/USD")) && IntOrAString.unwrap(symbol) != IntOrAString.unwrap(LibIntOrAString.fromString2("Equity.US.CRCL/USD")) - && IntOrAString.unwrap(symbol) != IntOrAString.unwrap(LibIntOrAString.fromString2("Equity.US.CRCL/USD.PRE")) + && IntOrAString.unwrap(symbol) + != IntOrAString.unwrap(LibIntOrAString.fromString2("Equity.US.CRCL/USD.PRE")) && IntOrAString.unwrap(symbol) != IntOrAString.unwrap(LibIntOrAString.fromString2("Equity.US.CRCL/USD.POST")) && IntOrAString.unwrap(symbol) != IntOrAString.unwrap(LibIntOrAString.fromString2("Equity.US.PPLT/USD")) && IntOrAString.unwrap(symbol) != IntOrAString.unwrap(LibIntOrAString.fromString2("Equity.US.BMNR/USD")) - && IntOrAString.unwrap(symbol) != IntOrAString.unwrap(LibIntOrAString.fromString2("Equity.US.BMNR/USD.PRE")) + && IntOrAString.unwrap(symbol) + != IntOrAString.unwrap(LibIntOrAString.fromString2("Equity.US.BMNR/USD.PRE")) && IntOrAString.unwrap(symbol) != IntOrAString.unwrap(LibIntOrAString.fromString2("Equity.US.BMNR/USD.POST")) && IntOrAString.unwrap(symbol) != IntOrAString.unwrap(LibIntOrAString.fromString2("Equity.US.RKLB/USD")) diff --git a/test/src/lib/pyth/LibPyth.getPriceNoOlderThan.t.sol b/test/src/lib/pyth/LibPyth.getPriceNoOlderThan.t.sol index f24f83e..a3453f2 100644 --- a/test/src/lib/pyth/LibPyth.getPriceNoOlderThan.t.sol +++ b/test/src/lib/pyth/LibPyth.getPriceNoOlderThan.t.sol @@ -394,6 +394,7 @@ contract LibPythGetPriceNoOlderThanTest is Test { LibDecimalFloat.packLossless(0.12886e5, -5) ); } + function testPriceNoOlderThanBaseSgov() external { vm.createSelectFork(FORK_RPC_URL_BASE, FORK_BLOCK_BASE_SGOV); checkPriceNoOlderThan( @@ -403,5 +404,4 @@ contract LibPythGetPriceNoOlderThanTest is Test { LibDecimalFloat.packLossless(0.10552e5, -5) ); } - } From e9cccd7f82d817de093551c3a2df76f8292a3f18 Mon Sep 17 00:00:00 2001 From: Siddharth2207 Date: Sun, 19 Apr 2026 22:26:27 +0530 Subject: [PATCH 5/5] update deploy script --- .github/workflows/manual-sol-artifacts.yaml | 9 +-------- script/Deploy.sol | 6 +++++- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/.github/workflows/manual-sol-artifacts.yaml b/.github/workflows/manual-sol-artifacts.yaml index 43575a6..c024869 100644 --- a/.github/workflows/manual-sol-artifacts.yaml +++ b/.github/workflows/manual-sol-artifacts.yaml @@ -11,7 +11,6 @@ on: - flare - arbitrum - base - jobs: deploy: runs-on: ubuntu-latest @@ -23,13 +22,10 @@ jobs: echo "verify_secret_name=CI_DEPLOY_${network^^}_VERIFY" >> $GITHUB_ENV echo "verifier_secret_name=CI_DEPLOY_${network^^}_VERIFIER" >> $GITHUB_ENV echo "verifier_url_secret_name=CI_DEPLOY_${network^^}_VERIFIER_URL" >> $GITHUB_ENV - echo "metaboard_address_secret_name=CI_DEPLOY_${network^^}_METABOARD_ADDRESS" >> $GITHUB_ENV - - uses: actions/checkout@v4 with: submodules: recursive fetch-depth: 0 - - uses: nixbuild/nix-quick-install-action@v30 with: nix_conf: | @@ -46,16 +42,14 @@ jobs: # before trying to save a new cache # 1G = 1073741824 gc-max-store-size-linux: 1G - - run: nix develop -c rainix-sol-prelude working-directory: ./lib/rain.interpreter - run: nix develop -c rainix-rs-prelude working-directory: ./lib/rain.interpreter - run: nix develop -c i9r-prelude working-directory: ./lib/rain.interpreter - - run: nix develop -c rainix-sol-prelude - + - run: nix develop -c rain-pyth-prelude - run: nix develop -c rainix-sol-artifacts env: DEPLOY_BROADCAST: '1' @@ -65,4 +59,3 @@ jobs: DEPLOY_VERIFY: ${{ secrets[env.verify_secret_name] || vars[env.verify_secret_name] || '' }} DEPLOY_VERIFIER: ${{ secrets[env.verifier_secret_name] || vars[env.verifier_secret_name] || '' }} DEPLOY_VERIFIER_URL: ${{ secrets[env.verifier_url_secret_name] || vars[env.verifier_url_secret_name] || '' }} - DEPLOY_METABOARD_ADDRESS: ${{ secrets[env.metaboard_address_secret_name] || vars[env.metaboard_address_secret_name] || '' }} \ No newline at end of file diff --git a/script/Deploy.sol b/script/Deploy.sol index 7d32ace..cadd835 100644 --- a/script/Deploy.sol +++ b/script/Deploy.sol @@ -7,11 +7,15 @@ import {PythWords} from "../src/concrete/PythWords.sol"; import {IMetaBoardV1_2} from "rain.metadata/interface/unstable/IMetaBoardV1_2.sol"; import {LibDescribedByMeta} from "rain.metadata/lib/LibDescribedByMeta.sol"; +/// @dev Deterministic MetaBoard address deployed via Zoltu factory. +/// https://github.com/rainlanguage/rain.metadata +address constant METABOARD_ADDRESS = 0xfb8437AeFBB8031064E274527C5fc08e30Ac6928; + contract Deploy is Script { function run() public { uint256 deployerPrivateKey = vm.envUint("DEPLOYMENT_KEY"); bytes memory subParserDescribedByMeta = vm.readFileBinary("meta/PythWords.rain.meta"); - IMetaBoardV1_2 metaboard = IMetaBoardV1_2(vm.envAddress("DEPLOY_METABOARD_ADDRESS")); + IMetaBoardV1_2 metaboard = IMetaBoardV1_2(METABOARD_ADDRESS); vm.startBroadcast(deployerPrivateKey); PythWords subParser = new PythWords();