Skip to content

refactor IPCVDepositAggregator#274

Merged
xklob merged 5 commits intofeat/pcv-deposit-aggregatorfrom
feat/pcv-deposit-aggreator-refactor
Oct 29, 2021
Merged

refactor IPCVDepositAggregator#274
xklob merged 5 commits intofeat/pcv-deposit-aggregatorfrom
feat/pcv-deposit-aggreator-refactor

Conversation

@xklob
Copy link
Contributor

@xklob xklob commented Oct 28, 2021

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

@xklob
Copy link
Contributor Author

xklob commented Oct 29, 2021

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

@xklob xklob 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

Comments