Skip to content

Commit 451a8cc

Browse files
hex for feed symbols
1 parent 91e39d4 commit 451a8cc

File tree

2 files changed

+16
-14
lines changed

2 files changed

+16
-14
lines changed

.gas-snapshot

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1-
LibOpPythPriceTest:testIntegrity(uint256,uint256,uint256) (runs: 256, μ: 3725, ~: 3725)
2-
LibOpPythPriceTest:testRunForkCurrentPriceHappy() (gas: 17585)
1+
LibOpPythPriceTest:testIntegrity(uint256,uint256,uint256) (runs: 257, μ: 3725, ~: 3725)
2+
LibOpPythPriceTest:testRunForkCurrentPriceHappy() (gas: 17435)
3+
LibPythConstantsTest:testChainIdConstants() (gas: 3477)
4+
LibPythConstantsTest:testIntorastringConstants() (gas: 6410)
35
LibPythGetPriceFeedContractTest:testGetPriceFeedContractArbitrum() (gas: 3156)
46
LibPythGetPriceFeedContractTest:testGetPriceFeedContractBase() (gas: 3202)
5-
LibPythGetPriceFeedContractTest:testGetPriceFeedContractUnsupportedChainId(uint256) (runs: 256, μ: 4285, ~: 4285)
6-
LibPythGetPriceFeedIdTest:testPriceFeedIdKnownMappings() (gas: 7118)
7-
LibPythGetPriceFeedIdTest:testPriceFeedIdUnknownMappings(string) (runs: 256, μ: 4953, ~: 4905)
8-
LibPythGetPriceNoOlderThanTest:testPriceNoOlderThanArbitrum() (gas: 104139)
9-
PythWordsPythPriceTest:testPythWordsPythPriceHappy() (gas: 1569578)
7+
LibPythGetPriceFeedContractTest:testGetPriceFeedContractUnsupportedChainId(uint256) (runs: 257, μ: 4285, ~: 4285)
8+
LibPythGetPriceFeedIdTest:testPriceFeedIdKnownMappings() (gas: 7405)
9+
LibPythGetPriceFeedIdTest:testPriceFeedIdUnknownMappings(uint256) (runs: 257, μ: 5539, ~: 5539)
10+
LibPythGetPriceNoOlderThanTest:testPriceNoOlderThanArbitrum() (gas: 105463)
11+
PythWordsPythPriceTest:testPythWordsPythPriceHappy() (gas: 1554392)

src/lib/pyth/LibPyth.sol

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,37 +25,37 @@ library LibPyth {
2525
bytes32 constant PRICE_FEED_ID_EQUITY_US_GOOG_USD =
2626
0xe65ff435be42630439c96396653a342829e877e2aafaeaf1a10d0ee5fd2cf3f2;
2727
uint256 constant PRICE_FEED_SYMBOL_INTORASTRING_EQUITY_US_GOOG_USD =
28-
66160371403383253599282426833944855373143809818294373840007959174479400140800;
28+
0x924571756974792e55532e474f4f472f55534400000000000000000000000000;
2929
/// Amazon.
3030
bytes32 constant PRICE_FEED_ID_EQUITY_US_AMZN_USD =
3131
0xb5d0e0fa58a1f8b81498ae670ce93c872d14434b72c364885d4fa1b257cbb07a;
3232
uint256 constant PRICE_FEED_SYMBOL_INTORASTRING_EQUITY_US_AMZN_USD =
33-
66160371403383253599282426825164673485599929989200081975222960745157943623680;
33+
0x924571756974792e55532e414d5a4e2f55534400000000000000000000000000;
3434
/// Apple.
3535
bytes32 constant PRICE_FEED_ID_EQUITY_US_AAPL_USD =
3636
0x49f6b65cb1de6b10eaf75e7c03ca029c306d0357e91b5311b175084a5ad55688;
3737
uint256 constant PRICE_FEED_SYMBOL_INTORASTRING_EQUITY_US_AAPL_USD =
38-
66160371403383253599282426825095942414673486745157375598258859489931187716096;
38+
0x924571756974792e55532e4141504c2f55534400000000000000000000000000;
3939
/// Microsoft.
4040
bytes32 constant PRICE_FEED_ID_EQUITY_US_MSFT_USD =
4141
0xd0ca23c1cc005e004ccf1db5bf76aeb6a49218f43dac3d4b275e92de12ded4d1;
4242
uint256 constant PRICE_FEED_SYMBOL_INTORASTRING_EQUITY_US_MSFT_USD =
43-
66160371403383253599282426842736501585965453022888347996463088912268173246464;
43+
0x924571756974792e55532e4d5346542f55534400000000000000000000000000;
4444
/// Tesla.
4545
bytes32 constant PRICE_FEED_ID_EQUITY_US_TSLA_USD =
4646
0x16dad506d7db8da01c87581c87ca897a012a153557d4d578c3b9c9e1bc0632f1;
4747
uint256 constant PRICE_FEED_SYMBOL_INTORASTRING_EQUITY_US_TSLA_USD =
48-
66160371403383253599282426852967145196619531930608304753932615391908156407808;
48+
0x924571756974792e55532e54534c412f55534400000000000000000000000000;
4949
/// Nvidia.
5050
bytes32 constant PRICE_FEED_ID_EQUITY_US_NVDA_USD =
5151
0xb1073854ed24cbc755dc527418f52b7d271f6cc967bbf8d8129112b18860a593;
5252
uint256 constant PRICE_FEED_SYMBOL_INTORASTRING_EQUITY_US_NVDA_USD =
53-
66160371403383253599282426844215083938984997694973762903522130028717106266112;
53+
0x924571756974792e55532e4e5644412f55534400000000000000000000000000;
5454
/// Meta Platforms (Facebook).
5555
bytes32 constant PRICE_FEED_ID_EQUITY_US_META_USD =
5656
0x78a3e3b8e676a8f73c439f5d749737034b139bbbe899ba5775216fba596607fe;
5757
uint256 constant PRICE_FEED_SYMBOL_INTORASTRING_EQUITY_US_META_USD =
58-
66160371403383253599282426842656886270473265994828379196375643713571242639360;
58+
0x924571756974792e55532e4d4554412f55534400000000000000000000000000;
5959

6060
/// TODO replace with O(1) lookup table.
6161
function getPriceFeedContract(uint256 chainId) internal pure returns (IPyth) {

0 commit comments

Comments
 (0)