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: [L06] fix residual allowance #3698

Merged
merged 2 commits into from Dec 14, 2021
Merged

Conversation

chrismaree
Copy link
Member

Motivation

In order to invoke the Optimistic Oracle, the OptimisticRewarderBase contract grants it a token
allowance, so it can pull the bond payments. If the proposal fails, the reward redemption is cancelled
but the allowance is not reset. Therefore, the Optimistic Oracle will retain an unnecessary residual
allowance until the next time a dispute is triggered. Consider revoking the allowance if the proposal
fails.

This PR addresses this by decreasing the allowance granted before proposing the price request. Additionally, safeApprove was replaced with safeIncreaseAllowance to more correctly use the safeERC20 lib.

Testing

Check a box to describe how you tested these changes and list the steps for reviewers to test.

  • Ran end-to-end test, running the code as in production
  • New unit tests created
  • Existing tests adequate, no new tests required
  • All existing tests pass
  • Untested

Signed-off-by: chrismaree <christopher.maree@gmail.com>
Signed-off-by: chrismaree <christopher.maree@gmail.com>
@chrismaree chrismaree merged commit 4329fea into master Dec 14, 2021
@chrismaree chrismaree deleted the chrismaree/fix-residual-allowance branch December 14, 2021 14:48
@mrice32 mrice32 changed the title fix: [L06] fix Residual allowance fix: [L06] fix residual allowance Aug 3, 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.

None yet

2 participants