This document describes a smart contract design which allows holders of COMP-style voting tokens to selectively delegate portions of their voting power to third parties, while retaining full custody over the underlying tokens.
Familiarity with the design and functionality of checkpoint voting tokens is assumed, for background information refer to the following reference material from e.g. Compound or OpenZeppelin.
Often, holders of voting tokens want to delegate their voting power, but not all to the same party! Because of how these tokens are designed, it’s impossible to do so without splitting balances across multiple addresses. While this constraint is somewhat frustrating, it opens up an interesting design space.
Imagine a FranchiserFactory
contract designed to allocate voting tokens, with the following properties:
- At any time, any voting token holder may specify some
amount
of voting power to give to adelegatee
. This creates and funds aFranchiser
smart contract designed specifically for the holder, who becomes theowner
of the contract, and thedelegatee
.- The
Franchiser
contract allows theowner
to recall the delegated tokens on demand. - The
Franchiser
automatically delegates voting power to thedelegatee
with no further interaction required.
- The
Franchiser
contracts allowdelegatees
to further sub-divide their tokens amongst severalsubDelegatees
.- At any point the
delegatee
of aFranchiser
may specify anamount
of voting power to give to asubDelegatee
, which creates and funds a nestedFranchiser
owned by thedelegatee
. - The
delegatee
may recall any delegated tokens on demand. - The maximum allowable number of
subDelegatees
varies. Thedelegatee
who was granted voting power by anowner
may designate up to 8subDelegatees
. Each of those may then specify 4subDelegatees
in turn, then 2, then 1, then 0.
- At any point the
Note that at any level of nesting, a delegatee
(or owner
) always has the ability to recall any and all tokens they or any subsidiaries have delegated. The maximum number of nested delegatees
/subDelegatees
that any one owner
could be associated with is 16 (8 + 8*4 + 8*4*2 + 8*4*2), which costs about ~5m gas to fully unwind.