From cbc802cb78f6f20cf6e00d045595f33ef160cc76 Mon Sep 17 00:00:00 2001 From: Federico Kunze <31522760+fedekunze@users.noreply.github.com> Date: Fri, 2 Aug 2019 14:29:00 +0200 Subject: [PATCH] Merge PR #4831: Prevent community spend proposal from transferring funds to a ModuleAcc --- .pending/bugfixes/modules/_prevent-community-s | 1 + x/distribution/keeper/proposal_handler.go | 4 ++++ 2 files changed, 5 insertions(+) create mode 100644 .pending/bugfixes/modules/_prevent-community-s diff --git a/.pending/bugfixes/modules/_prevent-community-s b/.pending/bugfixes/modules/_prevent-community-s new file mode 100644 index 000000000..e25abd9a7 --- /dev/null +++ b/.pending/bugfixes/modules/_prevent-community-s @@ -0,0 +1 @@ +#4831 Prevent community spend proposal from transferring funds to a module account diff --git a/x/distribution/keeper/proposal_handler.go b/x/distribution/keeper/proposal_handler.go index 2bd491881..2daf2245e 100644 --- a/x/distribution/keeper/proposal_handler.go +++ b/x/distribution/keeper/proposal_handler.go @@ -9,6 +9,10 @@ import ( // HandleCommunityPoolSpendProposal is a handler for executing a passed community spend proposal func HandleCommunityPoolSpendProposal(ctx sdk.Context, k Keeper, p types.CommunityPoolSpendProposal) sdk.Error { + if k.blacklistedAddrs[p.Recipient.String()] { + return sdk.ErrUnauthorized(fmt.Sprintf("%s is blacklisted from receiving external funds", p.Recipient)) + } + err := k.DistributeFromFeePool(ctx, p.Amount, p.Recipient) if err != nil { return err