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

refactor IPCVDepositAggregator #274

Merged

Conversation

kryptoklob
Copy link
Contributor

Removes rebalancing from the PCV Deposit Aggregator.

Rationale: pcv deposits should be as firewalled from each other as possible, so that one compromised or malicious pcv deposit can't rug all tokens in the aggregator.

By removing the rebalance feature, we effectively only allow rebalance-on-push and rebalance-on-withdraw; deposits and withdrawals will still deposit and withdraw, respectively, from each pcv deposit to average the underlying tokens towards their weights, but there will be no atomic interaction that allows pcv to flow from one pcv deposit into another.

Withdraw is still permissioned, of course; a hacker couldn't withdraw from one pcv deposit and then call deposit() to deposit into another.

depositSingle(address pcvDeposit) has replaced rebalanceSingle(address pcvDeposit), and permission for this has been set to GuardianOrAdmin, though I'm up for changing this if warranted.

Copy link
Contributor

@ElliotFriedman ElliotFriedman left a comment

Choose a reason for hiding this comment

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

I like this design pattern a lot better than I like the old architecture.

LGTM!

Copy link
Contributor

@Joeysantoro Joeysantoro left a comment

Choose a reason for hiding this comment

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

Approved with nits

@kryptoklob
Copy link
Contributor Author

@Joeysantoro moved depositSingle to public since deposit is. think we're good to go here.

@kryptoklob kryptoklob merged commit 6b489e6 into feat/pcv-deposit-aggregator Oct 29, 2021
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.

3 participants