From 8e0404b66aaa386030a20f80f4716e10fbdd26d9 Mon Sep 17 00:00:00 2001 From: Siddharth2207 Date: Wed, 29 Oct 2025 12:31:45 +0530 Subject: [PATCH 1/2] iau --- src/lib/pyth/LibPyth.sol | 8 ++++++++ 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 | 7 +++++++ 4 files changed, 24 insertions(+) diff --git a/src/lib/pyth/LibPyth.sol b/src/lib/pyth/LibPyth.sol index 45d4558..4d96e07 100644 --- a/src/lib/pyth/LibPyth.sol +++ b/src/lib/pyth/LibPyth.sol @@ -87,6 +87,12 @@ library LibPyth { // slither-disable-next-line too-many-digits uint256 constant PRICE_FEED_SYMBOL_INTORASTRING_EQUITY_US_SPLG_USD = 0x924571756974792e55532e53504c472f55534400000000000000000000000000; + /// iShares Gold Trust (IAU) + bytes32 constant PRICE_FEED_ID_EQUITY_US_IAU_USD = + 0xf703fbded84f7da4bd9ff4661b5d1ffefa8a9c90b7fa12f247edc8251efac914; + // slither-disable-next-line too-many-digits + uint256 constant PRICE_FEED_SYMBOL_INTORASTRING_EQUITY_US_IAU_USD = + 0x914571756974792e55532e4941552f5553440000000000000000000000000000; /// TODO replace with O(1) lookup table. function getPriceFeedContract(uint256 chainId) internal pure returns (IPyth) { @@ -124,6 +130,8 @@ library LibPyth { return PRICE_FEED_ID_EQUITY_US_BRK_B_USD; } else if (feedSymbol == PRICE_FEED_SYMBOL_INTORASTRING_EQUITY_US_SPLG_USD) { return PRICE_FEED_ID_EQUITY_US_SPLG_USD; + } else if (feedSymbol == PRICE_FEED_SYMBOL_INTORASTRING_EQUITY_US_IAU_USD) { + return PRICE_FEED_ID_EQUITY_US_IAU_USD; } else { revert UnsupportedFeedSymbol(); } diff --git a/test/src/lib/pyth/LibPyth.constants.t.sol b/test/src/lib/pyth/LibPyth.constants.t.sol index 88f98ef..af45045 100644 --- a/test/src/lib/pyth/LibPyth.constants.t.sol +++ b/test/src/lib/pyth/LibPyth.constants.t.sol @@ -57,5 +57,9 @@ contract LibPythConstantsTest is Test { LibPyth.PRICE_FEED_SYMBOL_INTORASTRING_EQUITY_US_SPLG_USD, IntOrAString.unwrap(LibIntOrAString.fromString2("Equity.US.SPLG/USD")) ); + assertEq( + LibPyth.PRICE_FEED_SYMBOL_INTORASTRING_EQUITY_US_IAU_USD, + IntOrAString.unwrap(LibIntOrAString.fromString2("Equity.US.IAU/USD")) + ); } } diff --git a/test/src/lib/pyth/LibPyth.getPriceFeedId.t.sol b/test/src/lib/pyth/LibPyth.getPriceFeedId.t.sol index 7022e91..247f52d 100644 --- a/test/src/lib/pyth/LibPyth.getPriceFeedId.t.sol +++ b/test/src/lib/pyth/LibPyth.getPriceFeedId.t.sol @@ -57,6 +57,10 @@ contract LibPythGetPriceFeedIdTest is Test { LibPyth.PRICE_FEED_ID_EQUITY_US_SPLG_USD, LibPyth.getPriceFeedId(LibIntOrAString.fromString2("Equity.US.SPLG/USD")) ); + assertEq( + LibPyth.PRICE_FEED_ID_EQUITY_US_IAU_USD, + LibPyth.getPriceFeedId(LibIntOrAString.fromString2("Equity.US.IAU/USD")) + ); } function testPriceFeedIdUnknownMappings(IntOrAString symbol) external { @@ -72,6 +76,7 @@ contract LibPythGetPriceFeedIdTest is Test { && IntOrAString.unwrap(symbol) != IntOrAString.unwrap(LibIntOrAString.fromString2("Equity.US.MSTR/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")) ); 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 238bb28..d36b8f3 100644 --- a/test/src/lib/pyth/LibPyth.getPriceNoOlderThan.t.sol +++ b/test/src/lib/pyth/LibPyth.getPriceNoOlderThan.t.sol @@ -150,5 +150,12 @@ contract LibPythGetPriceNoOlderThanTest is Test { LibDecimalFloat.packLossless(78.71367e5, -5), LibDecimalFloat.packLossless(0.03281e5, -5) ); + + checkPriceNoOlderThan( + LibIntOrAString.fromString2("Equity.US.IAU/USD"), + LibDecimalFloat.packLossless(24 hours, 0), + LibDecimalFloat.packLossless(71.99028e5, -5), + LibDecimalFloat.packLossless(0.07147e5, -5) + ); } } From ad9f77b25045bf6a694f52852ec6cefb4e9e88ac Mon Sep 17 00:00:00 2001 From: thedavidmeister Date: Fri, 7 Nov 2025 12:57:44 +0400 Subject: [PATCH 2/2] 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 0d7b108..2dd8e1a 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(0xa9fe1909ca00897783bf99e68750a319e8294464f653fd428a391d9f68862f8e); +bytes32 constant BYTECODE_HASH = bytes32(0x6ad42cc38a63b0ccefc9db597401a93d114999576e1e6c100ca947b3e8c862d9); /// @dev The hash of the meta that describes the contract. bytes32 constant DESCRIBED_BY_META_HASH = bytes32(0xe7bb5842b2cf1d25681a9885109fbf8943495bcebb9ec049bc3790e5db57fa80);