Just a simple price feed function following the docs to retrieve price of ETH to USD, however it reverted with this error: 0x6ce2251a
Here is my script for interacting and the priceUpdate array is retrieve from Hermes, I think the array is correct because the parsed data is there.
// SPDX-License-Identifier: MIT
pragma solidity 0.8.28;
import {Script, console} from "forge-std/Script.sol";
import {PythPriceFeed} from "src/PythPriceFeed.sol";
import {Vm} from "forge-std/Vm.sol";
import {PythStructs} from "@pythnetwork/pyth-sdk-solidity/PythStructs.sol";
contract GetETHUSDPrice is Script {
PythPriceFeed pythPriceFeed;
function run() external {
address pythContract = Vm(address(vm)).getDeployment(
"PythPriceFeed",
uint64(block.chainid)
);
pythPriceFeed = PythPriceFeed(payable(pythContract));
bytes[] memory priceUpdate = new bytes[](1);
priceUpdate[
0
] = "0x...";
vm.startBroadcast();
PythStructs.Price memory price = pythPriceFeed.getEThUSDPrice(
priceUpdate
);
vm.stopBroadcast();
console.log("ETH/USD Price: ", price.price);
}
}
I have also funded a few eth to my contract on Chain Sepolia: PythPriceFeed | Address 0x2127c26e297ae9782f41d99049ffc1051a157c9e | Etherscan
Here are the full logs:
0x2127C26e297aE9782f41D99049fFc1051A157C9E::getEThUSDPrice([0x..])
β ββ [9168] ERC1967Proxy::fallback([0x...]) [staticcall]
β β ββ [3755] PythUpgradable::getUpdateFee([0x...]) [delegatecall]
β β β ββ β [Return] 1
β β ββ β [Return] 1
β ββ [14566] ERC1967Proxy::fallback{value: 1}([0x..])
β β ββ [13652] PythUpgradable::updatePriceFeeds{value: 1}([0x..]) [delegatecall]
β β β ββ [6255] 0x41c9e39574F40Ad34c79f1C99B66A45eFB830d4c::parseAndVerifyVM(0x..) [staticcall]
β β β β ββ [854] 0x8D254a21b3C86D32F7179855531CE99164721933::parseAndVerifyVM(0x..) [delegatecall]
β β β β β ββ β [Revert] custom error 0x6ce2251a
β β β β ββ β [Revert] custom error 0x6ce2251a
β β β ββ β [Revert] custom error 0x6ce2251a
β β ββ β [Revert] custom error 0x6ce2251a
β ββ β [Revert] custom error 0x6ce2251a
ββ β [Revert] custom error 0x6ce2251a


