-
Notifications
You must be signed in to change notification settings - Fork 152
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
Pyth oracle implementation: Issue updating the price feeds using the Pyth oracle on ShimmerEVM Testnet/Mainnet #2934
Comments
the contract you're calling is reverting the transaction. https://docs.ethers.org/v5/troubleshooting/errors/#help-CALL_EXCEPTION |
Is there a specific reason you could identify why this happens? As the transaction seems to not get reverted on the Sepolia network, but in the code we can see that nothing besides the contract and RPC changes. |
that's what this message means:
and you can see it when you execute:
I don't know what you're trying to do exactly, but it seems a little weird that a function called
|
My apologies, you may not be familiar with the way Pyth works. As you can see from their documentation example here. The reason of updating the price right before getting it is to be sure that the price is the latest one, so then it could be used further in the smart contract logic. |
I understand that the issue happens in the way you outlined here and the way that was described in the initial issue description. However the focus of the issue, from my understanding, is not why does a function that gets a price also updates it, but rather why can it not update on the ShimmerEVM network while it works on Sepolia. |
Why it works on Sepolia and not on ShimmerEVM might be due to a multitude of reasons. you must figure out why the contract is reverting the transaction in order to answer that question. To me it seems that the Pyth contract is rejecting that call for whatever reason. Could be that the price data you're sending has an old timestamp, or the price is too far away from whatever values the oracle has. |
The odd thing is, that the same price data is passed in to the updatePriceFeeds function outside of the contract, it works fine. So the issue seems to be specific to calling the function on a contract deployed to the Shimmer network. |
Can you please verify the deployed testnet contract for easier debug? |
Sure, the contract from the example can be found here. |
Describe the bug
Pyth oracle implementation: Issue updating the price feeds using the Pyth oracle on ShimmerEVM Testnet/Mainnet
To Reproduce
Issue updating the price feeds using the Pyth oracle on ShimmerEVM Testnet/Mainnet
My team and I are facing an issue while trying to update Pyth price feeds from a contract deployed on ShimmerEVM.
Contract GetBTCPricePyth.sol
Hardhat deployment script
When running the script with the ShimmerEVM Testnet specified, an error occurs.
As we can see, the price update worked when calling from the Hardhat script, but it does not allow us to execute the function which has the price update functionality in the contract itself.
If we increase the gasLimit in the deployment script like so:
And then try to run the script again, we get an output like this:
With the gasLimit set to 500000000, we are able to call the function, but the transaction reverts.
When using the same contract and script, but changing the parameters to Sepolia like so:
Contract GetBTCPricePyth.sol
Hardhat deployment script
We then get the following output:
Using the Sepolia network and all the transactions go through and work as expected.
Dependencies used
Solidity Version 0.8.18
Network and versioning
The text was updated successfully, but these errors were encountered: