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

C01: PrizePool#sweepTimelockBalances can handle dup addresses #100

Merged
merged 1 commit into from
Aug 21, 2020

Conversation

asselstine
Copy link
Contributor

No description provided.

@linear
Copy link

linear bot commented Aug 14, 2020

POOL-384 OZ Audit C01

The sweepTimelockBalances function accepts a list of users with unlocked balances to distribute. However, if there are duplicate users in the list, their balances will be counted multiple times when calculating the total amount to withdraw from the yield service. This has two consequences:

  • After the transaction is complete, the excess amount withdrawn will be held by the PrizePool contract (instead of the yield service) and will not earn interest
  • Eventually, a user will want to withdraw that amount, which will fail when the PrizePool attempts to redeem it from the yield service. This means the last users to withdraw will lose their funds. Interestingly, in the case of the CompoundPrizePool, this is partially mitigated by the “[H01] Improper Error Handling” issue.

Consider checking for duplicate users when calculating the amount to withdraw.

@asselstine asselstine changed the title PrizePool#sweepTimelockBalances can handle dup addresses C01: PrizePool#sweepTimelockBalances can handle dup addresses Aug 14, 2020
@asselstine asselstine merged commit cf87db1 into oz-audit Aug 21, 2020
@asselstine asselstine deleted the feature/pool-384-oz-audit-c01 branch August 21, 2020 22:22
@asselstine asselstine restored the feature/pool-384-oz-audit-c01 branch August 21, 2020 22:45
@asselstine asselstine deleted the feature/pool-384-oz-audit-c01 branch August 21, 2020 22:58
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

1 participant