Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Whitelisting (tax exemption) feature according to prop #11824 #393

Open
wants to merge 80 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
80 commits
Select commit Hold shift + click to select a range
d40d30d
- initial version
StrathCole Nov 27, 2023
956f4fc
- taxexemption further methods and fixes
StrathCole Nov 28, 2023
32ea4fd
- taxexemption types and query
StrathCole Nov 28, 2023
caedd4f
- added unit test
StrathCole Nov 28, 2023
fa2378d
- gofumpt
StrathCole Nov 28, 2023
0702c24
- fix comments
StrathCole Nov 28, 2023
0356e27
- updates swagger
StrathCole Nov 28, 2023
3a92ff7
proto linting
StrathCole Nov 28, 2023
6b1d0b8
- linting fix
StrathCole Nov 28, 2023
fad2667
- linting
StrathCole Nov 28, 2023
e646a5c
- further linting
StrathCole Nov 28, 2023
e3a1470
- update upgrade test
StrathCole Nov 28, 2023
6540495
added missing upgrade
StrathCole Nov 28, 2023
f4d51c5
Merge remote-tracking branch 'upstream/main' into whitelisting
StrathCole Nov 29, 2023
e35a9c3
- added missing proposal handlers
StrathCole Nov 30, 2023
7445970
- add missing legacy codec
StrathCole Nov 30, 2023
d25aada
- register proposal handler
StrathCole Nov 30, 2023
2f0ff90
- fix argument order
StrathCole Nov 30, 2023
d31dbf3
- fix usage information for cli
StrathCole Nov 30, 2023
6564f59
- add proto for taxable query
StrathCole Nov 30, 2023
2432c68
- add taxable query
StrathCole Nov 30, 2023
8a5f0c6
- proper error handling
StrathCole Nov 30, 2023
d5da81a
- added missing check for non-existing zone
StrathCole Nov 30, 2023
3491df2
- use v1 message type proposal
StrathCole Dec 1, 2023
b75f05c
- proto linting
StrathCole Dec 1, 2023
3d09202
add module ibc-hooks
DongLieu Mar 25, 2024
39c1dba
Using ibc-hooks module of classic terra
DongLieu Mar 25, 2024
74514a4
update go.mod
DongLieu Mar 25, 2024
196bda5
Bump to sdk47 and handle all compiler errors
phamminh0811 Mar 26, 2024
9b002fe
bump gogoproto and golang.org/x/exp
DongLieu Mar 26, 2024
b5abd82
updates
DongLieu Mar 26, 2024
cc7f54f
fix dyncomm ante and vesting tests
phamminh0811 Mar 27, 2024
9a266fb
fix all unit tests
phamminh0811 Mar 27, 2024
2243ade
upgrade handler for SDK47
expertdicer Mar 28, 2024
0490beb
e2e-test: fix updateGovGenesis
DongLieu Mar 28, 2024
0f66b60
using replace of classic
DongLieu Mar 28, 2024
77273b2
add SetChainID and fix DockerFile e2e dont use wasmvm fork
DongLieu Mar 29, 2024
72ff08d
update MessageValidator
DongLieu Mar 29, 2024
fb13503
add kvStore for crisis
DongLieu Mar 29, 2024
7330bb3
updates e2e
DongLieu Apr 2, 2024
8dca01e
fix ibc fail
phamminh0811 Apr 2, 2024
d3d6197
remove chain C, don't use fpm anymore
DongLieu Apr 2, 2024
4966a00
fix remove chain c
DongLieu Apr 2, 2024
8570b35
fix code id in e2e
phamminh0811 Apr 3, 2024
3b209c8
pass all test-e2e
DongLieu Apr 4, 2024
d4d578a
add crisistytes store into upgradehandlers
expertdicer Apr 7, 2024
af6d126
correct upgrade import
expertdicer Apr 7, 2024
48406ea
iterate Subspaces
expertdicer Apr 7, 2024
a36bcbe
remove ibchooks subspace
expertdicer Apr 7, 2024
e8a55e9
fix interchain test
phamminh0811 Apr 8, 2024
5754c27
updates scrips run node
DongLieu Apr 9, 2024
7d7b117
Change core version to v3
phamminh0811 Apr 19, 2024
7445624
add spamming memo test
phamminh0811 Apr 19, 2024
9563fd8
use ibc-go fork
phamminh0811 Apr 19, 2024
1208de6
backport v2.5.0
phamminh0811 Apr 29, 2024
5ed0a27
use wasmkeeper.Option instead of deprecated one
phamminh0811 May 6, 2024
c264e0d
set Localhost params in client
phamminh0811 May 6, 2024
febdbe8
fix ante_test in dyncom
phamminh0811 May 6, 2024
ca067e4
update go mod
phamminh0811 May 6, 2024
6261501
add NewGasRegisterDecorator
expertdicer May 8, 2024
534bdb1
add wasm snapshot support
expertdicer May 13, 2024
32deee3
merge main
phamminh0811 May 13, 2024
582f2cb
lint and change all deprecated types
phamminh0811 May 13, 2024
ad63865
fix make proto-format
phamminh0811 May 13, 2024
b65ec63
make proto-gen
phamminh0811 May 13, 2024
4d5f770
Fix tests (#472)
StrathCole May 13, 2024
6cb802e
fix prune command
phamminh0811 May 14, 2024
554d217
remove params table for gov
phamminh0811 May 14, 2024
df0f114
lint
phamminh0811 May 14, 2024
38f4910
fix ante test
phamminh0811 May 14, 2024
6ce7b9e
fix ictest-validator
phamminh0811 May 14, 2024
c2ce5fb
fix liveness test localnet
phamminh0811 May 14, 2024
8e8c8da
Merge branch 'minh/v3' into whitelisting-v1
StrathCole May 14, 2024
8c8100b
- fix v2/v3 for taxexemption module merge
StrathCole May 14, 2024
285d562
- add upgrade handler back again
StrathCole May 14, 2024
45eaff9
- fix errors from sdk 0.47
StrathCole May 14, 2024
bed0a18
- regenerate proto files
StrathCole May 14, 2024
50773f5
Merge branch 'main' into whitelisting-v1
StrathCole Jul 20, 2024
68121ed
Merge branch 'main' into whitelisting-v1
StrathCole Sep 8, 2024
d28808a
Merge branch 'main' into whitelisting-v1
StrathCole Sep 28, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ import (
v8_1 "github.com/classic-terra/core/v3/app/upgrades/v8_1"
v8_2 "github.com/classic-terra/core/v3/app/upgrades/v8_2"
v8_3 "github.com/classic-terra/core/v3/app/upgrades/v8_3"
v9 "github.com/classic-terra/core/v3/app/upgrades/v9"

customante "github.com/classic-terra/core/v3/custom/auth/ante"
custompost "github.com/classic-terra/core/v3/custom/auth/post"
Expand Down Expand Up @@ -91,6 +92,7 @@ var (
v8_1.Upgrade,
v8_2.Upgrade,
v8_3.Upgrade,
v9.Upgrade,
}

// Forks defines forks to be applied to the network
Expand Down Expand Up @@ -234,6 +236,7 @@ func NewTerraApp(
FeegrantKeeper: app.FeeGrantKeeper,
OracleKeeper: app.OracleKeeper,
TreasuryKeeper: app.TreasuryKeeper,
TaxExemptionKeeper: app.TaxExemptionKeeper,
SigGasConsumer: ante.DefaultSigVerificationGasConsumer,
SignModeHandler: encodingConfig.TxConfig.SignModeHandler(),
IBCKeeper: *app.IBCKeeper,
Expand Down
13 changes: 13 additions & 0 deletions app/keepers/keepers.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ import (
markettypes "github.com/classic-terra/core/v3/x/market/types"
oraclekeeper "github.com/classic-terra/core/v3/x/oracle/keeper"
oracletypes "github.com/classic-terra/core/v3/x/oracle/types"
taxexemptionkeeper "github.com/classic-terra/core/v3/x/taxexemption/keeper"
taxexemptiontypes "github.com/classic-terra/core/v3/x/taxexemption/types"
treasurykeeper "github.com/classic-terra/core/v3/x/treasury/keeper"
treasurytypes "github.com/classic-terra/core/v3/x/treasury/types"
)
Expand Down Expand Up @@ -99,6 +101,7 @@ type AppKeepers struct {
OracleKeeper oraclekeeper.Keeper
MarketKeeper marketkeeper.Keeper
TreasuryKeeper treasurykeeper.Keeper
TaxExemptionKeeper taxexemptionkeeper.Keeper
WasmKeeper wasmkeeper.Keeper
DyncommKeeper dyncommkeeper.Keeper
IBCHooksKeeper *ibchookskeeper.Keeper
Expand Down Expand Up @@ -154,6 +157,7 @@ func NewAppKeepers(
oracletypes.StoreKey,
markettypes.StoreKey,
treasurytypes.StoreKey,
taxexemptiontypes.StoreKey,
wasmtypes.StoreKey,
dyncommtypes.StoreKey,
)
Expand Down Expand Up @@ -343,6 +347,13 @@ func NewAppKeepers(
&appKeepers.WasmKeeper, distrtypes.ModuleName,
)

appKeepers.TaxExemptionKeeper = taxexemptionkeeper.NewKeeper(
appCodec, appKeepers.keys[taxexemptiontypes.StoreKey],
appKeepers.GetSubspace(taxexemptiontypes.ModuleName),
appKeepers.AccountKeeper,
string(appKeepers.AccountKeeper.GetModuleAddress(govtypes.ModuleName)),
)

hooksKeeper := ibchookskeeper.NewKeeper(
appKeepers.keys[ibchookstypes.StoreKey],
)
Expand Down Expand Up @@ -388,6 +399,7 @@ func NewAppKeepers(
appKeepers.IBCKeeper.ChannelKeeper,
scopedWasmKeeper,
appKeepers.BankKeeper,
appKeepers.TaxExemptionKeeper,
appKeepers.TreasuryKeeper,
appKeepers.AccountKeeper,
appCodec,
Expand Down Expand Up @@ -501,6 +513,7 @@ func initParamsKeeper(
paramsKeeper.Subspace(icacontrollertypes.SubModuleName)
paramsKeeper.Subspace(markettypes.ModuleName)
paramsKeeper.Subspace(oracletypes.ModuleName)
paramsKeeper.Subspace(taxexemptiontypes.ModuleName)
paramsKeeper.Subspace(treasurytypes.ModuleName)
paramsKeeper.Subspace(wasmtypes.ModuleName)
paramsKeeper.Subspace(dyncommtypes.ModuleName)
Expand Down
14 changes: 14 additions & 0 deletions app/modules.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ import (
markettypes "github.com/classic-terra/core/v3/x/market/types"
"github.com/classic-terra/core/v3/x/oracle"
oracletypes "github.com/classic-terra/core/v3/x/oracle/types"
"github.com/classic-terra/core/v3/x/taxexemption"
taxexemptionclient "github.com/classic-terra/core/v3/x/taxexemption/client"
taxexemptiontypes "github.com/classic-terra/core/v3/x/taxexemption/types"
"github.com/classic-terra/core/v3/x/treasury"
treasuryclient "github.com/classic-terra/core/v3/x/treasury/client"
treasurytypes "github.com/classic-terra/core/v3/x/treasury/types"
Expand Down Expand Up @@ -104,6 +107,11 @@ var (
ibcclientclient.UpgradeProposalHandler,
treasuryclient.ProposalAddBurnTaxExemptionAddressHandler,
treasuryclient.ProposalRemoveBurnTaxExemptionAddressHandler,
taxexemptionclient.ProposalAddTaxExemptionZoneHandler,
taxexemptionclient.ProposalRemoveTaxExemptionZoneHandler,
taxexemptionclient.ProposalModifyTaxExemptionZoneHandler,
taxexemptionclient.ProposalAddTaxExemptionAddressHandler,
taxexemptionclient.ProposalRemoveTaxExemptionAddressHandler,
},
),
customparams.AppModuleBasic{},
Expand All @@ -120,6 +128,7 @@ var (
oracle.AppModuleBasic{},
market.AppModuleBasic{},
treasury.AppModuleBasic{},
taxexemption.AppModuleBasic{},
customwasm.AppModuleBasic{},
ibcfee.AppModuleBasic{},
dyncomm.AppModuleBasic{},
Expand Down Expand Up @@ -182,6 +191,7 @@ func appModules(
market.NewAppModule(appCodec, app.MarketKeeper, app.AccountKeeper, app.BankKeeper, app.OracleKeeper),
oracle.NewAppModule(appCodec, app.OracleKeeper, app.AccountKeeper, app.BankKeeper),
treasury.NewAppModule(appCodec, app.TreasuryKeeper),
taxexemption.NewAppModule(appCodec, app.TaxExemptionKeeper),
wasm.NewAppModule(appCodec, &app.WasmKeeper, app.StakingKeeper, app.AccountKeeper, app.BankKeeper, app.MsgServiceRouter(), app.GetSubspace(wasmtypes.ModuleName)),
dyncomm.NewAppModule(appCodec, app.DyncommKeeper, app.StakingKeeper),
ibchooks.NewAppModule(app.AccountKeeper),
Expand Down Expand Up @@ -216,6 +226,7 @@ func simulationModules(
oracle.NewAppModule(appCodec, app.OracleKeeper, app.AccountKeeper, app.BankKeeper),
market.NewAppModule(appCodec, app.MarketKeeper, app.AccountKeeper, app.BankKeeper, app.OracleKeeper),
treasury.NewAppModule(appCodec, app.TreasuryKeeper),
taxexemption.NewAppModule(appCodec, app.TaxExemptionKeeper),
wasm.NewAppModule(appCodec, &app.WasmKeeper, app.StakingKeeper, app.AccountKeeper, app.BankKeeper, app.MsgServiceRouter(), app.GetSubspace(wasmtypes.ModuleName)),
dyncomm.NewAppModule(appCodec, app.DyncommKeeper, app.StakingKeeper),
}
Expand Down Expand Up @@ -247,6 +258,7 @@ func orderBeginBlockers() []string {
// Terra Classic modules
oracletypes.ModuleName,
treasurytypes.ModuleName,
taxexemptiontypes.ModuleName,
markettypes.ModuleName,
wasmtypes.ModuleName,
dyncommtypes.ModuleName,
Expand Down Expand Up @@ -281,6 +293,7 @@ func orderEndBlockers() []string {
// Terra Classic modules
oracletypes.ModuleName,
treasurytypes.ModuleName,
taxexemptiontypes.ModuleName,
markettypes.ModuleName,
wasmtypes.ModuleName,
dyncommtypes.ModuleName,
Expand Down Expand Up @@ -316,6 +329,7 @@ func orderInitGenesis() []string {
markettypes.ModuleName,
oracletypes.ModuleName,
treasurytypes.ModuleName,
taxexemptiontypes.ModuleName,
wasmtypes.ModuleName,
dyncommtypes.ModuleName,
// consensus module
Expand Down
19 changes: 19 additions & 0 deletions app/upgrades/v9/constants.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package v9

import (
"github.com/classic-terra/core/v3/app/upgrades"
taxexemptiontypes "github.com/classic-terra/core/v3/x/taxexemption/types"
store "github.com/cosmos/cosmos-sdk/store/types"
)

const UpgradeName = "v9"

var Upgrade = upgrades.Upgrade{
UpgradeName: UpgradeName,
CreateUpgradeHandler: CreateV9UpgradeHandler,
StoreUpgrades: store.StoreUpgrades{
Added: []string{
taxexemptiontypes.StoreKey,
},
},
}
41 changes: 41 additions & 0 deletions app/upgrades/v9/upgrades.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
package v9

import (
"github.com/classic-terra/core/v3/app/keepers"
"github.com/classic-terra/core/v3/app/upgrades"
treasurytypes "github.com/classic-terra/core/v3/x/treasury/types"
"github.com/cosmos/cosmos-sdk/store/prefix"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/module"
upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types"
)

func CreateV9UpgradeHandler(
mm *module.Manager,
cfg module.Configurator,
_ upgrades.BaseAppParamManager,
k *keepers.AppKeepers,
) upgradetypes.UpgradeHandler {
return func(c sdk.Context, _ upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) {
// migrate old treasurykeeper tax exemption to new tax exemption keeper
// tax exemption keeper is now a module

// get old tax exemption keeper
sub := prefix.NewStore(c.KVStore(k.TreasuryKeeper.GetStoreKey()), treasurytypes.BurnTaxExemptionListPrefix)

intoZone := "Binance"

// iterate through all tax exemptions
iterator := sub.Iterator(nil, nil)
defer iterator.Close()
for ; iterator.Valid(); iterator.Next() {
// get tax exemption address
address := string(iterator.Key())

// add tax exemption address to new tax exemption keeper
k.TaxExemptionKeeper.AddTaxExemptionAddress(c, intoZone, address)
}

return mm.RunMigrations(c, cfg, fromVM)
}
}
8 changes: 8 additions & 0 deletions client/docs/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,14 @@
}
}
},
{
"url": "./tmp-swagger-gen/terra/taxexemption/v1beta1/query.swagger.json",
"operationIds": {
"rename": {
"Params": "TaxExemptionParams"
}
}
},
{
"url": "./tmp-swagger-gen/terra/dyncomm/v1beta1/query.swagger.json",
"operationIds": {
Expand Down
2 changes: 1 addition & 1 deletion client/docs/statik/statik.go

Large diffs are not rendered by default.

Loading
Loading