Skip to content

Commit f4d3263

Browse files
committed
Add contract description for FlexVotingDelegatable
1 parent 6210a41 commit f4d3263

File tree

2 files changed

+19
-3
lines changed

2 files changed

+19
-3
lines changed

src/FlexVotingBase.sol

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ import {Checkpoints} from "@openzeppelin/contracts/utils/structs/Checkpoints.sol
66
import {IFractionalGovernor} from "src/interfaces/IFractionalGovernor.sol";
77
import {IVotingToken} from "src/interfaces/IVotingToken.sol";
88

9-
/// @notice This is an abstract contract designed to make it easy to build clients
10-
/// for governance systems that inherit from GovernorCountingFractional, a.k.a.
11-
/// Flexible Voting governors.
9+
/// @notice This is an abstract contract designed to make it easy to build
10+
/// clients for governance systems that inherit from GovernorCountingFractional,
11+
/// a.k.a. Flexible Voting governors.
1212
///
1313
/// A "client" in this sense is a contract that:
1414

src/FlexVotingDelegatable.sol

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,22 @@ import {Checkpoints} from "@openzeppelin/contracts/utils/structs/Checkpoints.sol
77

88
import {FlexVotingBase} from "src/FlexVotingBase.sol";
99

10+
/// @notice This is an abstract contract designed to make it easy to build
11+
/// clients for governance systems that inherit from GovernorCountingFractional,
12+
/// a.k.a. Flexible Voting governors.
13+
///
14+
/// This contract extends FlexVotingBase, adding the ability to subdelegate one's
15+
/// internal voting weight. It is meant to be inherited from in conjunction with
16+
/// FlexVotingClient. Doing so makes the following usecase possible:
17+
/// - user A deposits 100 governance tokens in a FlexVotingClient
18+
/// - user B deposits 50 governance tokens into the same client
19+
/// - user A delegates voting weight to user B
20+
/// - a proposal is created in the Governor contract
21+
/// - user B expresses a voting preference P on the proposal to the client
22+
/// - the client casts its votes on the proposal to the Governor contract
23+
/// - user B's voting weight is combined with user A's voting weight so that
24+
/// 150 tokens are effectively cast with voting preference P on behalf of
25+
/// users A and B.
1026
abstract contract FlexVotingDelegatable is Context, FlexVotingBase {
1127
using Checkpoints for Checkpoints.Trace208;
1228

0 commit comments

Comments
 (0)