Skip to content
This repository has been archived by the owner on Nov 16, 2022. It is now read-only.

Commit

Permalink
Merge pull request #3298 from bandprotocol/disable-sending-to-dist
Browse files Browse the repository at this point in the history
Disable sending to account module
  • Loading branch information
taobun authored Apr 21, 2021
2 parents bc58a72 + f1a12e8 commit 49e2ae8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 14 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG_UNRELEASED.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@

### Chain (Consensus)

- (bugs) [\#3298](https://github.com/bandprotocol/bandchain/pull/3298) Disable sending token to distribution module

### Chain (Non-consensus)

### Yoda
Expand Down
15 changes: 1 addition & 14 deletions chain/app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,6 @@ var (
staking.NotBondedPoolName: {supply.Burner, supply.Staking},
gov.ModuleName: {supply.Burner},
}
// module accounts that are allowed to receive tokens.
allowedReceivingModAcc = map[string]bool{
distr.ModuleName: true,
}
)

// BandApp is the application of BandChain, extended base ABCI application.
Expand Down Expand Up @@ -176,7 +172,7 @@ func NewBandApp(
oracleSubspace := app.ParamsKeeper.Subspace(oracle.DefaultParamspace)
// Add module keepers.
app.AccountKeeper = auth.NewAccountKeeper(cdc, keys[auth.StoreKey], authSubspace, auth.ProtoBaseAccount)
app.BankKeeper = bank.NewBaseKeeper(app.AccountKeeper, bankSubspace, app.BlacklistedAccAddrs())
app.BankKeeper = bank.NewBaseKeeper(app.AccountKeeper, bankSubspace, app.ModuleAccountAddrs())
app.SupplyKeeper = supply.NewKeeper(cdc, keys[supply.StoreKey], app.AccountKeeper, app.BankKeeper, maccPerms)
// wrappedSupplyKeeper overrides burn token behavior to instead transfer to community pool.
wrappedSupplyKeeper := bandsupply.WrapSupplyKeeperBurnToCommunityPool(app.SupplyKeeper)
Expand Down Expand Up @@ -343,15 +339,6 @@ func (app *BandApp) ModuleAccountAddrs() map[string]bool {
return modAccAddrs
}

// BlacklistedAccAddrs returns all the app's module account addresses black listed for receiving tokens.
func (app *BandApp) BlacklistedAccAddrs() map[string]bool {
blacklistedAddrs := make(map[string]bool)
for acc := range maccPerms {
blacklistedAddrs[supply.NewModuleAddress(acc).String()] = !allowedReceivingModAcc[acc]
}
return blacklistedAddrs
}

// Codec returns the application's sealed codec.
func (app *BandApp) Codec() *codec.Codec {
return app.cdc
Expand Down

0 comments on commit 49e2ae8

Please sign in to comment.