Skip to content
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

fix: prevent getPrice from revert in UniswapPairPriceAdapter #235

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

gzliudan
Copy link
Contributor

Now function getPrice in UniswapPairPriceAdapter maybe revert when call function priceOracle.getPrice in function getPrice or _getUniswapPrice. This will prevent other oracle adapters which added after UniswapPairPriceAdapter from provide price. To resolve this issue, I use try/catch clause to check revert case. When revert, new version of getPrice will return (false, 0);

@gzliudan gzliudan changed the title fix: prevent getPrice in UniswapPairPriceAdapter fix: prevent getPrice in UniswapPairPriceAdapter from revert Mar 26, 2022
@gzliudan gzliudan force-pushed the UniswapPairPriceAdapter branch from bfe36c7 to 342206b Compare March 26, 2022 03:51
@gzliudan gzliudan changed the title fix: prevent getPrice in UniswapPairPriceAdapter from revert fix: prevent getPrice from revert in UniswapPairPriceAdapter Mar 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant