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 Multiplier Spec #71

Open
RonTuretzky opened this issue Aug 7, 2024 · 4 comments · May be fixed by #100
Open

Voting Multiplier Spec #71

RonTuretzky opened this issue Aug 7, 2024 · 4 comments · May be fixed by #100
Assignees

Comments

@RonTuretzky
Copy link
Collaborator

RonTuretzky commented Aug 7, 2024

Definition

We define a voting multiplier as the multiplication of existing voting power by increasing factor ( a number bigger than 1).
For example, some user holds 10 $BREAD , and has completed some tasks on guild.xyz , awarding him some NFTs. These could award him a voting multiplier of 10% (1.1), such that his voting power is now effectively equal to holding 11 $BREAD.

Motivation

Reward users for contributing or participating in Breadchain. Create incentives for further activity. Improve the governance process by weighing active and invested user's votes as more meaningful.

Multiplier Sources

Gnosis Chain

  • A multiplier that has a source of truth on Gnosis chain

Cross Chain

  • A multiplier which has a source of truth on some other blockchain (for practical reasons , an EVM blockchain which is bridgeable to Gnosis chain)

Off Chain

  • A multiplier who's source of truth is some web2 application

Requirements

  • It should be possible to define a temporary multiplier
  • It should be possible to define a permanent multiplier
  • It should be possible to define a dynamic multiplier which changes over time according to some variable
  • Multipliers should support the ERC20Votes delegation design pattern
  • It should be possible to define variable sources of truth for multipliers
  • It should be possible to add / remove multipliers for the following voting cycle
  • There should be a shared interface for all multipliers
  • It should be possible to edit the source of truth for a multiplier
  • Multipliers should be detected and attributed to a user at the time of voting

Concessions

  • For a given multiplier , some action may be required in order to update / attribute a multiplier (such as minting an NFT , submitting proof of some activity or ownership of some asset)

High Level Overview

This overview suggests an implementation approach that relies on NFTs, allowing the usage of existing NFTs sanctioned by the Breadchain community. This approach also asserts that multipliers which require a custom implementation or some offchain integration can conform to an NFT design, providing a homogenous interface to all multipliers. This approach also provides forward compatibility to existing services which already implement NFT which breadchain may choose to adopt or increase usage of (such as CharacterSheets, [Guild])https://guild.xyz/breadchain) , Hats etc )

classDiagram 

class IMultiplier{
	getMultiplyingFactor(address) external view returns (uint256)
	validUntil(address) external view returns (uint256)
}


class INFTMultiplier{
	IERC721 NFTAddress 
	hasNFT(address) returns (bool)
}

class PermanentNFTMultiplier{
	uint256 multiplyingFactor 
	uint256 validity = type(uint256).max
}

class DynamicNFTMultiplier{
	address => uint256 userToFactor
	address => uint256 userToValidity
}

INFTMultiplier --|> IMultiplier 
PermanentNFTMultiplier --|> INFTMultiplier
DynamicNFTMultiplier --|> INFTMultiplier

class ERC721{

name() public view virtual returns (string memory)
symbol() public view virtual returns (string memory)
tokenURI(uint256 tokenId) public view virtual returns (string memory)
} 
class IERC721{
balanceOf(address owner) external view returns (uint256 balance)
ownerOf(uint256 tokenId) external view returns (address owner);

}
class IProveableMultiplier{
	submitActivities(bytes data) external 
	mint(address to, uint256 tokenId) internal
}

IProveableMultiplier --|> ERC721
IProveableMultiplier --|> DynamicNFTMultiplier 
ERC721 --|> IERC721
INFTMultiplier --o IERC721

class IOffChainProveableMultiplier{
	address pullOracle 
	
}
class IOnChainProveableMultiplier{
	address activityContract

}
class ICrossChainProveableMultiplier{
	address bridge 
}
IOffChainProveableMultiplier --|> IProveableMultiplier
IOnChainProveableMultiplier --|> IProveableMultiplier
ICrossChainProveableMultiplier --|> IProveableMultiplier

Loading

In order to integrate these multipliers into the existing voting infrastructure , the following contract will be deployed and referenced in the YieldDistributor

