Skip to content
This repository has been archived by the owner on Jan 24, 2024. It is now read-only.

fix(stargate): Fix balance fetcher when farm reward period is over #1042

Merged
merged 2 commits into from
Aug 2, 2022

Conversation

pwele
Copy link
Contributor

@pwele pwele commented Aug 2, 2022

Description

Stargate balance fetching is currently failing on Optimism. This due to a Multicall failure when trying to call pendingStargate on the LP staking contract.There is SafeMath: division by zero error returned by the contract. I found out that the call is throwing that because the reward period is over on that MasterChef contract and there is a piece of code attempting to divide by the totalAllocPoint which is equal to 0.
In this fix, I am catching the exception and falling back to 0.

image
image
image
image

Checklist

@pwele pwele merged commit 4b5fc43 into main Aug 2, 2022
@pwele pwele deleted the fix-stargate-optimism branch August 2, 2022 21:06
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant