-
Notifications
You must be signed in to change notification settings - Fork 4k
Description
Summary
Allow a group to define a central funds account that group members can use to pay for their group-related Txs.
Problem Definition
As a group admin, I want the group members to be able to use funds from another pre-determined account to pay for group-related actions so that it's easier for group members to interact with the group. In some cases, the central funds account will be another account (maybe a member, maybe not), and in some cases, it will be the group account itself.
Currently, I can issue individual feegrants to each member of the group, and limit each to only group-related msgs, but I can't limit them to be used only with a specific group. Further, as members are added and removed, I also have to grant and revoke their feegrants, which can easily lead to problems (and is a little awkward when the group account is the granter which means the grants and revokes would have be part of a proposal that members vote on).
For example, say i've got a group account with 5 members. I want any one of the members to be able to submit a proposal using our central funds. Then, all of the members should be able to vote on that proposal also using the group's central funds. If we later add a member, they should be able to use the central funds similarly (and we shouldn't have to do anything other than add the member to the group). But the members should NOT be able to use this group's central funds to pay for a MsgVote
on another group (unless MsgVote
is in the allowed list).
Proposal
Allow groups to define a central funds account and an optional set of allowed msg types. The central funds account can be any account (including the group account). When a group has a central account, all group-related msgs involving that group can be paid for out of the central account by any member of the group. E.g. all members can use the central funds to pay for the MsgVote
s on a proposal. And the member that submitted the proposal could have used the central funds to issue the proposal.
The optional set of allowed msg types are NOT restricted to only those involving the group. E.g. if MsgSend
is in that list, all members of the group can use the central funds to issue any MsgSend
s they want. That also means that, if the list were to contain, a group message type like a MsgSubmitProposal
, this group's central funds could be used to issue a MsgSubmitProposal
for any group. If this list is empty, only the group-related msgs involving this group are available.
When issuing a Tx, the user will set the feegranter to the group account. On the node, if the feegranter of a Tx is listed as a group account, the signer is a member of that group, and all of it's messages are either group Msgs involving that group, or in the allowed list, then the fees will come out of that group's central funds.
An existing feegrant from a group account to a specific member will take precedence over this new functionality.