classDiagram
class VotingMultipliers{
	Bread BREAD 
	IMultplier[] whitelistedMultipliers 
	getTotalMultipliers(address) external view returns (uint256)
	queueMultiplierAddition(IMultiplier) external 
	queueMultiplierRemoval(IMultiplier) external
}
Loading
sequenceDiagram 
autonumber
BreadHolder ->> YieldDistributor : Cast vote 
YieldDistributor ->> YieldDistributor : Get voting power derived from holder's $BREAD and delegated $BREAD
YieldDistributor ->> VotingMultipliers : Loop and apply all existing multipliers of the holder
YieldDistributor ->> YieldDistributor : Apply Voting power 
Loading

Overview of Currently Desired Multipliers

Description Multiplier Source Suggested Implementation Interface Brief Implemtation Overview
Providing liquidity Providing liquidity to some pool sanctioned by the Breadchain team containing $BREAD as an underlying asset Gnosis chain DynamicNFTMultiplier Create a $BB NFT, derive the factor from the $BB balance
Voting streaks / activity Participation in voting of yield distribution cycles over time Gnosis chain IOnChainProveableMultiplier Add a counter on the yield distributor contract that counts cycles voted in, use that for factor
On chain activity Participation in partner blockchains Gnosis chain / cross chain IOnChainProveableMultiplier / ICrossChainProveableMultiplier For Gnosis activities, if the activity is proveable on chain only the logic to prove so will need to be implemented in order to mint the multiplier NFT. For other chains, it will need to be bridged in one step, then the multiplier NFT can be minted in another.
Recieving salary in $BREAD on a Gnosis Pay card Receiving salary into a Gnosis Pay card and converting it into $BREAD Gnosis chain IOnChainProveableMultiplier User will submit the address of their Gnosis pay card multisig, upon successful verification of ownership the factor will be set based on the bread balance
Development Contributions Contributing code / design / architecture / reviews / audits to develop Breadchain features Off chain DynamicNFTMultiplier (if integrating existing platforms) IOffChainProveableMultiplier (If bootstrapping an interface ) Recommend to check existing solutions that mint NFTs for github contributions and to integrate that
Research Contributions Contributing research to some Breadchain sanctioned research target Off chain DynamicNFTMultiplier (if integrating existing platforms) IOffChainProveableMultiplier (If bootstrapping an interface ) CharacterSheets
Community Organizing Organizing online events, async events, community projects , irl events Off chain DynamicNFTMultiplier (if integrating existing platforms) IOffChainProveableMultiplier (If bootstrapping an interface ) CharacterSheets
Community Participation Participating in weekly meetings, events or conferences Off chain DynamicNFTMultiplier (if integrating existing platforms) IOffChainProveableMultiplier (If bootstrapping an interface ) Create an NFT series for the weekly temp checks, factor will be how many they have. Create for other events as needed.
Social Media Activity Participating in the Crypto Leftists discord, guilt, following on social media, liking posts over time Off chain DynamicNFTMultiplier (if integrating existing platforms) IOffChainProveableMultiplier (If bootstrapping an interface ) Recommend to find an existing solution that mints NFTs

Delegation

If a user has delegated their voting power on the $BREAD contract to another user, that should also delegate multipliers.

@bagelface
Copy link
Contributor

Can you provide links to the "existing services" referenced: CharacterSheets, Questline, Guild, Hats

@RonTuretzky
Copy link
Collaborator Author

Can you provide links to the "existing services" referenced: CharacterSheets, Questline, Guild, Hats

added 👍

@RonTuretzky RonTuretzky self-assigned this Sep 9, 2024
@RonTuretzky
Copy link
Collaborator Author

RonTuretzky commented Sep 28, 2024

  • Add path from Dynamic to IOnChainMultiplier
  • Change IPermanentNFTMultiplier to implementation from interface
  • pullOracle > oracle in offchain
  • remove mint external call in Iproveable multiplier

@RonTuretzky RonTuretzky reopened this Sep 28, 2024
RonTuretzky pushed a commit that referenced this issue Sep 28, 2024
@RonTuretzky RonTuretzky linked a pull request Sep 28, 2024 that will close this issue
@RonTuretzky RonTuretzky closed this as completed by moving to Done in Breadchain Oct 2, 2024
@RonTuretzky RonTuretzky reopened this Oct 23, 2024
@RonTuretzky RonTuretzky linked a pull request Oct 30, 2024 that will close this issue
@daopunk
Copy link
Collaborator

daopunk commented Nov 2, 2024

Re-opening since PR has not been merged.

@daopunk daopunk reopened this Nov 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: In Progress
Development

Successfully merging a pull request may close this issue.

3 participants