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

Voting Multipliers #100

Merged
merged 48 commits into from
Jan 2, 2025
Merged

Voting Multipliers #100

merged 48 commits into from
Jan 2, 2025

Conversation

RonTuretzky
Copy link
Collaborator

#71

This is not upgrade-safe due to new variables introduced in an inherited class. Suggesting to couple this PR with #96 and create a brand new YieldDistributor

@RonTuretzky RonTuretzky force-pushed the feat/voting_multiplier branch from 3a0c818 to daeb1ce Compare September 28, 2024 11:59
src/YieldDistributor.sol Outdated Show resolved Hide resolved
src/YieldDistributor.sol Outdated Show resolved Hide resolved
src/YieldDistributor.sol Outdated Show resolved Hide resolved
@@ -20,7 +21,7 @@ import {IYieldDistributor} from "src/interfaces/IYieldDistributor.sol";
* @custom:coauthor kassandra.eth
* @custom:coauthor theblockchainsocialist.eth
*/
contract YieldDistributor is IYieldDistributor, OwnableUpgradeable {
contract YieldDistributor is IYieldDistributor, OwnableUpgradeable, VotingMultipliers {
Copy link
Contributor

Choose a reason for hiding this comment

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

TBH I'm a little dubious of the upgrade safety here. It would probably be best to implement VotingMultipliers to use ERC7201 storage layouts (like they do with OwnableUpgradeable) to avoid storage layout collisions. It seems complicated but it's actually a pretty trivial one time calculation and some boilerplate code for accessing storage variables.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I was thinking we should just deploy a new proxy for this version, and use the setter on the bread contract, as this would also help us resolve #96

Copy link
Collaborator

Choose a reason for hiding this comment

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

Is there a foreseeable problem deploying as a new proxy, thus changing the address? if there is not, i would prefer we deploy fresh, therefore do not need to worry about upgrade-safety, and not over-complicated things. but again, this is assuming there is no major problem with changing the address.

Copy link
Contributor

Choose a reason for hiding this comment

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

Deploying a new contract is definitely the move in this instance but I mean in future instances where we maybe want to make some changes to the VotingMultipliers.sol contract. Namespacing the storage layouts ensure YieldDistributor and VotingMultipliers are using their own storage locations that won't clash, so if we want to add a variable to one or the other, we can do so safely. I can make a quick branch so show what it would look like.

Copy link
Contributor

@bagelface bagelface Dec 4, 2024

Choose a reason for hiding this comment

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

I also think there is a strong case to be made for VotingMultipliers to be its own contract.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

What are the pros/cons here?

I believe we should redeploy fresh to avoid upgrade safety issues and address #96 at some point

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

#110 is also opened but I would really like to merge this and then maybe hand it off to someone else at a later point

@RonTuretzky RonTuretzky requested a review from daopunk October 24, 2024 06:37
@RonTuretzky RonTuretzky requested a review from bagelface October 29, 2024 14:08
src/YieldDistributor.sol Outdated Show resolved Hide resolved
src/YieldDistributor.sol Outdated Show resolved Hide resolved
@RonTuretzky
Copy link
Collaborator Author

RonTuretzky commented Dec 25, 2024

@daopunk @bagelface all issues have been resolved except the issue of inheritance vs modularity.

As we plan to migrate to dough-kit sometime in the future, I would suggest we postpone dealing with this design question since we strongly agree that this should be modular and decoupled.

tldr: lets go with the path of least resistance for now as it will get reworked eventually anyways

#110 has been opened to address this concern, but I suggest we hand that off to someone at a later point and unblock this pr which has been open since oct at this point

@RonTuretzky RonTuretzky merged commit 4da5fa7 into dev Jan 2, 2025
@RonTuretzky RonTuretzky deleted the feat/voting_multiplier branch January 4, 2025 22:07
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.

Voting Multiplier Spec
4 participants