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: add ability to lose support #63

Merged
merged 1 commit into from Aug 9, 2022
Merged

Conversation

0xsambugs
Copy link
Collaborator

Thanks to @0xged , we realized that we had a corner case where the oracle wouldn't work as expected. This scenario could happen if we removed a mapping (to USD or another token) and suddenly a pair lost support.

In that case, the pricing plan was already set, and we couldn't remove it by reconfiguring the pair (because it reverted). With this change, we can now lose support

@0xsambugs 0xsambugs self-assigned this Aug 8, 2022
planForPair[__tokenA][__tokenB] = _plan;
emit AddedSupportForPairInChainlinkOracle(__tokenA, __tokenB);
emit UpdatedPlanForPair(__tokenA, __tokenB, _plan);
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thought this name made more sense

@@ -29,7 +29,7 @@ contract StatefulChainlinkOracleMock is StatefulChainlinkOracle {
_addOrModifySupportForPair(_tokenA, _tokenB, _data);
}

function setPricingPlan(
function determinePricingPlan(
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thought this name made more sense

@0xsambugs 0xsambugs requested a review from 0xged August 8, 2022 14:30
Copy link
Contributor

@0xged 0xged left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! This Oracle is getting so much better 😊

@0xsambugs 0xsambugs merged commit cb5299d into main Aug 9, 2022
@0xsambugs 0xsambugs deleted the fix/add-ability-to-lose-support branch August 9, 2022 12:21
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.

None yet

2 participants