OpenZeppelin / OpenZeppelin/openzeppelin-contracts
Add partial delegation to ERC20Votes
Nobody has claimed this yet.
- Dominant language
- Solidity
- Stars
- 27.2k
- Forks
- 12.4k
- Avg merge
- 2d 19h
- Merged PRs (30d)
- 33
Description
🧐 Motivation
At Tally, we see a lot of requests for "partial delegation". "Partial delegation" means letting one address split up voting power between delegates.
There are several existing workarounds:
- Tokenholders can split their tokens into different wallets
- Franchiser
- ENS's multi delegate
The fact that there are so many workarounds fragments the standard. There's no single one for frontends like ours to support.
The larger problem with these workarounds is that they don't work well for custodians. Custodians have strict legal mandates and security requirements about moving tokens. Generally, they cannot put their tokens into delegation-splitting contracts like Franchiser. Even splitting tokens into multiple wallets is a big operational lift for them.
They would love to have an in-contract method on ERC20Votes that lets them split voting power.
📝 Details
To implement this feature, add a method to ERC20Votes that supports partial delegation.
I don't have a strong view on implementation details here. Franchiser's subDelegateMany(
address[] calldata subDelegatees_,
uint256[] calldata amounts
) or ENS multi-delegate's delegateMulti(
uint256[] calldata sources,
uint256[] calldata targets,
uint256[] calldata amounts
) are good starting points. I am happy to chat about details and their tradeoffs or suggest some implementations.
The bookkeeping for partial delegation does increase gas costs. IMO that overhead is feasible on rollups, but not on Ethereum mainnet. I'd suggest making partial delegation an extension to or alternate implementation of governance/utils/Votes.sol.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading governance/utils/Votes.sol and the existing ERC20Votes implementation, then compare the linked Franchiser and ENS multi-delegate designs. Define the partial-delegation API and its bookkeeping and gas tradeoffs with maintainers; done means an agreed implementation that supports splitting voting power without moving tokens.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- solidity
- Domain
- blockchain
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100